/* ===================================
   CHECKOUT PAGE STYLES
   =================================== */

/* Travel Details Messages */
.travel-details-messages {
    margin: 1rem 0;
}

.message-box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.message-box.loading {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    color: var(--gray700);
}

.message-box.error {
    background: linear-gradient(135deg, #fff5f5 0%, #fed7d7 100%);
    border: 1px solid #feb2b2;
    color: #c53030;
}

.message-box.success {
    background: linear-gradient(3deg, #f0fff4 0%, #e6f7e6 100%);
    border: 1px solid #d4edda;
    color: #22543d;
    padding: 1rem;
}

.message-box.info {
    background: linear-gradient(135deg, #ebf8ff 0%, #bee3f8 100%);
    border: 1px solid #90cdf4;
    color: #2c5282;
}

/* Inline Rate Summary */
.inline-rate-summary {
    width: 100%;
    padding: 1.25rem;
    text-align: center;
}

.rate-summary-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.success-icon {
    color: #38a169;
    font-size: 1.125rem;
    flex-shrink: 0;
}

.success-text {
    font-size: 0.875rem;
    font-weight: 600;
    color: #22543d;
}

.rate-summary-content {
    margin-bottom: 1.25rem;
}

.total-amount {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray900);
    line-height: 1.1;
    margin-bottom: 0.25rem;
}

.total-label {
    font-size: 0.6875rem;
    color: var(--gray500);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
}

.view-breakdown-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.view-breakdown-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.view-breakdown-btn:active {
    transform: translateY(0);
}

/* Mobile Header Layout */
.mobile-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 0.75rem 1rem;
    gap: 1rem;
}

.mobile-header-left {
    flex: 1;
    min-width: 0;
}

.mobile-dates {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray700);
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mobile-placeholder {
    color: var(--gray500);
    font-weight: 500;
}

.mobile-price {
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray900);
}

.mobile-price-label {
    font-size: 0.625rem;
    font-weight: 500;
    color: var(--gray500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mobile-header-right {
    flex-shrink: 0;
}

.mobile-toggle {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--primary-color);
}

.toggle-text {
    font-size: 0.8125rem;
    font-weight: 600;
}

.mobile-toggle iconify-icon {
    transition: transform 0.2s ease;
}

.mobile-toggle iconify-icon.rotated {
    transform: rotate(180deg);
}

/* Mobile Header Animation */
.checkout-sidebar-tab.rate-updated {
    animation: rateUpdatePulse 2s ease-in-out;
    position: relative;
}

.checkout-sidebar-tab.rate-updated::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--primary-color), var(--primary-light));
    border-radius: inherit;
    z-index: -1;
    opacity: 0.8;
    animation: rateUpdateGlow 2s ease-in-out;
}

@keyframes rateUpdatePulse {
    0%, 100% { 
        transform: scale(1);
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    }
    50% { 
        transform: scale(1.02);
        box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.3);
    }
}

@keyframes rateUpdateGlow {
    0%, 100% { 
        opacity: 0;
    }
    50% { 
        opacity: 0.8;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .mobile-header-content {
        padding: 0.625rem 0.875rem;
    }
    
    .mobile-dates {
        font-size: 0.8125rem;
    }
    
    .mobile-price {
        font-size: 1rem;
    }
    
    .total-amount {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .message-box {
        padding: 0.75rem;
        gap: 0.5rem;
    }
    
    .inline-rate-summary {
        padding: 1rem;
    }
    
    .mobile-header-content {
        padding: 0.5rem 0.75rem;
        gap: 0.75rem;
    }
    
    .mobile-dates {
        font-size: 0.75rem;
        margin-bottom: 0.125rem;
    }
    
    .mobile-price {
        font-size: 0.9375rem;
    }
    
    .total-amount {
        font-size: 1.5rem;
    }
    
    .view-breakdown-btn {
        padding: 0.625rem 1rem;
        font-size: 0.8125rem;
    }
    
    .toggle-text {
        font-size: 0.75rem;
    }
}

/* Loading Spinner in Messages */
.message-box.loading .rns-spinner {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Enhanced Message Box Hover Effects */
.message-box.success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(56, 161, 105, 0.15);
}

.message-box.info:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(44, 82, 130, 0.15);
}

/* Smooth Transitions */
.travel-details-messages > * {
    transition: all 0.3s ease;
}

/* Desktop Simple Success Message */
.message-box.success.d-none.d-md-flex {
    padding: 0.75rem 1rem;
    justify-content: flex-start;
    align-items: center;
    gap: 0.5rem;
}

.message-box.success.d-none.d-md-flex .success-icon {
    font-size: 1rem;
}

.message-box.success.d-none.d-md-flex span {
    font-size: 0.875rem;
    font-weight: 500;
}

/* Focus States for Accessibility */
.view-breakdown-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.view-breakdown-btn:focus:not(:focus-visible) {
    outline: none;
}

/* Checkout Textarea Styling */
.checkout-textarea {
    border: 1px solid #dee2e6 !important;
    border-radius: 0.375rem;
    min-height: 100px;
    padding: 0.75rem;
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    resize: vertical;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    width: 100%;
    background-color: #fff;
}

.checkout-textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
    outline: 0;
}

