/* Custom table colors and sticky header/column styles for ship schedule */
.table-scroll-wrapper {
    max-height: 70vh;
    overflow: auto;
    /*width: 100%;*/
    width: auto !important;
}

.table th, .table td {
    /* min-width: 120px;
    white-space: nowrap;*/
    min-width: unset !important;
    width: 1% !important;
    white-space: nowrap !important;
    text-align: center; /* Center align */
    font-size: 0.85rem; /* Smaller but readable (˜14px on desktop) */
    padding: 6px 8px; /* Keep touch-friendly padding */
    border: 1px solid rgba(0, 0, 0, 0.2); /* Light black border */
    color: #222; /* Dark gray text */
}

.sticky-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--lc-header-bg, #1a237e); /* fallback to custom blue */
    color: var(--lc-header-color, #fff);
}

.sticky-col {
    position: sticky !important;
    left: 0 !important;
    z-index: 11;
    background: var(--lc-header-bg, #1a237e);
    color: var(--lc-header-color, #fff);
    box-shadow: 2px 0 2px -1px #e0e0e0;
}

.sticky-col-2 {
    position: sticky;
    left: 100px; /* match min-width of first column */
    z-index: 11;
    background: var(--lc-header-bg, #1a237e);
    color: var(--lc-header-color, #fff);
    box-shadow: 2px 0 2px -1px #e0e0e0;
}

/* Make sure sticky header is above sticky columns */
.sticky-header.sticky-col, .sticky-header.sticky-col-2 {
    z-index: 12;
}

.lc-table-header {
    background-color: #1c6ea4 !important; /* Custom header color */
    color: #fff !important;
}
.lc-table-body {
    background-color: #e3eafc !important; /* Custom body color */
    color: #222 !important;
}
.lc-table-body-alt {
    background-color: #f7faff !important; /* Optional: alternate row color */
    color: #222 !important;
}

/* Highlight search string */
.highlight-search {
    background-color: yellow;
    color: #222;
}

/* new schedule design start*/
.stepper {
    display: flex;
    flex-wrap: nowrap; /* ? no wrapping */
    overflow-x: auto; /* ? horizontal scroll */
    padding-bottom: 0.5rem; /* space for scroll bar */
    -webkit-overflow-scrolling: touch; /* ? smooth scroll on iOS */
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    margin: 40px 0;
}

    .stepper::before {
        content: '';
        position: absolute;
        top: 30px;
        left: 0;
        width: 100%;
        height: 4px;
        background: #dee2e6;
        z-index: 0;
    }

.step {
    position: relative;
    z-index: 1;
    text-align: center;
    flex: 1;
    padding: 0 10px;
}

    .step .circle {
        width: 40px;
        height: 40px;
        margin: 0 auto 10px;
        border-radius: 50%;
        background: #0d6efd;
        color: white;
        display: flex;
        justify-content: center;
        align-items: center;
        font-weight: bold;
    }

    .step.start .circle {
        background: #0d6efd;
    }

    .step.end .circle {
        background: #198754;
    }

    .step.green .circle {
        background: #198754;
    }

    .step ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

        .step ul li {
            font-size: 0.9rem;
        }

.date {
    font-size: 0.85rem;
    color: #6c757d;
}

/* new schedule design end*/

/* Toggle view check box - start*/

/* Toggle switch appearance (basic, works without Bootstrap) */
.form-switch .form-check-input {
    -webkit-appearance: none;
    appearance: none;
    width: 48px;
    height: 26px;
    background-color: #e9ecef;
    border-radius: 999px;
    position: relative;
    cursor: pointer;
    transition: background-color .2s ease-in-out;
    box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
    vertical-align: middle;
}

    .form-switch .form-check-input:before {
        content: '';
        position: absolute;
        top: 3px;
        left: 3px;
        width: 20px;
        height: 20px;
        background: #fff;
        border-radius: 50%;
        box-shadow: 0 2px 4px rgba(0,0,0,0.12);
        transition: transform .2s ease-in-out;
    }

    .form-switch .form-check-input:checked {
        background-color: #0d6efd;
    }

        .form-switch .form-check-input:checked:before {
            transform: translateX(22px);
        }

.form-switch .form-check-label {
    cursor: pointer;
    margin-left: .5rem;
}

/* Toggle view check box - end*/




#searchPanel .row.g-3 {
    align-items: flex-end;
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

#searchPanel .text-end.mt-3 {
    align-self: flex-end;
    margin-top: 0;
}
/* Attractive searchable schedule dropdowns */
.schedule-filter-field {
    flex: 0 1 260px;
    max-width: 280px;
    min-width: 220px;
    position: relative;
    width: 100%;
}

.schedule-filter-field .form-label {
    color: #17324d;
    font-weight: 700;
    margin-bottom: 8px;
}

.schedule-filter-field .select2-container {
    width: 100% !important;
}

.schedule-filter-field .select2-container--default .select2-selection--single {
    align-items: center;
    background: linear-gradient(180deg, #ffffff 0%, #f7fbfd 100%);
    border: 1px solid #c9dce7;
    border-radius: 12px;
    box-shadow: 0 8px 18px rgba(15, 76, 117, 0.08);
    display: flex;
    height: 48px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.schedule-filter-field .select2-container--default.select2-container--focus .select2-selection--single,
.schedule-filter-field .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #0077b6;
    box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.14), 0 10px 24px rgba(15, 76, 117, 0.12);
}

.schedule-filter-field .select2-container--default .select2-selection--single .select2-selection__rendered {
    color: #17324d;
    font-weight: 600;
    line-height: 48px;
    padding-left: 16px;
    padding-right: 42px;
}

.schedule-filter-field .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #6b8193;
    font-weight: 500;
}

.schedule-filter-field .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 48px;
    right: 12px;
}

.select2-dropdown.schedule-select-dropdown {
    border: 1px solid #c9dce7;
    border-radius: 12px;
    box-shadow: 0 18px 40px rgba(15, 76, 117, 0.16);
    overflow: hidden;
}

.schedule-select-dropdown .select2-search--dropdown {
    background: #f4f9fc;
    padding: 10px;
}

.schedule-select-dropdown .select2-search__field {
    border: 1px solid #c9dce7 !important;
    border-radius: 10px;
    font-family: 'Poppins', sans-serif;
    min-height: 40px;
    outline: none;
    padding: 8px 12px;
}

.schedule-select-dropdown .select2-search__field:focus {
    border-color: #0077b6 !important;
    box-shadow: 0 0 0 3px rgba(0, 119, 182, 0.14);
}

.schedule-select-dropdown .select2-results__option {
    color: #17324d;
    font-weight: 500;
    padding: 10px 14px;
}

.schedule-select-dropdown .select2-results__option--highlighted[aria-selected] {
    background: #0077b6;
    color: #ffffff;
}

@media (max-width: 768px) {
    #searchPanel .row.g-3 {
        display: grid;
        gap: 14px;
        grid-template-columns: 1fr;
    }

    .schedule-filter-field {
        flex-basis: 100%;
        max-width: none;
        min-width: 0;
        width: 100%;
    }

    #searchPanel .text-end.mt-3,
    #searchPanel .text-end.mt-3 .btn {
        width: 100%;
    }
}

