/* auth.css - Authentication modal and user menu styles */

/* ── Auth Modal ──────────────────────────────────────────── */

.auth-modal-card {
    max-width: 420px !important;
    padding: 2rem !important;
}

.auth-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-logo {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.auth-header h2 {
    font-size: 1.4rem;
    margin-bottom: 0.3rem;
    background: linear-gradient(135deg, var(--t1), var(--acc2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.auth-subtitle {
    font-size: 0.82rem;
    color: var(--t3);
    line-height: 1.4;
}

/* ── OAuth Buttons ───────────────────────────────────────── */

.auth-oauth {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.65rem 1rem;
    border-radius: var(--r-m);
    font-size: 0.88rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.google-btn {
    background: #fff;
    color: #3c4043;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.google-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.oauth-icon {
    flex-shrink: 0;
}

/* ── Divider ─────────────────────────────────────────────── */

.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--bdr);
}

.auth-divider span {
    font-size: 0.75rem;
    color: var(--t3);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Form Fields ─────────────────────────────────────────── */

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.auth-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.auth-field label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--t2);
}

.field-opt {
    font-weight: 400;
    color: var(--t3);
}

.auth-field input {
    background: var(--bg-3);
    border: 1px solid var(--bdr);
    border-radius: var(--r-s);
    padding: 0.6rem 0.75rem;
    color: var(--t1);
    font-size: 0.88rem;
    font-family: inherit;
    transition: all 0.2s;
}

.auth-field input:focus {
    outline: none;
    border-color: var(--acc);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.08);
}

.auth-field input::placeholder {
    color: var(--t3);
}

/* ── Error Message ───────────────────────────────────────── */

.auth-error {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--r-s);
    padding: 0.5rem 0.75rem;
    font-size: 0.82rem;
    color: #f87171;
}

/* ── Submit Button ───────────────────────────────────────── */

.auth-submit-btn {
    width: 100%;
    padding: 0.7rem;
    background: linear-gradient(135deg, var(--acc), var(--acc2));
    border: none;
    border-radius: var(--r-m);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(56, 189, 248, 0.2);
    margin-top: 0.25rem;
}

.auth-submit-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(56, 189, 248, 0.3);
}

.auth-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* ── Toggle Login/Signup ─────────────────────────────────── */

.auth-switch {
    text-align: center;
    font-size: 0.82rem;
    color: var(--t3);
}

.auth-switch-btn {
    background: none;
    border: none;
    color: var(--acc);
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s;
}

.auth-switch-btn:hover {
    color: var(--acc2);
    text-decoration: underline;
}

/* ── User Menu (Header) ─────────────────────────────────── */

#user-menu {
    display: flex;
    align-items: center;
}

.signin-btn {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.1), rgba(34, 211, 238, 0.1));
    border: 1px solid rgba(56, 189, 248, 0.2);
    color: var(--acc);
    padding: 0.35rem 0.9rem;
    border-radius: var(--r-m);
    font-size: 0.82rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.signin-btn:hover {
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.18), rgba(34, 211, 238, 0.18));
    border-color: var(--acc);
}

.user-menu-auth {
    position: relative;
}

.user-avatar-btn {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid var(--bdr-h);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-3);
    transition: border-color 0.2s;
}

.user-avatar-btn:hover {
    border-color: var(--acc);
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.user-avatar-initials {
    font-family: 'Outfit', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--acc);
}

/* ── User Dropdown ───────────────────────────────────────── */

.user-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--bg-3);
    border: 1px solid var(--bdr);
    border-radius: var(--r-m);
    min-width: 200px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    z-index: 300;
    overflow: hidden;
}

.dropdown-user-info {
    padding: 0.75rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
}

.dropdown-name {
    font-weight: 600;
    font-size: 0.85rem;
}

.dropdown-email {
    font-size: 0.72rem;
    color: var(--t3);
}

.dropdown-divider {
    height: 1px;
    background: var(--bdr);
}

.dropdown-item {
    display: block;
    width: 100%;
    padding: 0.55rem 1rem;
    background: none;
    border: none;
    color: var(--t2);
    font-size: 0.82rem;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--bg-4);
    color: var(--t1);
}

.dropdown-logout {
    color: var(--t2);
}

.dropdown-logout:hover {
    background: rgba(248, 113, 113, 0.06);
}

/* Override header-right to flex for search + user menu */
.header-right {
    display: flex !important;
    align-items: center;
    gap: 0.75rem;
}