/* ================================================
   DOQUE — Account & Favorites UI
   Header butonları, login/register modal, favori kalp
================================================== */

/* -------- Header action buttons (heart, person) -------- */
.header-actions {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-left: 4px;
}

.header-action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: transparent;
    border: 1px solid transparent;
    color: #1a1a1a;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.25s ease, color 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.header-action:hover,
.header-action:focus-visible {
    background: rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.header-action svg {
    width: 19px;
    height: 19px;
}

/* Ana sayfa video üzerinde — beyaz ikonlar */
body.home header:not(.scrolled) .header-action {
    color: #ffffff;
}

body.home header:not(.scrolled) .header-action:hover,
body.home header:not(.scrolled) .header-action:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
}

/* Favori badge — sağ üstte küçük rakam */
.header-action-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #1a1a1a;
    color: #ffffff;
    font-family: 'Arial', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    box-shadow: 0 0 0 2px #ffffff;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.header-action-badge[hidden] { display: none; }

body.home header:not(.scrolled) .header-action-badge {
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.25);
}

/* Giriş yapılmışsa hesap butonu vurgulu */
.header-action.is-logged-in {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.18);
}

body.home header:not(.scrolled) .header-action.is-logged-in {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.4);
}

/* -------- Header Account Dropdown Menu -------- */
.header-account-wrap {
    position: relative;
    display: inline-flex;
}

.header-account-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 180px;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 8px;
    box-shadow: 0 18px 40px -10px rgba(0, 0, 0, 0.18),
                0 2px 8px rgba(0, 0, 0, 0.05);
    z-index: 1100;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.header-account-menu.is-open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

.header-account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 14px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: #1a1a1a;
    font-family: 'Arial', sans-serif;
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.header-account-item:hover,
.header-account-item:focus-visible {
    background: rgba(0, 0, 0, 0.05);
    padding-left: 18px;
    outline: none;
}

.header-account-item svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

.header-account-item:hover svg {
    opacity: 1;
}

/* -------- Account modal -------- */
.account-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
    padding: 1rem;
}

.account-modal.open {
    opacity: 1;
    visibility: visible;
}

.account-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

.account-modal-card {
    position: relative;
    background: #ffffff;
    color: #1a1a1a;
    width: 100%;
    max-width: 440px;
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    border-radius: 18px;
    padding: 2.5rem 2.25rem 2rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35), 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(20px) scale(0.96);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.account-modal.open .account-modal-card {
    transform: translateY(0) scale(1);
}

.account-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    color: #1a1a1a;
    font-size: 1.6rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.account-modal-close:hover { background: rgba(0, 0, 0, 0.09); transform: rotate(90deg); }

.account-modal-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.account-modal-logo {
    font-family: 'Arial', sans-serif;
    font-size: 0.78rem;
    letter-spacing: 5px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 0.6rem;
}

.account-modal-title {
    font-family: 'Times New Roman', serif;
    font-size: 1.7rem;
    font-weight: 400;
    letter-spacing: 1px;
    margin: 0 0 0.4rem;
}

.account-modal-subtitle {
    font-family: 'Arial', sans-serif;
    font-size: 0.82rem;
    color: rgba(0, 0, 0, 0.5);
    margin: 0 0 0.5rem;
    letter-spacing: 0.5px;
}

/* Form */
.account-form {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

/* KRİTİK: hidden attribute'unun display:flex tarafından ezilmesini engelle.
   Bu olmazsa modal'da iki form aynı anda görünür. */
.account-form[hidden] {
    display: none !important;
}

.account-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.account-field-label {
    font-family: 'Arial', sans-serif;
    font-size: 0.7rem;
    letter-spacing: 1.8px;
    text-transform: uppercase;
    color: rgba(0, 0, 0, 0.6);
}

.account-field input {
    padding: 0.85rem 1rem;
    border: 1px solid rgba(0, 0, 0, 0.18);
    border-radius: 10px;
    background: #ffffff;
    font-family: 'Arial', sans-serif;
    font-size: 0.95rem;
    color: #1a1a1a;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}

.account-field input:focus {
    outline: none;
    border-color: #1a1a1a;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.06);
}

.account-form-message {
    min-height: 1.2em;
    font-family: 'Arial', sans-serif;
    font-size: 0.85rem;
    line-height: 1.4;
    margin: -0.4rem 0;
}

.account-form-message.error { color: #c0392b; }
.account-form-message.success { color: #1e7e34; }

.account-submit {
    margin-top: 0.4rem;
    padding: 0.95rem 1.5rem;
    background: #1a1a1a;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    font-family: 'Arial', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.account-submit:hover {
    background: #000000;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.account-submit:active { transform: translateY(0); }

.account-form-switch {
    text-align: center;
    margin: 0.6rem 0 0;
    font-family: 'Arial', sans-serif;
    font-size: 0.85rem;
    color: rgba(0, 0, 0, 0.6);
}

.account-form-switch a {
    color: #1a1a1a;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 500;
    margin-left: 4px;
}

body.modal-open {
    overflow: hidden;
}

/* -------- Favorite heart icon (product cards & detail) -------- */
.favorite-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: #1a1a1a;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s, color 0.2s, box-shadow 0.2s;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.favorite-toggle svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    transition: fill 0.2s ease, transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.favorite-toggle:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.favorite-toggle.is-favorite {
    color: #c0392b;
}

.favorite-toggle.is-favorite svg {
    fill: currentColor;
    transform: scale(1.05);
    animation: heartPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes heartPop {
    0% { transform: scale(0.8); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1.05); }
}

/* -------- Mobile tweaks -------- */
@media (max-width: 768px) {
    .header-action {
        width: 36px;
        height: 36px;
    }
    .header-action svg {
        width: 18px;
        height: 18px;
    }
    .account-modal-card {
        padding: 2rem 1.5rem 1.5rem;
        max-width: 100%;
        border-radius: 14px;
    }
    .account-modal-title { font-size: 1.4rem; }
}

/* ================================================
   EK ANİMASYONLAR — Polish
================================================== */

/* Favori kalp atışı */
@keyframes fav-heartbeat {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.25); }
    50% { transform: scale(0.95); }
    75% { transform: scale(1.1); }
}

.favorite-toggle.is-active svg {
    animation: fav-heartbeat 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Toast/notification giriş */
@keyframes account-toast-in {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-12px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.account-toast {
    animation: account-toast-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Modal backdrop blur giriş */
@keyframes modal-backdrop-fade {
    from { opacity: 0; backdrop-filter: blur(0); }
    to { opacity: 1; backdrop-filter: blur(8px); }
}

.account-modal-backdrop.is-open {
    animation: modal-backdrop-fade 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Modal kart giriş animasyonu */
@keyframes modal-card-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.account-modal-backdrop.is-open .account-modal-card {
    animation: modal-card-in 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* Account header butonu — micro-interaction */
.account-trigger {
    transition: background 0.25s ease, transform 0.2s ease, color 0.25s ease;
}

.account-trigger:hover {
    transform: translateY(-1px);
}

.account-trigger:active {
    transform: translateY(0);
}

/* Submit button loading state */
.account-modal-submit.is-loading {
    pointer-events: none;
    opacity: 0.7;
    position: relative;
}

.account-modal-submit.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    animation: account-spin 0.7s linear infinite;
}

@keyframes account-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}