.schedule-view-header {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    width: 100%;
}

.schedule-view-header h2 {
    flex: 1 1 auto;
    margin: 0;
}

.schedule-view-toggle {
    display: flex;
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: auto;
}

.schedule-view-toggle .form-switch {
    align-items: center;
    display: inline-flex;
    justify-content: flex-end;
    white-space: nowrap;
}

@media (max-width: 640px) {
    .schedule-view-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .schedule-view-header h2,
    .schedule-view-toggle {
        width: 100%;
    }

    .schedule-view-toggle {
        justify-content: flex-end;
        margin-left: 0;
    }
}

/* Classic table search controls */
.classic-search-bar {
    background: #f7fbfd;
    border: 1px solid #d5e8ef;
    border-radius: 14px;
    box-shadow: 0 10px 24px rgba(15, 76, 117, 0.08);
    margin-bottom: 18px;
    max-width: 560px;
    padding: 14px;
    width: 100%;
}

.classic-search-bar__label {
    color: #17324d;
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.classic-search-bar__control {
    align-items: stretch;
    background: #ffffff;
    border: 1px solid #c9dce7;
    border-radius: 12px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.classic-search-bar__control:focus-within {
    border-color: #0077b6;
    box-shadow: 0 0 0 4px rgba(0, 119, 182, 0.14);
}

.classic-search-bar__icon {
    align-items: center;
    color: #0077b6;
    display: flex;
    font-size: 1.25rem;
    justify-content: center;
}

.classic-search-bar__input {
    border: 0;
    color: #17324d;
    font: inherit;
    min-height: 46px;
    min-width: 0;
    outline: none;
    padding: 10px 12px 10px 0;
    width: 100%;
}

.classic-search-bar__input::placeholder {
    color: #6b8193;
}

.classic-search-bar__filter {
    align-items: center;
    background: #e9f4f8;
    border: 0;
    border-left: 1px solid #d5e8ef;
    color: #075985;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    gap: 7px;
    justify-content: center;
    min-height: 46px;
    padding: 0 14px;
    transition: background 0.2s ease, color 0.2s ease;
}

.classic-search-bar__filter:hover,
.classic-search-bar__filter:focus-visible,
.classic-search-bar__filter.active {
    background: #0077b6;
    color: #ffffff;
    outline: none;
}

@media (max-width: 640px) {
    .classic-search-bar {
        max-width: none;
        padding: 12px;
    }

    .classic-search-bar__control {
        grid-template-columns: 42px minmax(0, 1fr);
    }

    .classic-search-bar__filter {
        border-left: 0;
        border-top: 1px solid #d5e8ef;
        grid-column: 1 / -1;
        width: 100%;
    }
}

/* Modern ship schedule outer frame and centered ship header */
#divModernViewShipSchedule {
    background: #ffffff;
    border: 1px solid #d5e8ef;
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(15, 76, 117, 0.10);
    overflow: hidden;
}

#divModernViewShipSchedule .schedule-item {
    background: #ffffff;
    border: 1px solid #e1edf2;
    border-radius: 14px;
    overflow: hidden;
}

