/**
 * Customer Login Modal Styles
 */

/* Modal Container */
.customer-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

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

/* Overlay */
.customer-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

/* Modal Content */
.customer-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 16px;
    max-width: 480px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

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

/* Close Button */
.customer-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: rgba(0, 0, 0, 0.05);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: #374151;
    transition: all 0.2s ease;
    z-index: 10004; /* FIXED 2025-11-16: Higher than modal */
}

.customer-modal-close:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

/* Header */
.customer-modal-header {
    padding: 2rem 2rem 1rem 2rem;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

.customer-modal-header h2 {
    font-size: 1.75rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.customer-modal-header p {
    color: #6b7280;
    font-size: 0.95rem;
    margin: 0;
    line-height: 1.5;
}

/* Body */
.customer-modal-body {
    padding: 2rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-group label i {
    color: #667eea;
    margin-right: 0.5rem;
}

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s ease;
    background: white;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-control::placeholder {
    color: #6b7280; opacity: 0.8; /* FIXED */
}

/* Checkbox Group */
.form-group-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.form-group-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-right: 0.5rem;
    cursor: pointer;
    accent-color: #667eea;
}

.form-group-checkbox label {
    margin: 0;
    font-weight: 400;
    color: #374151; /* FIXED */
    font-size: 0.9rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-block {
    width: 100%;
}

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

.text-link {
    color: #667eea;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.text-link:hover {
    color: #764ba2;
    text-decoration: underline;
}

/* Info Box */
.customer-modal-info {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f3f4f6;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.customer-modal-info i {
    color: #667eea;
    font-size: 1.25rem;
    margin-top: 0.125rem;
}

.customer-modal-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

/* Customer Mini Card (when logged in) */
.customer-mini-card {
    position: relative;
}

.customer-card-link {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(102, 126, 234, 0.1);
    border-radius: 8px;
    text-decoration: none;
    color: #667eea;
    font-weight: 600;
    transition: all 0.2s ease;
}

.customer-card-link:hover {
    background: rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.customer-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.customer-name {
    max-width: 150px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.customer-card-link i {
    font-size: 0.75rem;
    transition: transform 0.2s ease;
}

.customer-mini-card:hover .customer-card-link i {
    transform: rotate(180deg);
}

/* Customer Dropdown */
.customer-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 1000;
}

.customer-mini-card:hover .customer-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.customer-dropdown a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

.customer-dropdown a:last-child {
    border-bottom: none;
    color: #ef4444;
}

.customer-dropdown a:hover {
    background: #f3f4f6;
}

.customer-dropdown a i {
    width: 20px;
    text-align: center;
}

/* Secondary CTA Button */
.nav-cta-secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white !important;
    padding: 0.625rem 1.25rem;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.nav-cta-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Responsive */
@media (max-width: 768px) {
    .customer-modal-content {
        width: 95%;
        max-width: none;
        border-radius: 12px;
    }

    .customer-modal-header {
        padding: 1.5rem 1.5rem 1rem 1.5rem;
    }

    .customer-modal-header h2 {
        font-size: 1.5rem;
    }

    .customer-modal-body {
        padding: 1.5rem;
    }

    .customer-name {
        display: none;
    }

    .customer-card-link {
        padding: 0.5rem;
    }

    .customer-dropdown {
        right: auto;
        left: 0;
    }
}

/* Mobile menu positioning for Kundenportal button */
@media (max-width: 768px) {
    .nav-menu li:has(#kundenportalBtn) {
        order: 10;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
}

/* Fix 1: z-index für Login Modal - Added 2025-11-16 */
.customer-modal-content {
    z-index: 10002 !important;
}

.customer-modal-content input,
.customer-modal-content label,
.customer-modal-content button,
.customer-modal-content select,
.customer-modal-content textarea {
    position: relative;
    z-index: 10003 !important;
}

/* Fix 3: Passwort-Vergessen Text lesbar machen - Added 2025-11-16 */
.customer-modal-footer {
    width: 100%;
    text-align: center;
    white-space: normal !important;
    overflow: visible !important;
    padding: 1rem;
}

.customer-modal-footer a {
    display: inline-block;
    word-wrap: break-word;
    color: #667eea;
    text-decoration: none;
    transition: color 0.2s ease;
}

.customer-modal-footer a:hover {
    color: #5a67d8;
    text-decoration: underline;
}

/* ========================================
   ADDITIONAL FIXES - Added 2025-11-16
   ======================================== */

/* Enhanced Close Button Visibility */
.customer-modal-close {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    font-weight: 300;
}

.customer-modal-close:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Better Text Contrast for All Gray Elements */
.customer-modal p,
.customer-modal-info p {
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.5);
}

/* Improved Focus Visibility */
.form-control:focus {
    background-color: #fffef9;
}

/* Better Info Box Definition */
.customer-modal-info {
    box-shadow: inset 0 0 0 1px rgba(102, 126, 234, 0.1);
}

/* Enhanced Placeholder Visibility */
.form-control::placeholder {
    font-weight: 400;
}

/* Make sure close button is always on top */
.customer-modal-close {
    pointer-events: auto !important;
}

/* Better text link visibility in footer */
.customer-modal-footer .text-link {
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.customer-modal-footer .text-link:hover {
    background: rgba(102, 126, 234, 0.05);
}

/* FIX: X-Button Position - 2025-11-17 */
/* Close Button - KONSOLIDIERTE Definition für korrekte Position */
.customer-modal-close {
    position: absolute !important;
    top: 16px !important;
    right: 16px !important;
    left: auto !important;
    
    width: 44px !important;
    height: 44px !important;
    
    background: rgba(0, 0, 0, 0.08) !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    
    z-index: 10005 !important;
    
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    
    font-size: 28px !important;
    line-height: 1 !important;
    color: #374151 !important;
    font-weight: 300 !important;
    
    transition: all 0.2s ease !important;
    
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    
    overflow: visible !important;
    pointer-events: auto !important;
}

.customer-modal-close:hover {
    background: rgba(239, 68, 68, 0.15) !important;
    color: #ef4444 !important;
    transform: rotate(90deg) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
}

.customer-modal-content {
    overflow: visible !important;
}
