/* ===== AUTH SYSTEM STYLES ===== */

/* ===== NAV USER AREA ===== */
.nav-user-area { display: flex; align-items: center; gap: 12px; margin-left: 1.5rem; }

.nav-login-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 22px; border: 1px solid rgba(166,110,247,0.35); border-radius: 12px;
    background: linear-gradient(135deg, rgba(166,110,247,0.15), rgba(92,200,223,0.08));
    color: var(--white); cursor: pointer;
    font-family: var(--font-display); font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    transition: background 300ms ease, border-color 300ms ease, transform 200ms var(--ease-spring), box-shadow 300ms ease;
}
.nav-login-btn:hover {
    background: linear-gradient(135deg, rgba(166,110,247,0.3), rgba(92,200,223,0.18));
    border-color: rgba(166,110,247,0.5);
    transform: translateY(-1px); box-shadow: 0 4px 20px rgba(166,110,247,0.15);
}
.nav-login-btn:active { transform: scale(0.95); }
.nav-login-btn svg { width: 14px; height: 14px; opacity: 0.8; }

/* User avatar button (logged in) */
.nav-user-avatar-btn {
    position: relative; display: none; align-items: center; gap: 10px;
    padding: 4px 14px 4px 4px; border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px; background: rgba(255,255,255,0.04); cursor: pointer;
    transition: background 250ms ease, border-color 250ms ease;
}
.nav-user-avatar-btn:hover { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.18); }
.nav-user-avatar-btn.show { display: flex; }

.nav-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 0.7rem; font-weight: 800;
    color: var(--white); flex-shrink: 0;
}

.nav-user-name {
    font-family: var(--font-body); font-size: 0.82rem; font-weight: 600;
    color: var(--white); max-width: 100px;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.nav-user-arrow {
    width: 10px; height: 10px; color: var(--muted);
    transition: transform 250ms ease;
}
.nav-user-avatar-btn.dropdown-open .nav-user-arrow { transform: rotate(180deg); }

/* ===== USER DROPDOWN ===== */
.user-dropdown {
    position: absolute; top: calc(100% + 10px); right: 0;
    min-width: 220px; padding: 8px;
    background: rgba(15, 8, 30, 0.95);
    -webkit-backdrop-filter: blur(30px); backdrop-filter: blur(30px);
    border: 1px solid rgba(255,255,255,0.1); border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(166,110,247,0.08);
    opacity: 0; transform: translateY(-8px) scale(0.96);
    pointer-events: none;
    transition: opacity 250ms var(--ease-out-expo), transform 250ms var(--ease-out-expo);
    z-index: 120;
}
.user-dropdown.open { opacity: 1; transform: translateY(0) scale(1); pointer-events: all; }

.dropdown-user-card {
    display: flex; align-items: center; gap: 12px;
    padding: 12px; margin-bottom: 6px;
    border-radius: 12px; background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
}

.dropdown-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 0.85rem; font-weight: 800;
    color: var(--white); flex-shrink: 0;
}

.dropdown-user-info { min-width: 0; }
.dropdown-user-nickname {
    font-size: 0.88rem; font-weight: 700; color: var(--white);
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dropdown-user-id {
    font-size: 0.65rem; color: var(--muted); margin-top: 2px;
    font-family: var(--font-display); letter-spacing: 0.04em;
}

.dropdown-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 4px 8px; }

.dropdown-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px; border-radius: 10px; cursor: pointer;
    color: var(--muted); font-size: 0.82rem; font-weight: 500;
    transition: background 200ms ease, color 200ms ease;
    border: none; background: none; width: 100%; text-align: left;
    font-family: var(--font-body);
}
.dropdown-item:hover { background: rgba(255,255,255,0.06); color: var(--white); }
.dropdown-item svg { width: 16px; height: 16px; opacity: 0.6; flex-shrink: 0; }
.dropdown-item.danger { color: rgba(224,96,100,0.8); }
.dropdown-item.danger:hover { background: rgba(224,96,100,0.08); color: #e06064; }

/* ===== AUTH MODAL ===== */
.auth-modal-backdrop {
    display: none; position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,0.65);
    -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
    justify-content: center; align-items: center;
    opacity: 0; transition: opacity 350ms ease;
}
.auth-modal-backdrop.show { display: flex; opacity: 1; }

.auth-modal {
    position: relative; width: 92%; max-width: 440px;
    background: linear-gradient(160deg, rgba(18, 10, 38, 0.97), rgba(8, 4, 18, 0.99));
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 24px; overflow: hidden;
    transform: translateY(24px) scale(0.95);
    transition: transform 400ms var(--ease-out-back);
    box-shadow: 0 32px 80px rgba(0,0,0,0.6), 0 0 80px rgba(166,110,247,0.06);
}
.auth-modal-backdrop.show .auth-modal { transform: translateY(0) scale(1); }

