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

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

.flutter-modal {
    background: #ffffff;
    border-radius: 24px 24px 0px 0px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

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

/* Modal Header with Language Toggle */
.flutter-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px 8px 16px;
    border-bottom: none;
    position: relative;
    z-index: 100;
    pointer-events: auto;
}

.lang-toggle-row {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 101;
    pointer-events: auto;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #6b7280;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Alexandria', sans-serif;
    font-size: 13px;
    font-weight: 500;
    min-height: 36px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.lang-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.lang-btn.active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #3b82f6;
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.lang-flag {
    font-size: 18px;
    line-height: 1;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.1));
    display: inline-block;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.lang-text {
    font-family: 'Alexandria', sans-serif;
    font-size: 13px;
    line-height: 1.35;
    font-weight: 500;
}

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

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

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

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

/* Modal Content */
.flutter-modal-content {
    padding: 0px 16px 10px 16px;
}

.car-image-container {
    text-align: center;
    margin: 8px 0 10px 0;
}

.car-image {
    width: 90px;
    height: 90px;
    object-fit: contain;
}

.modal-title {
    font-family: 'Alexandria', sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.35;
    color: #1f1c21;
    text-align: center;
    margin: 0 0 16px 0;
}

.modal-divider {
    height: 1px;
    background: #b3b2b7;
    margin: 0 0 16px 0;
    border: none;
}

.modal-question {
    font-family: 'Alexandria', sans-serif;
    font-size: 20px;
    font-weight: 400;
    line-height: 1.35;
    color: #1f1c21;
    margin: 0 0 16px 0;
}

/* Option Cards */
.option-card {
    width: 100%;
    margin: 0 0 8px 0;
    padding: 16px;
    border-radius: 18px;
    border: 2px solid transparent;
    background: #f5f5f6;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.option-card:hover {
    background: #f4f4f4;
}

.option-card.selected {
    border-color: #ff6b3e;
    background: #f5f5f6;
}

.option-card-content {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.option-icon-container {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: transparent;
}

.option-icon {
    width: 36px;
    height: 32px;
    object-fit: contain;
}

.option-text {
    flex: 1;
    min-width: 0;
}

.option-title {
    font-family: 'Alexandria', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
    color: #1f1c21;
    margin: 0 0 2px 0;
}

.option-subtitle {
    font-family: 'Alexandria', sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.32;
    color: #1f1c21;
    margin: 0;
}

/* Radio Button */
.radio-button {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #ff6b3e;
    background: transparent;
    position: relative;
    flex-shrink: 0;
}

.radio-button.selected {
    background: #ff6b3e;
}

.radio-button.selected::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #ffffff;
}

.radio-button.selected::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 13px;
    height: 13px;
    border-radius: 50%;
    background: #ff6b3e;
    z-index: 1;
}

/* Extra Content (Call buttons, blood type) */
.option-extra {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f4f4f4;
}

.call-button {
    width: 100%;
    padding: 6px 12px;
    border-radius: 4px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: 'Alexandria', sans-serif;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    min-height: 32px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.call-button.success {
    background: #34c759;
    color: #ffffff;
}

.call-button.danger {
    background: #ff3b30;
    color: #ffffff;
}

.call-button:hover {
    opacity: 0.9;
}

.call-icon {
    font-size: 14px;
}

.blood-type-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

.blood-type-icon {
    width: 36px;
    height: 32px;
    object-fit: contain;
}

.blood-type-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.blood-type-label {
    font-family: 'Alexandria', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    color: #706d75;
}

.blood-type-value {
    font-family: 'Alexandria', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
    color: #ff0000;
}

/* Privacy Note */
.privacy-note {
    font-family: 'Alexandria', sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.35;
    color: #1f1c21;
    text-align: center;
    margin: 10px 0 20px 0;
}

/* Send Alert Button */
.send-alert-btn {
    width: 100%;
    padding: 16px;
    border-radius: 24px;
    border: none;
    background: #ff6b3e;
    color: #ffffff;
    font-family: 'Alexandria', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.send-alert-btn:hover {
    background: #e86138;
}

.send-alert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Success State */
.success-content {
    text-align: center;
    padding: 32px 16px;
}

.success-icon {
    color: #34c759;
    font-size: 80px;
    margin-bottom: 24px;
}

.success-title {
    font-family: 'Alexandria', sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1.35;
    color: #1f1c21;
    margin-bottom: 12px;
}

.success-message {
    font-family: 'Alexandria', sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.32;
    color: #1f1c21;
    margin-bottom: 32px;
}

.back-to-home-btn {
    width: 100%;
    padding: 10px 16px;
    border-radius: 24px;
    border: none;
    background: #ff6b3e;
    color: #ffffff;
    font-family: 'Alexandria', sans-serif;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.35;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 40px;
}

.back-to-home-btn:hover {
    background: #e86138;
}

/* RTL Support */
[dir="rtl"] .flutter-modal-header {
    direction: ltr;
}

[dir="rtl"] .option-card-content {
    direction: rtl;
}

[dir="rtl"] .radio-button {
    margin-left: 0;
    margin-right: auto;
}

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

/* Responsive Design */
@media (max-width: 640px) {
    .flutter-modal {
        border-radius: 24px 24px 0px 0px;
        max-height: 95vh;
    }
    
    .flutter-modal-content {
        padding: 0px 16px 10px 16px;
    }
    
    .modal-title {
        font-size: 18px;
    }
    
    .modal-question {
        font-size: 18px;
    }
    
    .option-title {
        font-size: 15px;
    }
    
    .option-subtitle {
        font-size: 13px;
    }
}

/* Safe Area Padding */
.safe-area-padding {
    padding-top: 20px;
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