.checkout-textarea::placeholder {
    color: #6c757d;
    opacity: 1;
}

/* Ensure textarea inherits proper styling in input sections */
.input-section .checkout-textarea,
.checkout-input-group .checkout-textarea {
    border: 1px solid #dee2e6 !important;
    background-color: #fff;
}

.input-section .checkout-textarea:focus,
.checkout-input-group .checkout-textarea:focus {
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

/* Checkout Table Styling */
.checkout-table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.checkout-table thead th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    padding: 0.75rem;
    text-align: left;
    vertical-align: bottom;
}

.checkout-table tbody td {
    border-top: 1px solid #dee2e6;
    padding: 0.75rem;
    vertical-align: middle;
}

.checkout-table tbody tr:nth-of-type(odd) {
    background-color: rgba(0, 0, 0, 0.025);
}

.checkout-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.075);
}

/* Mobile Continue Button */
.mobile-continue-button {
    padding: 1.5rem 1rem 1rem 1rem;
    border-top: 1px solid #e5e7eb;
    margin-top: 1rem;
    background: #fff;
    position: sticky;
    bottom: 0;
    z-index: 10;
}

.mobile-continue-button .rns-btn {
    /* Inherit the base rns-btn-primary styling for consistency */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    /* Keep the same padding as base rns-btn-primary: 7px 14px, but add more for mobile */
    padding: 0.875rem 1.5rem;
    /* Inherit font-weight from base rns-btn-primary */
    font-weight: inherit;
    /* Keep enhanced shadow for mobile but ensure consistency */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
    /* Ensure consistent border radius */
    border-radius: var(--radius-lg);
}

.mobile-continue-button .rns-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.mobile-continue-button .rns-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Checkout Error Spacing */
.checkout-error-spacing {
    margin-top: 0.5rem;
}

/* Checkout Flex Center */
.checkout-flex-center {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Rental Terms Section */
.rental-terms-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.rental-terms-preview {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 1rem;
    background-color: #f9fafb;
    max-height: 150px;
    overflow-y: auto;
    font-size: 0.875rem;
    line-height: 1.5;
}

.rental-terms-preview .terms-content {
    color: #374151;
}

.terms-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    color: #6b7280;
    font-size: 0.875rem;
}

.terms-expand-link {
    text-align: right;
}

.terms-expand-link a {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.875rem;
    text-decoration: none;
}

.terms-expand-link a:hover {
    text-decoration: underline;
}

/* Rental Terms Modal */
.rental-terms-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    display: none;
    align-items: center;
    justify-content: center;
    margin: 0px;
    opacity: 0;
    transition: opacity 0.15s linear;
}

.rental-terms-modal-overlay.rental-terms-modal-active {
    display: flex;
    opacity: 1;
}

.rental-terms-modal {
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    transform: scale(0.95);
    transition: transform 0.15s ease-out;
}

.rental-terms-modal-overlay.rental-terms-modal-active .rental-terms-modal {
    transform: scale(1);
}

.rental-terms-modal .modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

.rental-terms-modal .modal-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
}

/* close-button styles centralized in rns-layout.css - DO NOT add close-button styles here */

