/* Tab styling */
.nav-tabs {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
    display: flex;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tabs .nav-item {
    flex-shrink: 0;
    white-space: nowrap;
}

.nav-tabs .nav-link {
    border: none;
    padding: 0.75rem 1rem;
    margin-right: 0.5rem;
    border-radius: 0;
    position: relative;
    white-space: nowrap;
    flex-shrink: 0;
    min-width: fit-content;
    max-width: none;
}

.nav-tabs .nav-link.active {
    background: none;
    border: none;
    color: #2B4896 !important;
}

.nav-tabs .nav-link.active::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: #FEBA11;
    border-radius: 12px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .nav-tabs .nav-link {
        padding: 0.5rem 0.75rem;
        font-size: 14px;
        margin-right: 0.25rem;
        min-width: auto;
    }
}

@media (max-width: 576px) {
    .nav-tabs .nav-link {
        padding: 0.4rem 0.6rem;
        font-size: 13px;
        margin-right: 0.2rem;
        min-width: auto;
    }
}

/* Utility items */
.utility-item {
    transition: all 0.3s ease;
    cursor: pointer;
    background-color: #F4F4F4;
    height: 84px;
    display: flex;
    align-items: center;
    justify-content: start;
}

.utility-item:hover {
    border-color: #2B4896 !important;
    background-color: #f8f9ff;
}

.utility-item.selected {
    border-color: #2B4896 !important;
    background-color: #f8f9ff;
    box-shadow: 0 2px 4px rgba(43, 72, 150, 0.1);
}

.utility-item.selected i,
.utility-item.selected span {
    color: #2B4896 !important;
    font-weight: 600;
}

.utility-item span {
    transition: all 0.3s ease;
}

/* Form styling */
.form-control,
.form-select {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 0.75rem;
}

.form-control:focus,
.form-select:focus {
    border-color: #2B4896;
    box-shadow: 0 0 0 0.2rem rgba(43, 72, 150, 0.25);
}

/* Floating label styling */
.form-floating {
    position: relative;
}

.form-floating>.form-control,
.form-floating>.form-select {
    height: 58px;
    padding: 1rem 0.75rem 0.25rem;
}

.form-floating>label {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    padding: 1rem 0.75rem;
    pointer-events: none;
    border: 1px solid transparent;
    transform-origin: 0 0;
    transition: opacity 0.1s ease-in-out, transform 0.1s ease-in-out;
    color: #6c757d;
    font-size: 14px;
}

.form-floating>.form-control:focus~label,
.form-floating>.form-control:not(:placeholder-shown)~label,
.form-floating>.form-select~label {
    opacity: 0.65;
    transform: scale(0.85) translateY(-0.5rem) translateX(0.15rem);
    color: #2B4896;
}

.form-floating>.form-control:focus~label,
.form-floating>.form-select:focus~label {
    color: #2B4896;
}

/* Custom styling for date input with calendar button */
.form-floating .form-control[readonly] {
    padding-right: 50px;
    background-color: #fff;
}

.form-floating .form-control[readonly]:focus {
    background-color: #fff;
}

.form-floating #timeButton {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    border-left: none;
    background-color: #fff;
}

.form-floating #timeButton:hover {
    background-color: #f8f9fa;
}

.form-floating #timeButton:focus {
    box-shadow: none;
    background-color: transparent;
}

.form-floating .d-flex:focus-within {
    border-color: #2B4896;
    box-shadow: 0 0 0 0.2rem rgba(43, 72, 150, 0.25);
}

/* Button styling */
.btn-primary {
    background-color: #2B4896;
    border-color: #2B4896;
}

.btn-primary:hover {
    background-color: #1e3a7a;
    border-color: #1e3a7a;
}

/* Custom radio style - clean circle with inner dot */
.form-check {
    gap: 8px;
}

.form-check-input[type="radio"] {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #fff;
    position: relative;
    margin: 0;
    cursor: pointer;
    vertical-align: middle;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-check-input[type="radio"]:focus {
    box-shadow: 0 0 0 4px rgba(43, 72, 150, 0.15);
}

.form-check-input[type="radio"]:checked {
    background-color: #fff !important;
    border: 2px solid #2B4896;
}

.form-check-input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border: 2px solid #2B4896;
    background: #2B4896;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.form-check-label {
    font-weight: 500;
    color: #2b2f33;
    cursor: pointer;
}

