/* Transportation & Insurance Modal Styles - Scoped with sar- prefix */
.sar-modal {
    display: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.sar-modal.is-open {
    display: block;
    opacity: 1;
    visibility: visible;
}

.sar-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sar-modal.is-open .sar-modal-overlay {
    opacity: 1;
}

.sar-modal-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    position: relative;
    display: flex;
    flex-direction: column;
    transform: scale(0.9) translateY(20px);
    transition: transform 0.3s ease;
}

.sar-modal.is-open .sar-modal-container {
    transform: scale(1) translateY(0);
}

.sar-modal-header {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 24px 16px 24px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
    position: relative;
}

.sar-modal-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    width: 100%;
}

.sar-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6c757d;
    padding: 4px;
    border-radius: 4px;
    transition: all 0.2s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
}

.sar-modal-close:hover {
    background-color: #f8f9fa;
    color: #c69453;
}

.sar-modal-content {
    padding: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sar-modal-content-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 50vh;
    min-height: 400px;
}

/* Device-specific viewport fixes */
/* iPhone XR, XS Max (414x896) - fix viewport height issues */
@media (max-width: 414px) and (max-height: 900px) and (min-height: 850px) {
    .sar-modal-content-wrapper {
        max-height: 45vh;
        min-height: 350px;
    }
}

/* Galaxy S9 and similar (360x740) - maintain current behavior */
@media (max-width: 360px) and (max-height: 750px) {
    .sar-modal-content-wrapper {
        max-height: 50vh;
        min-height: 320px;
    }
}

/* Standard mobile devices (375-414px width) */
@media (max-width: 414px) and (max-height: 850px) {
    .sar-modal-content-wrapper {
        max-height: 50vh;
        min-height: 350px;
    }
}

/* Responsive height for larger screens - prevents height changes when switching tabs */
@media (min-height: 800px) {
    .sar-modal-content-wrapper {
        max-height: 60vh;
        min-height: 500px;
    }
}

@media (min-height: 1000px) {
    .sar-modal-content-wrapper {
        max-height: 65vh;
        min-height: 550px;
    }
}

.sar-modal-header-section {
    flex-shrink: 0;
    padding: 20px 24px 0 24px;
}

.sar-text-center {
    text-align: center;
}

.sar-mb-3 {
    margin-bottom: 1rem;
}

/* Transportation Tabs Styles */
.sar-transportation-tabs {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    margin: 1rem 0;
}

.sar-tab-buttons {
    display: flex;
    background: transparent;
    border-bottom: 2px solid #e9ecef;
    margin: 0 24px 1rem 24px;
    flex-shrink: 0;
    gap: 0;
}

.sar-tab-btn {
    flex: 1;
    padding: 0.75rem 1rem;
    border: none;
    background: transparent;
    border-radius: 0;
    font-size: 0.85rem;
    font-weight: 500;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    position: relative;
}

.sar-tab-btn:hover {
    color: #B59920;
    background: rgba(181, 153, 32, 0.05);
}

.sar-tab-btn.sar-active {
    color: #B59920;
    background: transparent;
    border-bottom-color: #B59920;
    box-shadow: none;
    font-weight: 600;
}

.sar-tab-content-wrapper {
    flex: 1;
    overflow: hidden;
    padding: 0 24px;
    position: relative;
}

.sar-scroll-hint {
    text-align: center;
    font-size: 0.75rem;
    color: #6c757d;
    padding: 8px 0;
    background: #f8f9fa;
    border-radius: 4px 4px 0 0;
    margin-bottom: 0;
    position: sticky;
    top: 0;
    z-index: 1;
    display: none; /* Hidden by default, shown on mobile */
}

.sar-tab-content {
    height: 100%;
    max-height: 350px;
    overflow-y: auto;
    padding: 15px;
    text-align: left;
    /* Add subtle scroll shadow for mobile indication */
    box-shadow: inset 0 -10px 10px -10px rgba(0,0,0,0.1);
}

/* Responsive tab content height for larger screens - prevents height changes when switching tabs */
@media (min-height: 800px) {
    .sar-tab-content {
        max-height: 450px;
    }
}

@media (min-height: 1000px) {
    .sar-tab-content {
        max-height: 500px;
    }
}

/* Specific rule for 1280x800 and similar resolutions */
@media (min-width: 1200px) and (min-height: 700px) and (max-height: 900px) {
    .sar-modal-content-wrapper {
        max-height: 65vh;
        min-height: 550px;
    }
    
    .sar-tab-content {
        max-height: 480px;
    }
}

.sar-tab-pane {
    display: none;
    animation: sar-fadeIn 0.3s ease;
}

.sar-tab-pane.sar-active {
    display: block;
}

@keyframes sar-fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Transportation Info Styles */
.sar-transportation-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 10px;
}

.sar-transportation-info h6 {
    color: black;
    margin-bottom: 0.75rem;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
}

.sar-transportation-info h6:first-child {
    margin-top: 0;
}