/* Decorative top gradient bar */
.auth-modal::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, var(--neon-purple), var(--neon-pink), var(--neon-cyan));
    background-size: 200% 100%; animation: accent-sweep 4s linear infinite;
}

.auth-modal-close {
    position: absolute; top: 16px; right: 16px; z-index: 5;
    width: 32px; height: 32px; border: none; border-radius: 50%;
    background: rgba(255,255,255,0.06); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); transition: background 200ms ease, color 200ms ease, transform 200ms ease;
}
.auth-modal-close:hover { background: rgba(255,255,255,0.12); color: var(--white); transform: rotate(90deg); }
.auth-modal-close svg { width: 16px; height: 16px; }

.auth-modal-body { padding: 2.5rem 2.2rem 2rem; }

/* Auth header */
.auth-header { text-align: center; margin-bottom: 2rem; }
.auth-logo {
    width: 48px; height: 48px; margin: 0 auto 1rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(166,110,247,0.3), rgba(92,200,223,0.2));
    display: flex; align-items: center; justify-content: center;
}
.auth-logo img { width: 28px; height: 28px; }
.auth-title {
    font-family: var(--font-display); font-size: 1.15rem; font-weight: 900;
    letter-spacing: 0.08em; margin-bottom: 0.4rem;
}
.auth-subtitle { font-size: 0.82rem; color: var(--muted); font-weight: 400; }

/* Auth tabs */
.auth-tabs {
    display: flex; gap: 4px; margin-bottom: 1.8rem;
    background: rgba(255,255,255,0.04); border-radius: 14px; padding: 4px;
}
.auth-tab {
    flex: 1; padding: 9px 0; text-align: center; cursor: pointer;
    font-family: var(--font-display); font-size: 0.62rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    color: var(--muted); border: none; background: none; border-radius: 11px;
    transition: color 250ms ease, background 250ms ease;
}
.auth-tab:hover { color: var(--white); }
.auth-tab.active {
    color: var(--white);
    background: linear-gradient(135deg, rgba(166,110,247,0.3), rgba(92,200,223,0.15));
    box-shadow: 0 2px 12px rgba(166,110,247,0.1);
}

/* Auth forms */
.auth-form { display: none; flex-direction: column; gap: 14px; }
.auth-form.active { display: flex; }

.auth-field { position: relative; }

.auth-field-label {
    display: block; margin-bottom: 6px;
    font-family: var(--font-display); font-size: 0.55rem; font-weight: 600;
    letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted);
}

.auth-field-optional {
    font-family: var(--font-body); font-size: 0.68rem;
    color: rgba(154,143,181,0.4); font-weight: 400; letter-spacing: 0;
    text-transform: none; margin-left: 6px;
}

.auth-input {
    width: 100%; padding: 12px 16px 12px 44px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 14px; outline: none;
    color: var(--white); font-family: var(--font-body);
    font-size: 0.88rem; font-weight: 500;
    transition: border-color 300ms ease, background 300ms ease, box-shadow 300ms ease;
}
.auth-input::placeholder { color: rgba(154,143,181,0.35); }
.auth-input:focus {
    border-color: rgba(166,110,247,0.4);
    background: rgba(255,255,255,0.07);
    box-shadow: 0 0 0 3px rgba(166,110,247,0.06);
}
.auth-input.error {
    border-color: rgba(224,96,100,0.5);
    box-shadow: 0 0 0 3px rgba(224,96,100,0.06);
}

.auth-field-icon {
    position: absolute; left: 14px; bottom: 12px;
    width: 16px; height: 16px; color: var(--muted); pointer-events: none;
    opacity: 0.5;
}

.auth-toggle-pw {
    position: absolute; right: 14px; bottom: 10px;
    background: none; border: none; cursor: pointer;
    color: var(--muted); padding: 2px; display: flex;
    transition: color 200ms ease;
}
.auth-toggle-pw:hover { color: var(--white); }
.auth-toggle-pw svg { width: 16px; height: 16px; }