.rental-terms-modal .modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.rental-terms-full {
    font-size: 0.875rem;
    line-height: 1.6;
    color: #374151;
}

.rental-terms-modal .modal-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background-color: #f9fafb;
    border-radius: 0 0 12px 12px;
}

/* Removed broad base styles - using specific selectors instead */

/* Payment Type Selection Styles */
.payment-type-selection {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
}

.payment-type-selection .rns-form-check {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.payment-type-selection .rns-form-check:hover {
    background-color: #f9fafb;
    border-color: #d1d5db;
}

.payment-type-selection .rns-form-check-input[type="radio"]:checked + label,
.payment-type-selection .rns-form-check:has(.rns-form-check-input[type="radio"]:checked) {
    background-color: #eff6ff;
    border-color: #3b82f6;
    color: #1e40af;
}

.payment-type-selection .rns-form-check-input {
    margin-right: 10px;
    flex: 0;
}

.checkout-form-section .rns-form-check {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Enhanced checkbox styling for checkout */
.checkout-form-section .rns-form-check-input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    background-color: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkout-form-section .rns-form-check-input[type="checkbox"]:hover {
    border-color: var(--primary-color);
}

.checkout-form-section .rns-form-check-input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.checkout-form-section .rns-form-check-input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    left: 7px;
    top: 3px;
    width: 6px;
    height: 11px;
    border: solid white;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}

.checkout-form-section .rns-form-check-label {
    flex: 1;
    min-width: 0;
    line-height: 1.5;
    cursor: pointer;
}



.payment-type-selection label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    cursor: pointer;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
}

.payment-type-selection label iconify-icon {
    font-size: 18px;
}

    
    .plan-details-link {
        font-size: 12px;
        flex-basis: 100%;
        width: 100%;
    }

    .plan-details-link a {
        color: var(--primary-color);
    }

