/**
 * Header Modals CSS - Eindeutige Styles für Login/Register Modals
 * WARNUNG: Diese Datei ist die einzige Quelle für Header-Modal-Styles.
 * Duplizierungen in anderen CSS-Dateien sind VERBOTEN!
 */

/* ====== HEADER MODAL SYSTEM - EINDEUTIGE KLASSEN ====== */

/* Base Modal Overlay */
.header-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    z-index: 10000; /* Höchste Priorität für Header-Modals */
    backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    justify-content: center;
}

/* Modal Active State */
.header-modal.header-modal-show {
    opacity: 1;
}

/* Modal Content Container - KLEINERE UX-OPTIMIERTE GRÖSSE */
.header-modal-content {
    background: #ffffff;
    padding: 1.5rem; /* Reduziert von 2.5rem */
    border-radius: 12px; /* Reduziert von 16px */
    max-width: 380px; /* Reduziert von 420px */
    width: 90%;
    max-height: 75vh; /* Reduziert von 85vh für kleinere Bildschirme */
    overflow-y: auto;
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: scale(0.95) translateY(-10px);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    margin: 1rem; /* Sicherheitsabstand zu Bildschirmrändern */
}

/* Mobile Optimierungen für kleinere Modals */

/* ====== EMAIL VERIFICATION NAVIGATION STYLES ====== */

/* Navigation für unverified users - nur Logout sichtbar */
.header-nav.verification-pending .nav-links {
    display: none;
}

.header-nav.verification-pending .header-auth-section {
    gap: 0; /* Nur Logout Button */
}

.header-nav.verification-pending .header-auth-section .btn-secondary {
    display: none; /* Login Button verstecken */
}

.header-nav.verification-pending .header-auth-section .btn-primary {
    display: none; /* Register Button verstecken */
}

/* Verification Status Indicator */
.verification-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--warning-color, #f59e0b);
    background: rgba(245, 158, 11, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 16px;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.verification-status::before {
    content: "⏳";
    font-size: 1rem;
}

/* Logout-Only Navigation Style */
.logout-only .header-brand {
    opacity: 0.7;
}

.logout-only .nav-links {
    display: none !important;
}

/* Verification Pending Page Specific */
.page-email-pending .header-nav {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.05), rgba(245, 158, 11, 0.02));
    border-bottom: 2px solid rgba(245, 158, 11, 0.2);
}

.page-email-pending .header-brand {
    filter: grayscale(20%);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .verification-status {
        font-size: 0.75rem;
        padding: 0.2rem 0.5rem;
        gap: 0.25rem;
    }
    
    .verification-status::before {
        font-size: 0.85rem;
    }
}
@media (max-width: 480px) {
    .header-modal-content {
        max-width: 95%;
        padding: 1rem;
        margin: 0.5rem;
        max-height: 80vh; /* Mehr Platz auf mobilen Geräten */
    }
}

/* Modal Content Active State */
.header-modal-show .header-modal-content {
    transform: scale(1) translateY(0);
}

/* Modal Header - KOMPAKTER */
.header-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem; /* Reduziert von 1.5rem */
    padding-bottom: 0.75rem; /* Reduziert von 1rem */
    border-bottom: 1px solid #e5e7eb;
}

.header-modal-title {
    font-size: 1.25rem; /* Reduziert von 1.5rem */
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

/* Modal Close Button */
.header-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
}

.header-modal-close:hover {
    color: #374151;
    background-color: #f3f4f6;
}

/* Modal Body */
.header-modal-body {
    padding: 0;
}

/* Form Styles für Header Modals */
.header-modal-form {
    width: 100%;
}

.header-modal-field {
    margin-bottom: 1.25rem;
}

.header-modal-field:last-child {
    margin-bottom: 0;
}

.header-modal-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.header-modal-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.header-modal-input:focus {
    outline: none;
    border-color: #c9a18c;
    box-shadow: 0 0 0 3px rgba(201, 161, 140, 0.1);
}

.header-modal-input:invalid {
    border-color: #ef4444;
}

/* Button Styles */
.header-modal-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #c9a18c;
    color: white;
    min-height: 44px;
}

.header-modal-button:hover {
    background-color: #b8947f;
    transform: translateY(-1px);
}

.header-modal-button:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Error Messages */
.header-modal-errors {
    display: none;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 0.5rem;
}

.header-modal-errors.show {
    display: block;
}

.header-modal-error {
    color: #dc2626;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.header-modal-error:last-child {
    margin-bottom: 0;
}

/* Success Messages */
.header-modal-success {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    color: #166534;
    font-size: 0.875rem;
}

/* Modal Footer */
.header-modal-footer {
    margin-top: 1rem; /* Reduziert von 1.5rem */
    padding-top: 0.75rem; /* Reduziert von 1rem */
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.header-modal-footer-text {
    color: #6b7280;
    font-size: 0.875rem;
    margin: 0;
}

/* Loading State */
.header-modal-loading .header-modal-btn-primary {
    background-color: #9ca3af;
    cursor: not-allowed;
    position: relative;
}

.header-modal-loading .header-modal-btn-primary::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: header-modal-spin 1s linear infinite;
}

@keyframes header-modal-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ====== RESPONSIVE DESIGN ====== */

/* Mobile Optimierung */
@media (max-width: 640px) {
    .header-modal-content {
        margin: 1rem;
        padding: 2rem 1.5rem;
        max-width: none;
        width: calc(100% - 2rem);
        border-radius: 12px;
    }
    
    .header-modal-title {
        font-size: 1.25rem;
    }
    
    .header-modal-input {
        font-size: 16px; /* Verhindert Zoom auf iOS */
    }
}

/* Tablet */
@media (min-width: 641px) and (max-width: 1024px) {
    .header-modal-content {
        max-width: 480px;
    }
}

/* Dark Mode Support (für zukünftige Implementierung) */
@media (prefers-color-scheme: dark) {
    .header-modal-content {
        background: #1f2937;
        color: #f9fafb;
    }
    
    .header-modal-title {
        color: #f9fafb;
    }
    
    .header-modal-input {
        background: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }
    
    .header-modal-input:focus {
        border-color: #60a5fa;
    }
    
    .header-modal-label {
        color: #d1d5db;
    }
}

/* ====== ACCESSIBILITY ====== */

/* Fokus-Management */
.header-modal-content:focus {
    outline: none;
}

/* Screen Reader Support */
.header-modal[aria-hidden="true"] {
    display: none !important;
}

.header-modal[aria-hidden="false"] {
    display: flex !important;
}

/* Reduzierte Animation für Nutzer mit Motion-Sensitivity */
@media (prefers-reduced-motion: reduce) {
    .header-modal,
    .header-modal-content {
        transition: none;
    }
    
    .header-modal-show .header-modal-content {
        transform: none;
    }
}

/* ====== ANTI-DUPLIKATION WARNUNG ====== */
/*
WICHTIG: Diese CSS-Klassen sind EINDEUTIG für Header-Modals!

VERBOTEN:
- .modal (zu generisch)
- .modal-content (kollidiert mit anderen Systemen)
- Duplizierung dieser Styles in anderen CSS-Dateien

ERLAUBT:
- Nur diese Datei darf header-modal-* Klassen definieren
- Erweiterungen nur durch neue header-modal-* Klassen
*/