/* Error message */
.auth-error {
    font-size: 0.75rem; color: #e06064; font-weight: 500;
    padding: 8px 14px; border-radius: 10px;
    background: rgba(224,96,100,0.08); border: 1px solid rgba(224,96,100,0.1);
    display: none; align-items: center; gap: 6px;
}
.auth-error.show { display: flex; }
.auth-error svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Success message */
.auth-success {
    font-size: 0.75rem; color: var(--neon-green); font-weight: 500;
    padding: 8px 14px; border-radius: 10px;
    background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.1);
    display: none; align-items: center; gap: 6px;
}
.auth-success.show { display: flex; }
.auth-success svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Submit button */
.auth-submit {
    width: 100%; padding: 14px; margin-top: 6px;
    border: none; border-radius: 14px; cursor: pointer;
    background: linear-gradient(135deg, var(--neon-purple), var(--neon-pink));
    background-size: 200% 200%; animation: btn-gradient 5s ease infinite;
    color: var(--white); font-family: var(--font-display);
    font-size: 0.72rem; font-weight: 800;
    letter-spacing: 0.12em; text-transform: uppercase;
    transition: transform 200ms var(--ease-spring), box-shadow 300ms ease;
    box-shadow: 0 4px 20px rgba(166,110,247,0.2);
}
.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px rgba(166,110,247,0.3);
}
.auth-submit:active { transform: scale(0.97); }
.auth-submit:disabled {
    opacity: 0.5; cursor: not-allowed;
    transform: none !important; box-shadow: none !important;
}

@keyframes btn-gradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.auth-switch {
    text-align: center; margin-top: 6px;
    font-size: 0.78rem; color: var(--muted);
}
.auth-switch-link {
    color: var(--neon-cyan); cursor: pointer; font-weight: 600;
    border: none; background: none; font-family: var(--font-body); font-size: 0.78rem;
    transition: color 200ms ease;
}
.auth-switch-link:hover { color: var(--neon-purple); }

/* ===== USER PANEL (FULL OVERLAY) ===== */
.user-panel-backdrop {
    display: none; position: fixed; inset: 0; z-index: 180;
    background: rgba(0,0,0,0.55);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    opacity: 0; transition: opacity 300ms ease;
}
.user-panel-backdrop.show { display: block; opacity: 1; }

.user-panel {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 185;
    width: 420px; max-width: 100vw;
    background: linear-gradient(180deg, rgba(15, 8, 30, 0.98), rgba(8, 4, 18, 0.99));
    border-left: 1px solid rgba(255,255,255,0.08);
    box-shadow: -20px 0 60px rgba(0,0,0,0.4);
    transform: translateX(100%);
    transition: transform 400ms var(--ease-out-expo);
    display: flex; flex-direction: column; overflow: hidden;
}
.user-panel.show { transform: translateX(0); }

.user-panel-header {
    padding: 1.5rem 1.8rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    display: flex; align-items: center; justify-content: space-between;
    flex-shrink: 0;
}
.user-panel-title {
    font-family: var(--font-display); font-size: 0.8rem; font-weight: 800;
    letter-spacing: 0.12em; text-transform: uppercase;
}
.user-panel-close {
    width: 36px; height: 36px; border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; background: rgba(255,255,255,0.04); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: var(--muted); transition: background 200ms ease, color 200ms ease;
}
.user-panel-close:hover { background: rgba(255,255,255,0.1); color: var(--white); }
.user-panel-close svg { width: 16px; height: 16px; }

.user-panel-scroll {
    flex: 1; overflow-y: auto; padding: 1.5rem 1.8rem 2rem;
    display: flex; flex-direction: column; gap: 1.5rem;
}

/* Profile card */
.up-profile-card {
    position: relative; padding: 2rem; text-align: center;
    background: linear-gradient(135deg, rgba(166,110,247,0.08), rgba(92,200,223,0.05));
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 20px; overflow: hidden;
}
.up-profile-card::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 80px;
    background: linear-gradient(135deg, rgba(166,110,247,0.15), rgba(224,96,154,0.1), rgba(92,200,223,0.1));
    opacity: 0.5;
}

.up-avatar {
    position: relative; z-index: 2;
    width: 72px; height: 72px; border-radius: 50%; margin: 0 auto 1rem;
    display: flex; align-items: center; justify-content: center;
    font-family: var(--font-display); font-size: 1.5rem; font-weight: 900;
    color: var(--white);
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    border: 3px solid rgba(255,255,255,0.15);
}
.up-nickname {
    position: relative; z-index: 2;
    font-family: var(--font-display); font-size: 1.1rem; font-weight: 800;
    letter-spacing: 0.04em; margin-bottom: 4px;
}
.up-username {
    position: relative; z-index: 2;
    font-size: 0.75rem; color: var(--muted);
    font-family: var(--font-display); letter-spacing: 0.06em;
}

.up-contact-badges {
    position: relative; z-index: 2;
    display: flex; justify-content: center; gap: 8px; margin-top: 1rem;
}
.up-contact-badge {
    display: flex; align-items: center; gap: 5px;
    padding: 4px 12px; border-radius: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.06);
    font-size: 0.7rem; color: var(--muted); font-weight: 500;
}
.up-contact-badge svg { width: 12px; height: 12px; }