#divModernViewShipSchedule .card-header {
    background: linear-gradient(180deg, #f7fbfd 0%, #eef8fb 100%);
    border-bottom: 1px solid #d5e8ef;
    padding: 16px 18px;
    text-align: center;
}

#divModernViewShipSchedule .card-header h5,
#divModernViewShipSchedule .card-header p {
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

#divModernViewShipSchedule .card-header h5 {
    color: #0077b6;
    font-size: 1.15rem;
    margin-bottom: 6px;
}

#divModernViewShipSchedule .card-header p {
    color: #334155;
    margin-bottom: 0;
}

@media (max-width: 640px) {
    #divModernViewShipSchedule {
        border-radius: 14px;
        padding: 12px !important;
    }

    #divModernViewShipSchedule .schedule-item {
        border-radius: 12px;
    }
}

#searchPanel + #divModernViewShipSchedule {
    margin-top: 18px;
}

@media (max-width: 640px) {
    #searchPanel + #divModernViewShipSchedule {
        margin-top: 14px;
    }
}

.schedule-page-title {
    align-items: center;
    color: #05263b;
    display: flex;
    flex: 1 1 auto;
    font-size: clamp(1.45rem, 3vw, 2.15rem);
    font-weight: 800;
    gap: 10px;
    justify-content: center;
    letter-spacing: 0;
    line-height: 1.15;
    margin: 0;
    text-align: center;
}

.schedule-page-title i {
    align-items: center;
    background: linear-gradient(135deg, #0077b6, #00b4d8);
    border-radius: 50%;
    box-shadow: 0 10px 22px rgba(0, 119, 182, 0.18);
    color: #ffffff;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 1.3rem;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.schedule-page-title span {
    display: inline-block;
}

@media (max-width: 640px) {
    .schedule-page-title {
        justify-content: center;
        width: 100%;
    }
}



/* Mobile alignment fixes for schedule header, filter button, and classic table */
#divModernView {
    clear: both;
}

#divModernView > div:first-child {
    align-items: center;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 14px;
    width: 100%;
}

#filterToggleBtn {
    align-items: center;
    display: inline-flex !important;
    gap: 7px;
    justify-content: center;
    min-height: 40px;
    padding-left: 14px;
    padding-right: 14px;
    width: 142px !important;
}

.table-scroll-wrapper {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: auto !important;
    position: relative;
    width: 100% !important;
    -webkit-overflow-scrolling: touch;
}

#tblClassicView {
    border-collapse: separate;
    border-spacing: 0;
    min-width: 820px;
    table-layout: auto;
    width: max-content !important;
}

#tblClassicView th,
#tblClassicView td {
    min-width: 128px !important;
    width: auto !important;
}

#tblClassicView th:first-child,
#tblClassicView td:first-child {
    left: 0;
    min-width: 104px !important;
    position: sticky;
}

#tblClassicView th:first-child {
    z-index: 30;
}

#tblClassicView td:first-child {
    background: #1c6ea4 !important;
    color: #ffffff !important;
    z-index: 20;
}

@media (max-width: 640px) {
    .schedule-view-header {
        gap: 12px;
        margin-bottom: 18px !important;
    }

    .schedule-view-toggle {
        min-height: 34px;
    }

    #divModernView > div:first-child {
        justify-content: flex-start;
        margin-bottom: 12px;
        padding-top: 2px;
    }

    #filterToggleBtn {
        flex: 0 0 142px;
        max-width: 142px;
        width: 142px !important;
    }

    .table-scroll-wrapper {
        margin-top: 12px;
        width: 100% !important;
    }

    #tblClassicView {
        min-width: 780px;
    }

    #tblClassicView th,
    #tblClassicView td {
        min-width: 118px !important;
        width: auto !important;
    }

    #tblClassicView th:first-child,
    #tblClassicView td:first-child {
        min-width: 96px !important;
    }
}