/* Rental radio custom color */
.rental-radio {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #fff;
    position: relative;
    margin: 0;
    cursor: pointer;
    vertical-align: middle;
    box-shadow: none;
    border: 2px solid #FEBA11;
}

.rental-radio:checked {
    border-color: #FEBA11 !important;
    background-color: #FEBA11 !important;
}

input.rental-radio:checked::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    background: #FEBA11 !important;
    border: 2px solid #FEBA11 !important;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Calendar Picker Styles */
.calendar-day {
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
}

.calendar-day:hover {
    background-color: #f8f9fa;
}

.calendar-day.selected {
    background-color: #233876;
    color: white;
}

.calendar-day.other-month {
    color: #ccc;
}

.calendar-day.today {
    border: 2px solid #233876;
    font-weight: bold;
}

/* Hide inactive tabs completely to remove spacing */
.tab-pane:not(.show) {
    display: none !important;
    height: 0;
    overflow: hidden;
    position: absolute;
    visibility: hidden;
}

.tab-content {
    position: relative;
}

/* Clamp long terms text to show ellipsis */
.terms-text {
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.booking-badge {
    background: #BBF7D4;
    color: #0f5132;
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
}

/* Setup modal option cards */
.modal .list-group {
    gap: 12px;
}

.modal .list-group .list-group-item {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

/* Loại bỏ border dính liền mặc định của list-group */
.modal .list-group .list-group-item+.list-group-item {
    border-top-width: 1px;
}

/* Active state for selected option (CSS :has for modern browsers) */
.modal .list-group .list-group-item:has(input:checked),
.modal .list-group .list-group-item.active-option {
    background: #FFF8E7;
    border-color: #FEBA11;
    box-shadow: 0 0 0 2px rgba(254, 186, 17, 0.15);
}

/* Photo Upload Styles */
.photo-upload-item {
    position: relative;
}

.photo-placeholder {
    width: 100%;
    height: 187px;
    background-color: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.photo-placeholder:hover {
    border-color: #2B4896;
    background-color: #f8f9ff;
}

.photo-placeholder.has-image {
    background-color: #f8f9ff;
}

.photo-content {
    display: flex;
    align-items: center;
    text-align: center;
}

.camera-icon {
    width: 24px;
    height: 24px;
    margin-bottom: 8px;
    opacity: 0.6;
}

.photo-text {
    font-size: 14px;
    color: #6c757d;
    font-weight: 500;
    margin-bottom: 4px;
}

.photo-label {
    font-size: 12px;
    color: #adb5bd;
}

.photo-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.photo-preview-container {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 10px;
    overflow: hidden;
}

.edit-icon-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0;
}

.photo-preview-container:hover .edit-icon-overlay {
    opacity: 1;
}

/* Document Upload Styles */
.document-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.document-item {
    display: flex;
    align-items: center;
    padding: 16px;
    background-color: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.document-item:hover {
    border-color: #2B4896;
    background-color: #f8f9ff;
}

.document-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 16px;
}

.document-icon img {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

.document-info {
    flex: 1;
}

.document-title {
    font-weight: 500;
    color: #343a40;
    font-size: 14px;
}

.document-add-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #2B4896;
    background-color: #fff;
    color: #2B4896;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.document-add-btn:hover {
    background-color: #2B4896;
    color: #fff;
}

.document-add-btn img {
    transition: all 0.3s ease;
}

.document-add-btn:hover img {
    /* Không áp dụng filter để giữ màu gốc của icon */
}

/* Button states */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .photo-placeholder {
        height: 108px;
    }

    .action-buttons {
        justify-content: space-between !important;
    }

    .btn-back,
    .btn-continue {
        width: 100%;
        padding: 14px 20px;
        font-size: 16px;
    }
}

/* Surcharge Styles */
.surcharge-section {
    background-color: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e9ecef;
}

.surcharge-section h4 {
    font-size: 16px;
    color: #343a40;
}

.surcharge-content {
    transition: all 0.3s ease;
}

.surcharge-content.hidden {
    display: none;
}

.slider-group {
    margin-bottom: 20px;
}

.slider-group:last-child {
    margin-bottom: 0;
}

.slider-group label {
    font-size: 14px;
    color: #495057;
    margin-bottom: 8px;
}

.slider-container {
    position: relative;
    padding: 10px 0;
}

.form-range {
    width: 100%;
    height: 6px;
    background: transparent;
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-range::-webkit-slider-runnable-track {
    background: linear-gradient(to right, #2BB1FF 0%, #FFE47A var(--fill-pct, 0%), #dee2e6 var(--fill-pct, 0%), #dee2e6 100%);
    height: 6px;
    border-radius: 3px;
    position: relative;
}

.form-range::-moz-range-track {
    background: linear-gradient(to right, #2BB1FF 0%, #FFE47A var(--fill-pct, 0%), #dee2e6 var(--fill-pct, 0%), #dee2e6 100%);
    height: 6px;
    border-radius: 3px;
    border: none;
}

/* Track sẽ hiển thị gradient dựa trên --fill-pct */

.form-range {
    position: relative;
    z-index: 2;
}

.form-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    background: #2B4896;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.form-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #2B4896;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.slider-value {
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

/* Price calendar */
.price-cal-grid {
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.price-day {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    border: 1px solid #e9ecef;
    background: #ffffff;
    margin: 0 auto;
}

.price-day.muted {
    color: #c0c4c7;
}

.price-day.selected {
    background: #2B4896;
    color: #fff;
    border-color: #2B4896;
}

.price-day.range {
    background: #3d57a5;
    color: #fff;
    border-color: #3d57a5;
}

.price-day.day-available {
    border-color: #16a34a;
}

.price-day.day-peak {
    border-color: #FEBA11;
}

.price-day.day-busy {
    background: #2B4896;
    color: #fff;
    border-color: #2B4896;
}

.legend {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.legend-available {
    background: #16a34a;
}

.legend-near {
    background: #FEBA11;
}

.legend-busy {
    background: #2B4896;
}

/* Center sliders in price cards */
.price-card .slider-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hint bottom-right inside calendar */
.calendar {
    position: relative;
}

.calendar-hint {
    position: absolute;
    right: 12px;
    bottom: 8px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 6px;
}

@media (max-width: 768px) {
    .calendar-hint {
        position: static;
        margin-top: 8px;
    }

    /* Legend horizontal on mobile */
    .calendar .col-md-4 .d-flex.flex-column {
        flex-direction: row !important;
        align-items: center;
        gap: 16px;
        flex-wrap: wrap;
    }

    .calendar .col-md-4 .d-flex.flex-column>.d-flex {
        gap: 8px;
    }
}

/* Time section styles */
.time-section .time-row+.time-row {
    border-top: 1px solid #e9ecef;
}

.time-add {
    color: #2B4896;
    font-weight: 600;
}

.time-slot {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 6px 10px;
}

.time-remove {
    cursor: pointer;
}

/* Toggle Switch Styles (match design) */
.form-check.form-switch .form-check-input {
    width: 44px;
    height: 24px;
    background-color: #E6EEF7;
    border: 1px solid #C9D7EF;
    border-radius: 999px;
    cursor: pointer;
    position: relative;
    transition: background-color 0.25s ease, border-color 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.06);
    background-image: none !important;
    /* Loại bỏ knob mặc định của Bootstrap */
    -webkit-appearance: none;
    appearance: none;
}

.form-check.form-switch .form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(43, 72, 150, 0.15);
}

.form-check.form-switch .form-check-input::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background-color: #ffffff;
    top: 1px;
    left: 3px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: left 0.25s ease;
}

.form-check.form-switch .form-check-input:checked {
    background-color: #2B4896;
    border-color: #2B4896;
}

.form-check.form-switch .form-check-input:checked::before {
    left: calc(100% - 3px - 18px);
}

/* Car Features Loading and Error States */
#features-loading {
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#features-loading .spinner-border {
    width: 3rem;
    height: 3rem;
}

#features-error {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#features-error .alert {
    max-width: 400px;
    text-align: center;
}

/* Feature item image styling */
.utility-item img {
    object-fit: contain;
    max-width: 100%;
    max-height: 100%;
}
