/* Global Resets and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f4f8; /* Pale blue/grey background */
    color: #333;
    line-height: 1.5; /* Compact line height */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
    background: #003366; /* Wingate Dark Blue */
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #002244;
}

/* Utility Classes */
.wingate-blue-text {
    color: #003366;
}

/* Container */
.container {
    width: 100%;
    max-width: 1280px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Header */
header {
    background-color: #003366; /* Wingate Dark Blue */
    color: white;
    padding: .5rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
header .header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
header .logo-area {
    display: flex;
    align-items: center;
}
header .logo-img {
    height: 35px;
    width: 50px;
    margin-right: 0.75rem;
    background: url(../img/logo-symbol.png) center no-repeat;
    background-size: contain;
}
header .header-title {
    font-size: 1rem;
    font-weight: 600;
}

/* Main Content Area */
main {
    padding-top: .5rem;
    padding-bottom: .5rem;
    flex-grow: 1;
}

/* Action Buttons Container - Flexible Width */
.action-buttons-container {
    display: flex;
    gap: 0.75rem; /* Reduced gap */
    margin-bottom: .5rem;
}
.action-button {
    background-color: #003366;
    color: white;
    border: none;
    border-radius: 0.375rem;
    padding: 0.75rem 0.5rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    transition: background-color 0.2s, opacity 0.2s;
    flex: 1 1 0; /* Makes buttons flexible and equal width */
    min-width: 90px; /* Prevents them from getting too small */
    height: 80px; /* Compact height */
}
.action-button:hover:not(:disabled) {
    background-color: #002244;
}
.action-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
    opacity: 0.7;
}
.action-button .fa-solid {
    margin-bottom: 0.5rem;
    display: inline-block;
    line-height: 1;
    font-size: 1rem;
}
.action-button .svg-inline--fa {
    height: 2.2em !important;
    display: inline-block !important;
    vertical-align: -0.125em !important;
    overflow: visible !important;
}
.action-button span {
    font-size: 0.75rem;
    line-height: 1.2;
    margin-top: 0.25rem;
}

/* Child Columns: Mobile-first (stacked) */
.child-columns-container {
    display: flex;
    flex-direction: column; /* Stack vertically on mobile */
    gap: 1.5rem; /* Vertical gap between children on mobile */
    align-items: center; /* Center the columns */
    flex-wrap: wrap;
}

/* Child Column Styling - Made more compact */
.child-column {
    background-color: white;
    padding: 1rem;
    border-radius: 0.75rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05), 0 10px 15px rgba(0,0,0,0.1);
    flex: 1 1 100%; /* Take full width on mobile */
    min-width: 280px;
    max-width: 395px;
    width: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
}
.child-column-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e2e8f0;
}
.child-column-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #003366;
}
.remove-child-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.2rem;
    cursor: pointer;
}
.remove-child-btn:hover {
    color: #c82333;
}
.child-info-section {
    margin-bottom: 1rem; /* Reduced margin */
}
.child-dob-display {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.375rem;
    background-color: #f8fafc;
}
.estimated-year-group {
    font-size: 0.875rem;
    color: #475569;
    background-color: #e0f7fa;
    padding: 0.5rem;
    border-radius: 0.375rem;
    margin-bottom: 0.5rem;
}

/* Fee Tab Item Styling - Made more compact */
.fee-tab-item {
    background-color: #e9ecef;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 0.6rem 0.8rem;
    margin-bottom: 0.75rem;
}
.fee-tab-header {
    display: flex;
    align-items: center; /* Vertically align items */
    justify-content: space-between;
}
 .fee-tab-header.with-content {
    margin-bottom: 0.5rem;
}
.fee-tab-main-content {
    display: flex;
    align-items: center;
    flex-grow: 1;
}
.fee-tab-icon {
    font-size: 1.2rem;
    color: #003366;
    margin-right: 0.6rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}
