/* ========== Auth Modal Overlay ========== */
.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-modal-overlay.active {
    display: flex;
}

.auth-modal {
    background-color: rgba(20, 20, 20, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 2rem;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
}

.auth-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.3s ease;
    z-index: 1;
}

.auth-modal-close:hover {
    color: var(--text-primary);
}

.auth-modal-title {
    text-align: center;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

/* ========== Auth Tabs ========== */
.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 1.25rem;
}

.auth-tab {
    flex: 1;
    padding: 0.75rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border-bottom: 2px solid transparent;
}

.auth-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent);
}

.auth-tab:hover {
    color: var(--text-primary);
}

/* ========== Auth Panels ========== */
.auth-panel {
    display: none;
    padding: 0;
}

.auth-panel.active {
    display: block;
}

/* ========== Auth Form Elements ========== */
.auth-form-group {
    margin-bottom: 0.75rem;
}

.auth-form-group input {
    width: 100%;
    padding: 0.85rem 1rem;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.auth-form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.auth-form-group input::placeholder {
    color: var(--text-secondary);
}

.auth-error {
    color: #f87171;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    display: none;
    padding: 0.5rem 0.75rem;
    background: rgba(248, 113, 113, 0.1);
    border-radius: 8px;
}

.auth-error.visible {
    display: block;
}

.auth-success {
    color: #4ade80;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
    display: none;
    padding: 0.5rem 0.75rem;
    background: rgba(74, 222, 128, 0.1);
    border-radius: 8px;
}

.auth-success.visible {
    display: block;
}

.auth-submit-btn {
    width: 100%;
    padding: 0.85rem;
    background-color: var(--accent);
    border: none;
    border-radius: 100px;
    color: var(--bg-primary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.auth-submit-btn:hover {
    background-color: var(--accent-hover);
}

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

.auth-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

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

.auth-google-btn {
    width: 100%;
    padding: 0.75rem;
    background: none;
    border: 1px solid var(--border-color);
    border-radius: 100px;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.auth-google-btn:hover {
    background-color: var(--accent);
    border-color: var(--accent);
    color: var(--bg-primary);
}

.auth-google-btn svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ========== Forgot Password Link ========== */
.auth-forgot-link {
    display: block;
    text-align: right;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    transition: color 0.3s ease;
    margin-bottom: 1rem;
    background: none;
    border: none;
    font-family: inherit;
    margin-left: auto;
    padding: 0;
}

.auth-forgot-link:hover {
    color: var(--text-primary);
}

/* ========== Forgot Password Panel ========== */
.auth-forgot-panel {
    display: none;
}

.auth-forgot-panel.active {
    display: block;
}

.auth-forgot-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.8rem;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    margin-bottom: 1.25rem;
    padding: 0;
    transition: color 0.3s ease;
}

.auth-forgot-back:hover {
    color: var(--text-primary);
}

/* ========== Profile Dropdown (connecte) ========== */
.profile-dropdown {
    position: absolute;
    top: calc(100% + 1rem);
    right: 0;
    background-color: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 0.5rem;
    min-width: 240px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 1001;
}

.profile-dropdown.active {
    display: block;
}

.profile-dropdown-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.profile-dropdown-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent);
}

.profile-dropdown-avatar-initial {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--accent);
}

.profile-dropdown-info {
    flex: 1;
}

.profile-dropdown-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.profile-dropdown-email {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

.profile-dropdown-item {
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s ease;
    border: none;
    background: none;
    width: 100%;
    color: var(--text-primary);
    font-size: 0.9rem;
    text-align: left;
    font-family: inherit;
    text-decoration: none;
}

.profile-dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.profile-dropdown-item svg {
    width: 18px;
    height: 18px;
    fill: var(--text-secondary);
}

/* ========== User Section ========== */
#user-section {
    position: relative;
    display: flex;
    align-items: center;
}

.profile-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: transparent;
    border: 1.5px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.profile-icon:hover {
    border-color: var(--accent);
}

.profile-icon svg {
    width: 18px;
    height: 18px;
    fill: var(--text-secondary);
}

.profile-icon img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
    .profile-dropdown {
        position: fixed;
        top: 80px;
        right: 1rem;
        left: 1rem;
        min-width: auto;
    }

    .auth-modal {
        max-width: none;
        border-radius: 20px;
    }
}