/* Section */
.up-section { }
.up-section-title {
    font-family: var(--font-display); font-size: 0.6rem; font-weight: 700;
    letter-spacing: 0.18em; text-transform: uppercase; color: var(--muted);
    margin-bottom: 0.8rem;
    display: flex; align-items: center; gap: 8px;
}
.up-section-title::after {
    content: ''; flex: 1; height: 1px;
    background: rgba(255,255,255,0.06);
}

/* Info row */
.up-info-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; margin-bottom: 6px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.04);
    border-radius: 12px;
}
.up-info-label {
    font-size: 0.78rem; color: var(--muted); font-weight: 500;
    display: flex; align-items: center; gap: 8px;
}
.up-info-label svg { width: 14px; height: 14px; opacity: 0.5; }
.up-info-value {
    font-size: 0.82rem; color: var(--white); font-weight: 600;
    max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* Edit fields */
.up-edit-group { margin-bottom: 10px; }
.up-edit-label {
    display: block; margin-bottom: 5px;
    font-family: var(--font-display); font-size: 0.52rem; font-weight: 600;
    letter-spacing: 0.15em; text-transform: uppercase; color: var(--muted);
}
.up-edit-input {
    width: 100%; padding: 10px 14px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 12px; outline: none;
    color: var(--white); font-family: var(--font-body);
    font-size: 0.84rem; font-weight: 500;
    transition: border-color 250ms ease, background 250ms ease;
}
.up-edit-input::placeholder { color: rgba(154,143,181,0.35); }
.up-edit-input:focus { border-color: rgba(166,110,247,0.35); background: rgba(255,255,255,0.07); }

/* Action buttons */
.up-action-btn {
    width: 100%; padding: 12px; border: none; border-radius: 14px;
    cursor: pointer; font-family: var(--font-display);
    font-size: 0.65rem; font-weight: 700;
    letter-spacing: 0.1em; text-transform: uppercase;
    transition: background 250ms ease, transform 200ms var(--ease-spring), box-shadow 250ms ease;
}
.up-action-btn:active { transform: scale(0.96); }
.up-action-btn svg { width: 16px; height: 16px; display: inline-block; vertical-align: -2px; margin-right: 4px; }

.up-save-btn {
    background: linear-gradient(135deg, rgba(166,110,247,0.4), rgba(92,200,223,0.3));
    color: var(--white);
}
.up-save-btn:hover {
    background: linear-gradient(135deg, rgba(166,110,247,0.55), rgba(92,200,223,0.45));
    box-shadow: 0 4px 16px rgba(166,110,247,0.15);
}

.up-changepw-btn {
    background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08) !important;
    color: var(--muted);
}
.up-changepw-btn:hover { background: rgba(255,255,255,0.1); color: var(--white); }

.up-logout-btn {
    background: rgba(224,96,100,0.08); border: 1px solid rgba(224,96,100,0.12) !important;
    color: rgba(224,96,100,0.8);
}
.up-logout-btn:hover { background: rgba(224,96,100,0.15); color: #e06064; }

/* Panel message */
.up-msg {
    font-size: 0.75rem; font-weight: 500;
    padding: 8px 14px; border-radius: 10px;
    display: none; align-items: center; gap: 6px; margin-top: 6px;
}
.up-msg.show { display: flex; }
.up-msg.success { color: var(--neon-green); background: rgba(74,222,128,0.08); border: 1px solid rgba(74,222,128,0.1); }
.up-msg.error { color: #e06064; background: rgba(224,96,100,0.08); border: 1px solid rgba(224,96,100,0.1); }

/* ===== CHANGE PASSWORD PANEL ===== */
.up-pw-section { display: none; flex-direction: column; gap: 10px; }
.up-pw-section.show { display: flex; }
.up-pw-cancel {
    text-align: center; margin-top: 4px;
    font-size: 0.75rem; color: var(--muted); cursor: pointer;
    background: none; border: none; font-family: var(--font-body);
    transition: color 200ms ease;
}
.up-pw-cancel:hover { color: var(--white); }

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    .nav-user-area { margin-left: 0.8rem; }
    .nav-user-name { display: none; }
    .nav-login-btn { padding: 7px 14px; font-size: 0.58rem; }
    .nav-login-btn span { display: none; }
    .auth-modal-body { padding: 2rem 1.5rem 1.5rem; }
    .user-panel { width: 100vw; }
    .user-dropdown { right: -40px; }
}

@media (max-width: 480px) {
    .auth-modal { border-radius: 20px; }
    .auth-tabs { flex-wrap: nowrap; }
    .auth-tab { font-size: 0.55rem; padding: 8px 0; }
}

/* ===== SCROLLBAR ===== */
.user-panel-scroll::-webkit-scrollbar { width: 3px; }
.user-panel-scroll::-webkit-scrollbar-track { background: transparent; }
.user-panel-scroll::-webkit-scrollbar-thumb { background: rgba(166,110,247,0.3); border-radius: 4px; }