/* Mobile responsive - ONLY for payment type selection radio buttons */
@media (max-width: 768px) {
    .payment-type-selection {
        flex-direction: column;
        gap: 12px;
    }
    
    .payment-type-selection .rns-form-check {
        width: 100%;
        justify-content: flex-start;
    }
    
    /* ONLY fix radio button label wrapping in payment selection */
    .payment-type-selection .rns-form-check label {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .rental-terms-modal {
        max-width: 95vw;
        max-height: 95vh;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .rental-terms-modal .modal-header,
    .rental-terms-modal .modal-body,
    .rental-terms-modal .modal-footer {
        padding: 1rem;
    }
    
    .rental-terms-modal .modal-title {
        font-size: 1rem;
        gap: 0.375rem;
    }
    
    .rental-terms-modal .modal-title iconify-icon {
        width: 20px;
        height: 20px;
    }
    
    /* close-button mobile styles centralized in rns-layout-mobile.css */
    
    .rental-terms-modal .modal-footer {
        flex-direction: column;
    }
    
    .rental-terms-modal .modal-footer .rns-btn {
        width: 100%;
    }
    
    /* Mobile radio group improvements */
    .radio-group {
        gap: 12px;
    }
    
    .radio-option {
        padding: 16px 12px;
        flex-wrap: wrap;
        align-items: flex-start;
        gap: 12px;
    }
    
    .radio-option input[type="radio"] {
        margin-top: 2px;
        flex: 0;
        order: 1;
    }
    
    .radio-label {
        flex: 1 1 0;
        font-size: 0.9rem;
        line-height: 1.4;
        min-width: 0;
        display: flex;
        flex-wrap: wrap;
        gap: 4px;
        align-items: baseline;
        order: 2;
    }

    
    .radio-price {
        flex: 0 0 auto;
        margin-left: auto;
        font-size: 1rem;
        order: 3;
    }
    
    .option-note {
        flex: 0 0 100%;
        margin-left: calc(20px + 12px);
        margin-top: 4px;
        font-size: 0.8rem;
        color: #6b7280;
    }
    
    /* On very small screens, force price to wrap below */
    @media (max-width: 480px) {
        .radio-price {
            flex: 0 0 100%;
            text-align: right;
        }
    }
    
    .rental-terms-modal .modal-footer {
        gap: 0.5rem;
    }
    
    .rental-terms-modal .modal-footer .rns-btn {
        width: 100%;
    }
    
    /* Mobile checkout input improvements - stack all input rows vertically */
    .checkout-input-row {
        flex-direction: column !important;
        gap: 12px;
    }
    
    /* For no-gap rows on mobile, stack with connected borders */
    .checkout-input-row.no-gap {
        gap: 0;
    }
    
    /* Remove bottom border from all except last to avoid double borders */
    .checkout-input-row.no-gap .checkout-input-group:not(:last-child) input,
    .checkout-input-row.no-gap .checkout-input-group:not(:last-child) select {
        border-bottom: none;
    }
    
    /* All inputs in no-gap rows - remove all borders (container has outer border) */
    .checkout-input-row.no-gap .checkout-input-group input,
    .checkout-input-row.no-gap .checkout-input-group select {
        border: none !important;
        border-radius: 0 !important;
    }
    
    /* Add only bottom border between inputs (not on last) */
    .checkout-input-row.no-gap .checkout-input-group:not(:last-child) input,
    .checkout-input-row.no-gap .checkout-input-group:not(:last-child) select {
        border-bottom: 1px solid #e0e0e0 !important;
    }
    
    /* SlimSelect dropdowns in no-gap rows - match input styling */
    .checkout-input-row.no-gap .checkout-input-group .ss-main {
        border: none !important;
        border-radius: 0 !important;
        padding: 12px !important;
        min-height: 46px;
        height: auto;
    }
    
    /* Add bottom border to SlimSelect in no-gap rows (except last) */
    .checkout-input-row.no-gap .checkout-input-group:not(:last-child) .ss-main {
        border-bottom: 1px solid #e0e0e0 !important;
    }
    
    .checkout-input-group {
        flex: none;
        width: 100%;
    }

    /* Property Details Modal - Fix positioning and layout on mobile */
    .property-details-modal {
        padding: 0;
        align-items: center;
        justify-content: center;
    }

    .property-details-modal .modal-content {
        width: calc(100vw - 2rem);
        max-width: calc(100vw - 2rem);
        max-height: calc(100vh - 2rem);
        margin: 1rem;
    }

    .property-details-modal .modal-body {
        padding: 1rem;
        max-height: calc(100vh - 4rem);
    }

    /* close-button mobile styles centralized in rns-layout-mobile.css */

    /* Modal image grid - stack vertically on mobile */
    .modal-image-grid {
        flex-direction: column;
        gap: 1rem;
        margin-bottom: 1.5rem;
    }

    .checkout-content .main-image-container,
    .main-image-container {
        max-width: 100%;
        width: 100%;
    }

    .thumbnail-stack {
        flex-direction: row;
        flex: 1;
        gap: 0.75rem;
    }

    .thumbnail-container {
        flex: 1;
        min-width: 0;
    }

    /* Modal property info */
    .modal-property-title {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    .modal-property-specs {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .spec-item {
        flex: 0 0 calc(50% - 0.375rem);
        font-size: 0.875rem;
    }

    /* Modal sections */
    .modal-section {
        gap: 0.75rem;
    }

    .modal-section-title {
        font-size: 1.125rem;
    }

    .modal-section-content {
        font-size: 0.875rem;
        line-height: 1.5;
    }

    /* Modal amenities grid - single column on mobile */
    .modal-amenities-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .modal-amenity-item {
        padding: 0.75rem;
    }

    .amenity-name {
        font-size: 0.875rem;
    }

    .amenity-description {
        font-size: 0.8125rem;
    }
}

/* Checkout Text Utilities */
.checkout-text-primary {
    color: var(--primary-color) !important;
}

.checkout-text-success {
    color: #198754 !important;
}

.checkout-text-danger {
    color: #dc3545 !important;
}

.checkout-text-muted {
    color: #6c757d !important;
}

.checkout-text-center {
    text-align: center !important;
}

/* Checkout Alert Styles */
.checkout-alert {
    position: relative;
    padding: 0.75rem 1.25rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
}

.checkout-alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.checkout-alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

/* Checkout Spacing Utilities */
.checkout-spacing-top {
    margin-top: 1rem;
}