.fee-tab-title {
    font-size: 0.9rem;
    font-weight: 500;
    color: #003366;
    flex-grow: 1;
}
.fee-tab-price-inline {
    font-size: 0.9rem;
    font-weight: 600;
    color: #003366;
    margin-left: 0.5rem;
    flex-shrink: 0;
    align-self: center;
}
.fee-tab-right-container {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.fee-tab-action-button {
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    line-height: 1;
    cursor: pointer;
    align-self: flex-end;
    margin-left: 0.5rem;
    margin-bottom: 0.25rem; /* Space between bin and price */
}
.fee-tab-action-icon {
    font-size: 1rem;
    color: #888;
    transition: color 0.2s;
}
.fee-tab-action-button:hover .fee-tab-action-icon {
    color: #333;
}
.fee-tab-content {
    padding-top: 0.25rem;
}
.tuition-details {
    text-align: right;
    margin-top: 0.25rem;
}
.tuition-termly-price {
    font-size: 0.8rem;
    color: #475569;
}
.price-display-box {
    padding: 0.25rem 0;
    text-align: right;
}
.activities-controls-price-wrapper .price-display-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
.price-display-box .price-value {
    font-size: 1rem;
    font-weight: 600;
    color: #003366;
}
 .price-display-box .price-note {
    font-size: 0.75rem;
    color: #64748b;
 }

/* Number Incrementer for Activities */
.activities-controls-price-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.number-incrementer {
    display: flex;
    align-items: center;
    margin-right: 0.75rem;
}
.increment-btn {
    background-color: #003366;
    color: white;
    border: none;
    border-radius: 0.375rem;
    width: 28px;
    height: 28px;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    padding: 0;
}
.increment-btn:hover {
    background-color: #002244;
}
.activity-number-display {
    font-size: 1rem;
    font-weight: 500;
    color: #003366;
    padding: 0 0.3rem;
    min-width: 25px;
    text-align: center;
}

/* Child Subtotal */
.child-subtotal-area {
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px solid #e2e8f0;
}
.child-subtotal-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.child-subtotal-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #003366;
}
.child-subtotal-value {
    font-size: 1.4rem;
    font-weight: 700;
    color: #003366;
}

/* Add Child Column Placeholder */
.add-child-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px dashed #93c5fd;
    border-radius: 0.75rem;
    padding: 1rem 2rem;
    width: 100%;
    max-width: 350px;
    cursor: pointer;
    transition: border-color 0.2s ease-in-out;
    color: #3b82f6;
    background-color: #f9fafb;
    flex: 1 1 100%;
    order: 99;
}
.add-child-placeholder:hover {
    border-color: #3b82f6;
}
.add-child-icon {
    font-size: 3.75rem;
    color: #60a5fa;
    margin-bottom: 1rem;
}
.add-child-text {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Footer: No longer sticky */
.sticky-footer {
    position: relative;
    background-color: #003366;
    color: white;
    padding: 1rem;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    height: 0;
    overflow: hidden;
    transition: height 0.3s ease;
    margin-top: 2rem;
}

.sticky-footer.visible {
    height: auto;
}

.footer-content {
    display: none;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    padding: 20px 0;
    flex-direction: row;
    justify-content: space-between;
    width: 100%;
}

.footer-content.visible {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.footer-total-item {
    flex: 1;
    padding: 0 20px;
}

.footer-total-row {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 10px;
}

.footer-title {
    margin: 0;
    font-size: 1em;
    white-space: nowrap;
    font-weight: normal !important;
}

.footer-total-value {
    margin: 0;
    font-size: 1em;
    font-weight: normal;
}

.footer-monthly-value {
    margin: 0;
    font-size: 0.9em;
    color: white;
    padding-left: calc(20px + 1em); /* Same as the gap + label width */
}

.footer-disclaimer {
    text-align: center;
    font-size: 0.7em;
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.footer-disclaimer.visible {
    opacity: 1;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 1rem;
}
.modal-content {
    background-color: white;
    padding: 1.5rem;
    border-radius: 0.5rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.modal-title {
    font-size: 1.5rem;
    color: #003366;
}
.modal-close-btn {
    background: none;
    border: none;
    font-size: 1.75rem;
    cursor: pointer;
    color: #666;
}
.modal-close-btn:hover {
    color: #333;
}
.modal-body {
    padding: 0.5rem 0.25rem;
    overflow-y: auto;
    flex-grow: 1;
}
.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}
.modal-body input[type="text"] {
    width: 100%;
    padding: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    font-size: 1rem;
}
.datepicker-wrapper {
    position: relative;
}
.dob-input-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.dob-input-container input[type="text"] {
    flex-grow: 1;
    margin-bottom: 0;
}
.calendar-icon-btn {
    background: #003366;
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 1rem;
}
.calendar-icon-btn:hover {
    background: #002244;
}

/* Custom Datepicker Styles - Mobile First (Centered) */
.custom-datepicker {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    border: 1px solid #ccc;
    border-radius: 0.375rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.25);
    z-index: 1002; /* Above modal overlay */
    width: 280px;
    padding: 0.75rem;
}
.datepicker-header, .datepicker-month-year-selects {
    display: flex;
    align-items: center;
}
.datepicker-header {
    justify-content: space-between;
    margin-bottom: 0.75rem;
}
.datepicker-nav-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #003366;
    padding: 0.25rem 0.5rem;
}
.datepicker-nav-btn:hover {
    color: #002244;
}
.datepicker-month-year-selects {
    gap: 0.5rem;
    flex-grow: 1;
    justify-content: center;
}
.datepicker-month-year-selects select {
    padding: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 0.25rem;
    font-size: 0.9rem;
    background-color: white;
    cursor: pointer;
}
.datepicker-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    text-align: center;
}
.datepicker-day-name, .datepicker-day {
    padding: 0.4rem 0.2rem;
    font-size: 0.85rem;
}
.datepicker-day-name {
    font-weight: 600;
    color: #555;
}
.datepicker-day {
    cursor: pointer;
    border-radius: 0.25rem;
}
.datepicker-day:hover {
    background-color: #e0f7fa;
}
.datepicker-day.selected {
    background-color: #003366;
    color: white;
}
.datepicker-day.other-month {
    color: #ccc;
    cursor: default;
}
 .datepicker-day.other-month:hover {
    background-color: transparent;
}
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
    flex-shrink: 0;
}
.modal-button {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}
.modal-button.primary {
    background-color: #003366;
    color: white;
}
.modal-button.primary:hover {
    background-color: #002244;
}
.modal-button.secondary {
    background-color: #e2e8f0;
    color: #333;
}
.modal-button.secondary:hover {
    background-color: #cbd5e1;
}

