/* =========================================================
   HEADER
   ========================================================= */

.site-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    background: #ffffff;
}

.site-header-row {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 32px;
}

.brand {
    color: #111827;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.header-search {
    width: 100%;
    max-width: 480px;
    display: flex;
    align-items: center;
}

.header-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-right: none;
    border-radius: 12px 0 0 12px;
    font-size: 15px;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    outline: none;
    transition: border-color 0.15s;
}

.header-search-input:focus {
    border-color: #9ca3af;
}

.header-search-input::placeholder {
    color: #94a3b8;
}

.header-search-btn {
    padding: 10px 14px;
    border: 1px solid #e5e7eb;
    border-left: none;
    border-radius: 0 12px 12px 0;
    background: #111827;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    transition: background 0.15s;
}

.header-search-btn:hover {
    background: #1f2937;
}

/* =========================================================
   HEADER NAV LINKS (Dictionary / My decks)
   ========================================================= */

.header-nav-link {
    color: #374151;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    flex-shrink: 0;
    white-space: nowrap;
    padding-bottom: 2px;
}

.header-nav-link:hover {
    color: #111827;
}

.header-nav-link.header-nav-active {
    color: #111827;
    border-bottom: 2px solid #111827;
    padding-bottom: 0;
}

/* =========================================================
   BREADCRUMBS
   ========================================================= */

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 0;
    font-size: 13px;
    color: #94a3b8;
}

.breadcrumbs a {
    color: #6b7280;
    text-decoration: none;
    transition: color 0.15s;
}

.breadcrumbs a:hover {
    color: #111827;
}

.breadcrumbs span {
    color: #94a3b8;
}

.breadcrumbs strong {
    color: #111827;
    font-weight: 500;
}

/* =========================================================
   UTILITIES
   ========================================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.site-footer {
    text-align: center;
    padding: 24px 16px;
    color: #94a3b8;
    font-size: 13px;
    border-top: 1px solid #e5e7eb;
    margin-top: auto;
}

/* =========================================================
   MOBILE — single unified block
   ========================================================= */

@media (max-width: 600px) {
    .site-header {
        padding: 12px 16px;
        gap: 10px;
    }

    .site-header-row {
        gap: 16px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .header-search {
        max-width: 100%;
    }

    .header-nav-link {
        font-size: 12px;
    }

    .breadcrumbs {
        padding: 10px 16px;
    }
}

/* =========================================================
   RTL SUPPORT (Arabic)
   ========================================================= */

[dir="rtl"] .site-header {
    direction: ltr;
}

[dir="rtl"] .header-search-input {
    direction: rtl;
    text-align: right;
    border-radius: 12px 0 0 12px;
    border-right: none;
    border-left: 1px solid #e5e7eb;
}

[dir="rtl"] .header-search-btn {
    border-radius: 0 12px 12px 0;
    border-left: none;
    border-right: 1px solid #e5e7eb;
}

[dir="rtl"] .breadcrumbs {
    flex-direction: row-reverse;
}

/* =========================================================
   HEADER AUTH (login / logout)
   ========================================================= */

.header-auth {
    position: relative;
    z-index: 2;

    display: flex;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
/* .header-auth[hidden] { display: none; } */
.header-login-btn {
    padding: 8px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #111827;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.header-login-btn:hover {
    background: #1f2937;
}

.header-logged-in {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2px;
    font-size: 13px;
}

.header-logged-in a {
    color: #6b7280;
    text-decoration: none;
    line-height: 1.3;
    transition: color 0.15s;
}

.header-logged-in a:hover {
    color: #111827;
}

.header-lang-label {
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

a.header-lang-label:hover {
    color: #374151;
}

.header-login-btn[hidden],
.header-logged-in[hidden] {
    display: none;
}
/* =========================================================
   LOGIN MODAL
   ========================================================= */

.login-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.login-modal-overlay[hidden] {
    display: none;
}

.login-modal {
    position: relative;
    background: #ffffff;
    border-radius: 12px;
    padding: 32px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 60px rgba(17, 24, 39, 0.25);
}

.login-modal h2 {
    margin: 0 0 8px;
    font-size: 18px;
    color: #111827;
    font-weight: 700;
}

.login-modal p {
    margin: 0 0 16px;
    color: #94a3b8;
    font-size: 14px;
}

.login-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px 8px;
    transition: color 0.15s;
}

.login-modal-close:hover {
    color: #111827;
}

/* Each step div (login-step-login, login-step-register, etc.) is a plain
   block with no conflicting display rule of its own, so its native
   [hidden] behavior is never overridden — no need for the
   "[hidden] vs display:flex" fix here, unlike .login-modal-overlay above. */

.login-modal input[type="email"],
.login-modal input[type="password"],
.login-modal input[type="text"] {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: #111827;
    background: #ffffff;
    outline: none;
    box-sizing: border-box;
    margin-bottom: 12px;
    transition: border-color 0.15s;
}

.login-modal input[type="email"]:focus,
.login-modal input[type="password"]:focus,
.login-modal input[type="text"]:focus {
    border-color: #9ca3af;
}

.login-modal input::placeholder {
    color: #94a3b8;
}

.login-modal button:not(.login-modal-close) {
    width: 100%;
    padding: 10px 16px;
    background: #111827;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.login-modal button:not(.login-modal-close):hover {
    background: #1f2937;
}

.login-error {
    color: #991b1b;
    font-size: 13px;
    margin-top: 8px;
    margin-bottom: 0;
}

#login-verify-email-display,
#login-forgot-confirm-email-display {
    font-weight: 600;
    color: #111827;
}

.login-links {
    margin: 12px 0 0;
    font-size: 13px;
    color: #94a3b8;
}

.login-links a {
    color: #374151;
    text-decoration: none;
    font-weight: 600;
}

.login-links a:hover {
    color: #111827;
    text-decoration: underline;
}

#login-resend-status {
    margin-left: 8px;
    font-size: 13px;
    color: #16a34a;
    font-weight: 600;
}

/* =========================================================
   MOBILE — header auth
   ========================================================= */

@media (max-width: 600px) {
    .header-login-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .login-modal {
        max-width: calc(100% - 32px);
        padding: 24px;
    }

    .header-auth {
        width: 100%;
        justify-content: center;
        gap: 8px;
        margin-top: 2px;
    }

    .header-logged-in {
        flex-direction: row;
        align-items: baseline;
        gap: 6px;
    }

    .header-lang-label {
        font-size: 11px;
    }
}
.gated-placeholder {
    text-align: center;
    padding: 32px 16px;
}

.gated-placeholder p {
    color: #94a3b8;
    font-size: 15px;
    margin: 0 0 16px;
}

.gated-placeholder .header-login-btn {
    display: inline-block;
}