.sar-info-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sar-info-list li {
    position: relative;
    padding: 6px 0 6px 0;
    margin: 0;
    font-size: 12px;
    line-height: 1.3;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.sar-info-list li:last-child {
    border-bottom: none;
}

.sar-info-list li:hover {
    background-color: rgba(181, 153, 32, 0.05);
    border-radius: 4px;
    padding-left: 5px;
}

.sar-compact-text {
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 0.8rem;
    line-height: 1.4;
}

.sar-pickup-effective-date-2 {
    margin-bottom: 0.75rem;
    color: #495057;
    font-size: 0.8rem;
    line-height: 1.4;
}

/* Schedule Table Styles */
.sar-schedule-table {
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.sar-schedule-row {
    display: flex;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.sar-schedule-row:last-child {
    border-bottom: none;
}

.sar-schedule-row:hover {
    background-color: #f8f9fa;
}

.sar-schedule-header {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.sar-schedule-time {
    flex: 0 0 80px;
    padding: 8px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    color: #B59920;
    border-right: 1px solid #e9ecef;
    display: flex;
    align-items: center;
}

.sar-schedule-header .sar-schedule-time {
    color: #495057;
    font-weight: 600;
}

.sar-schedule-location {
    flex: 1;
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #333;
    line-height: 1.4;
    display: flex;
    align-items: center;
}

/* Location List Styles */
.sar-location-list {
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
}

.sar-location-item {
    padding: 8px 12px;
    font-size: 0.8rem;
    color: #333;
    line-height: 1.4;
    border-bottom: 1px solid #f1f3f4;
    transition: background-color 0.2s ease;
}

.sar-location-item:last-child {
    border-bottom: none;
}

.sar-location-item:hover {
    background-color: #f8f9fa;
}

/* Insurance Modal Content */
.sar-insurance-content-wrapper {
    padding: 24px;
    max-height: 50vh;
    min-height: 400px;
    overflow-y: auto;
}

.sar-insurance-section {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.sar-insurance-section:last-child {
    margin-bottom: 0;
}

.sar-insurance-section h6 {
    color: #000000;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
    font-weight: 600;
}

.sar-insurance-section p {
    color: #495057;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}

.sar-insurance-section p:last-child {
    margin-bottom: 0;
}

/* Booking Options Styling */
.sar-booking-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 0.75rem;
}

.sar-option-item {
    background: white;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.sar-option-item strong {
    color: #000000;
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.sar-option-item p {
    margin-bottom: 0;
    font-size: 0.8rem;
    color: #495057;
    line-height: 1.4;
}

.sar-modal-footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    padding: 16px 24px 24px 24px;
    border-top: 1px solid #e9ecef;
    flex-shrink: 0;
}

/* Travel insurance modal footer - space between for Back and Continue buttons */
#sar-travel-insurance-modal .sar-modal-footer {
    justify-content: space-between;
}

.sar-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.sar-btn-primary {
    background-color: #B59920;
    color: white;
}

.sar-btn-primary:hover {
    background-color: #8B7A1A;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(181, 153, 32, 0.3);
}

.sar-btn-secondary {
    background-color: #6c757d;
    color: white;
}

.sar-btn-secondary:hover {
    background-color: #5a6268;
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .sar-modal-overlay {
        padding: 10px;
    }
    
    .sar-modal-container {
        max-height: 95vh;
        max-width: 100%;
    }
    
    .sar-modal-header {
        padding: 16px 20px 12px 20px;
    }
    
    .sar-modal-title {
        font-size: 1.25rem;
    }
    
    .sar-modal-content-wrapper {
        max-height: 70vh;
    }
    
    .sar-tab-buttons {
        flex-direction: row;
        flex-wrap: wrap;
        border-bottom: 2px solid #e9ecef;
        margin: 0 20px 1rem 20px;
        background: transparent;
        border-radius: 0;
        padding: 0;
        gap: 0;
    }
    
    .sar-tab-btn {
        padding: 0.5rem 0.75rem;
        border-bottom: 3px solid transparent;
        border-radius: 0;
        margin-bottom: 0;
        flex: 1;
        min-width: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        font-size: 0.75rem;
    }
    
    .sar-tab-btn.sar-active {
        background: transparent;
        color: #B59920;
        border-bottom-color: #B59920;
        font-weight: 600;
    }
    
    .sar-tab-content-wrapper {
        padding: 0 20px;
    }
    
    .sar-scroll-hint {
        display: block;
        font-size: 0.7rem;
        padding: 6px 0;
    }
    
    .sar-tab-content {
        max-height: 300px;
        border-radius: 0 0 4px 4px;
    }
    
    .sar-schedule-table {
        font-size: 0.75rem;
    }
    
    .sar-schedule-time {
        flex: 0 0 70px;
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .sar-schedule-location {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .sar-location-item {
        padding: 6px 8px;
        font-size: 0.75rem;
    }
    
    .sar-transportation-info {
        padding: 0.75rem;
    }
    
    .sar-insurance-content-wrapper {
        padding: 20px;
        max-height: 65vh;
    }
    
    .sar-insurance-section {
        padding: 0.75rem;
    }
    
    .sar-option-item {
        padding: 0.75rem;
    }
    
    .sar-insurance-section h6 {
        font-size: 0.9rem;
    }
    
    .sar-insurance-section p {
        font-size: 0.8rem;
    }
    
    .sar-option-item strong {
        font-size: 0.85rem;
    }
    
    .sar-option-item p {
        font-size: 0.75rem;
    }
    
    .sar-modal-footer {
        padding: 12px 20px 20px 20px;
        flex-direction: column;
    }
    
    .sar-btn {
        width: 100%;
        padding: 14px 24px;
    }
}

@media (max-width: 480px) {
    .sar-modal-overlay {
        padding: 5px;
    }
    
    .sar-modal-container {
        max-height: 100vh;
        border-radius: 0;
    }
    
    .sar-modal-content-wrapper {
        max-height: 75vh;
    }
    
    .sar-transportation-info {
        padding: 0.5rem;
    }
    
    .sar-insurance-modal-content {
        padding: 15px;
        max-height: 70vh;
    }
    
    .sar-modal-footer {
        padding: 10px 15px 15px 15px;
    }
}

/* Extra small screens - force wrapping */
@media (max-width: 360px) {
    .sar-tab-btn {
        flex: 1 1 100%;
        min-width: 100px;
        margin-bottom: 0.25rem;
    }
    
    .sar-tab-btn:last-child {
        margin-bottom: 0;
    }
    
    .sar-tab-buttons {
        flex-direction: column;
        border-bottom: none;
        background: #f8f9fa;
        border-radius: 8px;
        padding: 0.25rem;
    }
    
    .sar-tab-btn {
        border-bottom: none;
        border-radius: 6px;
        margin-bottom: 0.125rem;
    }
    
    .sar-tab-btn.sar-active {
        background: #B59920;
        color: white;
        border-bottom-color: transparent;
    }
    
    .sar-schedule-table {
        font-size: 0.7rem;
    }
    
    .sar-schedule-time {
        flex: 0 0 60px;
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .sar-schedule-location {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .sar-location-item {
        padding: 4px 6px;
        font-size: 0.7rem;
    }
    
    .sar-insurance-content-wrapper {
        padding: 15px;
        max-height: 70vh;
    }
    
    .sar-insurance-section {
        padding: 0.5rem;
    }
    
    .sar-option-item {
        padding: 0.5rem;
    }
    
    .sar-insurance-section h6 {
        font-size: 0.85rem;
    }
    
    .sar-insurance-section p {
        font-size: 0.75rem;
    }
    
    .sar-option-item strong {
        font-size: 0.8rem;
    }
    
    .sar-option-item p {
        font-size: 0.7rem;
    }
}

/* Custom scrollbar for modal content */
.sar-tab-content::-webkit-scrollbar,
.sar-insurance-content-wrapper::-webkit-scrollbar {
    width: 6px;
}

.sar-tab-content::-webkit-scrollbar-track,
.sar-insurance-content-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.sar-tab-content::-webkit-scrollbar-thumb,
.sar-insurance-content-wrapper::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.sar-tab-content::-webkit-scrollbar-thumb:hover,
.sar-insurance-content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Animation for modal appearance */
@keyframes sar-modal-fade-in {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.sar-modal.is-open .sar-modal-container {
    animation: sar-modal-fade-in 0.3s ease-out;
}

/* Focus management for accessibility */
.sar-modal[aria-hidden="false"] .sar-modal-container {
    outline: none;
}

.sar-modal[aria-hidden="false"] .sar-form-input:first-of-type {
    outline: 2px solid #c69453;
    outline-offset: 2px;
}

/* Fast crossfade transition */
.sar-fade-out {
    opacity: 0 !important;
    transition: opacity 0.15s cubic-bezier(0.4, 0, 1, 1) !important;
}

.sar-fade-in {
    opacity: 0;
    animation: sar-quickFadeIn 0.2s cubic-bezier(0, 0, 0.2, 1) forwards !important;
}

@keyframes sar-quickFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Accessibility: Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sar-fade-out,
    .sar-fade-in {
        transition: none !important;
        animation: none !important;
        opacity: 1 !important;
    }
}

/* Device-specific footer spacing fixes */
/* iPhone XR, XS Max - reduce footer padding for better spacing */
@media (max-width: 414px) and (max-height: 900px) and (min-height: 850px) {
    .sar-modal-footer {
        padding: 8px 20px 16px 20px;
    }
    
    .sar-modal-content-wrapper {
        margin-bottom: 0;
    }
}

/* Galaxy S9 and similar - maintain current spacing */
@media (max-width: 360px) and (max-height: 750px) {
    .sar-modal-footer {
        padding: 10px 15px 15px 15px;
    }
}

