/**
 * EnergyExperts Authentication Popup Styles
 */

/* Overlay - mit maximaler Spezifität und Überschreiben von .interactions-disabled */
body #ee-auth-popup-overlay.ee-auth-popup-overlay,
body.interactions-disabled #ee-auth-popup-overlay.ee-auth-popup-overlay,
.interactions-disabled #ee-auth-popup-overlay.ee-auth-popup-overlay,
#ee-auth-popup-overlay.ee-auth-popup-overlay.ee-auth-popup-overlay,
.ee-auth-popup-overlay#ee-auth-popup-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: rgba(0, 0, 0, 0.6) !important;
    justify-content: center !important;
    align-items: center !important;
    z-index: 2147483647 !important; /* Höchster möglicher z-index Wert */
    backdrop-filter: blur(3px) !important;
    pointer-events: none !important; /* Default: keine Klicks durchlassen */
    cursor: default !important; /* Überschreibe wait cursor */
}

/* Wenn der Overlay angezeigt wird (display wird per inline style auf 'flex' gesetzt) */
body #ee-auth-popup-overlay.ee-auth-popup-overlay[style*="display: flex"],
body.interactions-disabled #ee-auth-popup-overlay.ee-auth-popup-overlay[style*="display: flex"],
.interactions-disabled #ee-auth-popup-overlay.ee-auth-popup-overlay[style*="display: flex"],
body #ee-auth-popup-overlay.ee-auth-popup-overlay[style*="display:flex"],
body.interactions-disabled #ee-auth-popup-overlay.ee-auth-popup-overlay[style*="display:flex"],
.interactions-disabled #ee-auth-popup-overlay.ee-auth-popup-overlay[style*="display:flex"] {
    animation: ee-auth-fadeIn 0.2s ease-out !important;
    pointer-events: auto !important; /* Bei Anzeige: Klicks erlauben */
}

/* Überschreibe .interactions-disabled für alle interaktiven Elemente im Popup */
body.interactions-disabled #ee-auth-popup-overlay button,
body.interactions-disabled #ee-auth-popup-overlay input,
body.interactions-disabled #ee-auth-popup-overlay select,
body.interactions-disabled #ee-auth-popup-overlay textarea,
body.interactions-disabled #ee-auth-popup-overlay a,
body.interactions-disabled #ee-auth-popup-overlay [tabindex],
.interactions-disabled #ee-auth-popup-overlay button,
.interactions-disabled #ee-auth-popup-overlay input,
.interactions-disabled #ee-auth-popup-overlay select,
.interactions-disabled #ee-auth-popup-overlay textarea,
.interactions-disabled #ee-auth-popup-overlay a,
.interactions-disabled #ee-auth-popup-overlay [tabindex] {
    pointer-events: auto !important;
    cursor: auto !important;
}

/* Spezielle Überschreibung für Submit-Button */
body.interactions-disabled #ee-auth-popup-overlay .ee-auth-submit-btn,
.interactions-disabled #ee-auth-popup-overlay .ee-auth-submit-btn {
    cursor: pointer !important;
}

@keyframes ee-auth-fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Popup Container - mit hoher Spezifität */
#ee-auth-popup-overlay .ee-auth-popup,
.ee-auth-popup-overlay .ee-auth-popup {
    background: #ffffff !important;
    border-radius: 12px !important;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
    max-width: 450px !important;
    width: 90% !important;
    max-height: 90vh !important;
    overflow-y: auto !important;
    animation: ee-auth-slideUp 0.3s ease-out !important;
    position: relative !important;
    z-index: 2147483647 !important;
}

@keyframes ee-auth-slideUp {
    from {
        transform: translateY(30px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Header */
.ee-auth-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.ee-auth-popup-header h2 {
    margin: 0;
    font-size: 22px;
    font-weight: 600;
    color: #1f2937;
}

.ee-auth-popup-close {
    background: none;
    border: none;
    font-size: 32px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s;
}

.ee-auth-popup-close:hover {
    background-color: #f3f4f6;
    color: #1f2937;
}

/* Body */
.ee-auth-popup-body {
    padding: 24px;
}

.ee-auth-popup-message {
    margin-bottom: 20px;
    padding: 12px 16px;
    background-color: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 6px;
    color: #92400e;
    font-size: 14px;
    line-height: 1.5;
}

/* Form */
.ee-auth-form-group {
    margin-bottom: 18px;
}

.ee-auth-form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #374151;
    font-size: 14px;
}

.ee-auth-form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.2s;
    box-sizing: border-box;
}

.ee-auth-form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.ee-auth-form-group input::placeholder {
    color: #9ca3af;
}

/* Error Message */
.ee-auth-error {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    color: #991b1b;
    font-size: 14px;
    line-height: 1.5;
}

/* Submit Button */
.ee-auth-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

.ee-auth-submit-btn:hover {
    background-color: var(--secondary-color);
    box-shadow: 0 4px 8px var(--secondary-color-50);
    transform: translateY(-1px);
}

.ee-auth-submit-btn:active {
    transform: translateY(0);
}

.ee-auth-submit-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* Loading State */
.ee-auth-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 20px;
    color: #6b7280;
    font-size: 15px;
}

.ee-auth-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid #e5e7eb;
    border-top-color: var(--secondary-color);
    border-radius: 50%;
    animation: ee-auth-spin 0.8s linear infinite;
    margin-right: 10px;
}

@keyframes ee-auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 480px) {
    .ee-auth-popup {
        max-width: 95%;
        border-radius: 8px;
    }

    .ee-auth-popup-header {
        padding: 16px 20px;
    }

    .ee-auth-popup-header h2 {
        font-size: 20px;
    }

    .ee-auth-popup-body {
        padding: 20px;
    }
}

/* Dark Mode Support (optional) */
@media (prefers-color-scheme: dark) {
    .ee-auth-popup {
        background: #1f2937;
    }

    .ee-auth-popup-header {
        border-bottom-color: #374151;
    }

    .ee-auth-popup-header h2 {
        color: #f9fafb;
    }

    .ee-auth-popup-close {
        color: #9ca3af;
    }

    .ee-auth-popup-close:hover {
        background-color: #374151;
        color: #f9fafb;
    }

    .ee-auth-form-group label {
        color: #e5e7eb;
    }

    .ee-auth-form-group input {
        background-color: #374151;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .ee-auth-form-group input::placeholder {
        color: #6b7280;
    }

    .ee-auth-form-group input:focus {
        border-color: var(--secondary-color);
        /*background-color: #374151;*/
    }
}
