/* Modern Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 20px;
    box-sizing: border-box;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: #ffffff;
    border-radius: 20px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9) translateY(20px);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    outline: none;
}

.modal-overlay.active .modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0;
    line-height: 1.3;
}

.close-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: #f9fafb;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

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

.close-btn:focus {
    outline: none;
    ring: 2px solid #3b82f6;
    ring-offset: 2px;
}

/* Modal Body */
.modal-body {
    padding: 20px 24px 24px;
}

/* Car Image */
.car-image-container {
    text-align: center;
    margin: 20px 0;
}

.car-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 12px;
    padding: 16px;
}

/* Description */
.modal-description {
    text-align: center;
    color: #6b7280;
    font-size: 16px;
    line-height: 1.5;
    margin: 16px 0 24px;
}

/* Action Buttons */
.modal-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.action-btn {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
    font-family: inherit;
    font-size: 15px;
}

.action-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
}

.action-btn:active {
    transform: translateY(0);
}

.action-btn:focus {
    outline: none;
    ring: 2px solid #3b82f6;
    ring-offset: 2px;
    border-color: #3b82f6;
}

.action-btn.primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.action-btn.primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.action-btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
    font-size: 18px;
}

.action-btn-content {
    flex: 1;
}

.action-btn-title {
    font-weight: 600;
    color: #111827;
    margin-bottom: 2px;
}

.action-btn.primary .action-btn-title {
    color: white;
}

.action-btn-subtitle {
    font-size: 14px;
    color: #6b7280;
    line-height: 1.4;
}

.action-btn.primary .action-btn-subtitle {
    color: rgba(255, 255, 255, 0.8);
}

/* Language Toggle */
.lang-toggle-container {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 20px 0;
}

.lang-toggle-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.lang-toggle-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.lang-toggle-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.lang-toggle-btn:focus {
    outline: none;
    ring: 2px solid #3b82f6;
    ring-offset: 2px;
}

/* Privacy Note */
.privacy-note {
    text-align: center;
    font-size: 13px;
    color: #9ca3af;
    line-height: 1.4;
    margin: 20px 0 0;
}

/* RTL Support */
[dir="rtl"] .modal {
    text-align: right;
}

[dir="rtl"] .action-btn {
    text-align: right;
}

[dir="rtl"] .action-btn-icon {
    margin-right: 0;
    margin-left: 16px;
}

[dir="rtl"] .lang-toggle-container {
    direction: ltr;
}

/* Responsive Design */
@media (max-width: 640px) {
    .modal-overlay {
        padding: 16px;
    }
    
    .modal {
        max-width: 100%;
        border-radius: 16px;
    }
    
    .modal-header {
        padding: 20px 20px 12px;
    }
    
    .modal-body {
        padding: 16px 20px 20px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .action-btn {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .action-btn-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
        margin-right: 12px;
    }
    
    [dir="rtl"] .action-btn-icon {
        margin-right: 0;
        margin-left: 12px;
    }
    
    .car-image {
        width: 100px;
        height: 100px;
    }
}

/* Animation for modal entrance */
@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-overlay.active .modal {
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Focus styles for accessibility */
.modal:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading state */
.modal.loading .modal-body {
    opacity: 0.6;
    pointer-events: none;
}

/* Success state */
.modal.success .action-btn.primary {
    background: #10b981;
    border-color: #10b981;
}

.modal.success .action-btn.primary:hover {
    background: #059669;
    border-color: #059669;
}