/* Bus Map Modal Specific Styles */
.map-modal-content {
    max-width: 800px;
}
/* Map Container - Fixed height to ensure Leaflet renders */
#leaflet-map-container {
    height: 60vh; /* Responsive height */
    max-height: 370px; /* Max height for larger screens */
    width: 100%;
    border-radius: 0.375rem;
    border: 1px solid #ccc;
    margin-top: 0.5rem;
}
#selected-stop-info {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #f8fafc;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
}
.bus-selection-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
}
.bus-stop-info {
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    width: 100%;
}
.bus-stop-info .bus-stop-name {
    text-align: left;
}
.bus-stop-info .bus-price {
    text-align: right;
}

/* --- Responsive Adjustments for Larger Screens --- */

/* Small devices (landscape phones, 640px and up) */
@media (min-width: 640px) {
    .footer-content {
        display: grid;
        grid-template-areas:
            "title total"
            "title monthly";
        grid-template-columns: 1fr auto;
        align-items: baseline;
        row-gap: 0;
        column-gap: 1rem;
    }
    .footer-title {
        grid-area: title;
        justify-self: start;
        margin-bottom: 0;
        align-self: center;
    }
     .footer-total-value {
        grid-area: total;
        justify-self: end;
        text-align: right;
    }
    .footer-monthly-value {
        grid-area: monthly;
        justify-self: end;
        text-align: right;
    }
    .action-button {
        height: 120px;
    }
}

/* Medium devices (tablets, 830px and up) */
@media (min-width: 830px) {
    #leaflet-map-container
    {
        max-height: 450px;
    }

    .action-buttons-container
    {
        margin-bottom: 1.5rem;
    }
    main
    {
        padding-top: 1.5rem;
        padding-bottom: 1.5rem;
    }
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    header .header-title {
        font-size: 1.5rem;
    }
    header .logo-img {
        height: 40px;
        width: 60px;
    }
    .footer-title {
        font-size: 1.5rem;
    }
    .footer-total-value {
        font-size: 1.5rem;
    }
    .footer-monthly-value {
        font-size: 1rem;
    }
    .footer-total-item + .footer-total-item .footer-title {
        margin-left: auto;
    }
    /* Change to side-by-side layout for children */
    .child-columns-container {
        flex-direction: row;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .child-column {
        flex-basis: 320px; /* Reset basis for side-by-side */
    }
    .action-buttons-container {
        justify-content: flex-start; /* Align left on desktop */
    }
    /* Datepicker position for Desktop */
    .custom-datepicker {
        position: absolute;
        top: 100%; /* Position below the wrapper */
        left: 0;
        transform: none; /* Reset the transform */
        box-shadow: 0 2px 5px rgba(0,0,0,0.15);
    }
}

@media (max-width: 829px) {
    .footer-content {
        flex-direction: column;
        gap: 10px;
    }

    .footer-total-item {
        width: 100%;
    }

    .footer-total-row {
        justify-content: space-between;
    }

    .footer-monthly-value {
        text-align: right;
        margin-top: 5px;
    }
}

.enrollment-timing-container {
		display: flex;
		align-items: center;
		justify-content: center; /* Center items horizontally */
		margin-top: 0.75rem;
		padding: 0.5rem;
		border: 1px solid #e2e8f0;
		border-radius: 0.375rem;
		background-color: #f8fafc;
}


.enrollment-timing-label {
		font-size: 0.85rem;
		color: #333;
		transition: opacity 0.3s ease, color 0.3s ease, font-weight 0.3s ease; /* Added font-weight transition */
		padding: 0 0.5rem; /* Add some padding to labels */
        text-align: center;
}


.enrollment-timing-label.active {
		opacity: 1;
		font-weight: 600; /* Make active text bolder */
		color: #003366;
}


.enrollment-timing-label.inactive {
		opacity: 0.5; /* Dim inactive text more */
		font-weight: normal;
}


/* Basic Toggle Switch Styles */
.toggle-switch {
		position: relative;
		display: inline-block;
		width: 44px;
		height: 24px;
		margin: 0 0.5rem; /* Reduced margin slightly for better centering */
}


.toggle-switch input { /* Hide the default checkbox */
		opacity: 0;
		width: 0;
		height: 0;
		position: absolute; /* Take it out of flow */
}


.slider {
		position: absolute;
		cursor: pointer;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background-color: #ccc;
		transition: .4s;
}


.slider:before {
		position: absolute;
		content: "";
		height: 18px;
		width: 18px;
		left: 3px;
		bottom: 3px;
		background-color: white;
		transition: .4s;
}


input:checked + .slider {
		background-color: #003366; /* Wingate blue when checked */
}


input:focus + .slider { /* Optional: focus style for accessibility */
		box-shadow: 0 0 2px #003366;
}


input:checked + .slider:before {
		transform: translateX(20px); /* Moves the knob to the right */
}


/* Rounded sliders */
.slider.round {
		border-radius: 34px;
}


.slider.round:before {
		border-radius: 50%;
}

.fee-tab-item[data-fee-id="meals"] .fee-tab-title {
    margin-bottom: 2px;
}
.fee-tab-monthly-price {
    color: #888;
    font-size: 0.85em;
    font-weight: normal;
}
.fee-tab-item[data-fee-id="meals"] .fee-tab-right-container {
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
}
.fee-tab-item[data-fee-id="meals"] .fee-tab-action-button {
    padding: 0;
    margin-top: 4px;
    line-height: 1;
}

.intro-text {
    margin: 2rem auto;
    padding: 2rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    text-align: center;
    color: #003366;
    line-height: 1.6;
    font-size: 1.1rem;
}

.intro-text p {
    margin: 0;
}

@media (max-width: 829px) {
    .intro-text {
        margin: 1rem;
        padding: 1.5rem;
        font-size: 1rem;
    }
}

.fees-section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #003366;
    margin-bottom: 2px;
}

.fees-section-description {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: .4rem;
    line-height: 1.4;
}

.fee-tab-title sup {
    font-size: 0.8em;
    vertical-align: super;
    color: #333;
}

.footnote-section {
    margin-top: .7rem;
    padding-top: 0.5rem;
    border-top: 1px solid #e2e8f0;
}

.footnote {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
    margin: 0;
}

.footnote sup {
    font-size: 0.7em;
    vertical-align: super;
    color: #666;
}

.footnote-link {
    color: #003366;
    text-decoration: none;
    border-bottom: 1px dotted #003366;
    transition: border-bottom-style 0.2s;
}

.footnote-link:hover {
    border-bottom-style: solid;
}