:root {
    --primary-color: #1F1C4E; /* Navy-ish (for header, footer, etc.) */
    --secondary-color: #2E3058; /* Accent color (for buttons, links) */
    --background-color: #f8f9fa;
    --text-color: #2f2f2f;
    --btn-text-color: #FFFFFF;
    --heading-font: 'Montserrat', sans-serif;
    --body-font: 'Roboto', sans-serif;
    /* Alias to support --color-primary requests */
    --color-primary: var(--primary-color);
}

/* 2. Global Styles */
body {
    font-family: var(--body-font, 'Roboto', sans-serif), serif;
    background-color: var(--background-color);
    color: var(--text-color);
    padding-top: 76px; /* Navbar height + Padding */
}

/* Headings */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--heading-font, 'Montserrat', sans-serif), sans-serif;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* Main Content Container */
.main-content {
    width: 100%;
}

/* Login Form Styles */
.login {
    width: 100%;
    max-width: 360px;
    margin: 25px auto 0;
    box-shadow: rgba(0, 0, 0, 0.24) 0 3px 8px;
    text-align: center;
    padding: 1em;
}

.login img {
    max-width: 75px;
    max-height: 75px;
    margin-bottom: 25px;
}

.login input {
    outline: 0;
    background: #e7e4e4;
    width: 100%;
    border: 0;
    margin-bottom: 15px;
    padding: 5px;
    box-sizing: border-box;
    font-size: 14px;
}

.login button {
    font-family: "Lato", sans-serif;
    text-transform: uppercase;
    outline: 0;
    background: var(--secondary-color);
    width: 100%;
    border: 0;
    padding: 15px;
    color: #FFFFFF;
    font-size: 14px;
}

.login button:hover,
.form button:active,
.form button:focus {
    background: var(--primary-color);
}

/* Footer Styles */
.footer {
    margin-top: 1em;
    font-size: 0.75em;
    padding: 15px;
    width: 100%;
    text-align: center;
}

.footer a {
    text-decoration: none;
}

/* Site footer refinements */
.site-footer a {
    text-decoration: none;
}
.site-footer a:hover {
    text-decoration: underline;
}

/* Error Styles */
.errorlist {
    color: #bd512f !important;
}

.error input,
.error select {
    border: 2px solid red;
}

/* Help Text Styles */
.helptext {
    list-style-type: none;
    font-size: 0.75em;
    color: rgba(63, 63, 63, 0.59) !important;
}

.helptext li {
    list-style-type: none;
}

/* Cleaned Up CSS Below */

/* Links */
a {
    color: var(--primary-color);
}

/* Accordion Button Styles */
.accordion-button.collapsed .bi-chevron-up {
    transform: rotate(180deg);
}

.accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.accordion-button.collapsed::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23fff'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
}

.bi-chevron-up {
    transition: 0.5s transform ease-in-out;
}

/* Bootstrap Button Overrides */
.btn.btn-primary {
    background: var(--primary-color) !important;
    color: var(--btn-text-color);
}

.btn.btn-outline-primary {
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn.btn-outline-primary:hover {
    color: var(--btn-text-color);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Bootstrap Background Color Overrides */
.bg-primary {
    background-color: var(--primary-color) !important;
}

/* Status background colors */
.bg-light-success {
    background-color: rgba(25, 135, 84, 0.15) !important;
}

.bg-light-warning {
    background-color: rgba(255, 193, 7, 0.15) !important;
}

.bg-light-info {
    background-color: rgba(13, 202, 240, 0.15) !important;
}

/* Container Button Styles */
.container button:not(.btn-close) {
    width: 100%;
}

/* Container Button Styles */
.accordion-header button:not(.btn-close) {
    outline: 0;
    width: 100%;
    border: 0;
    background: var(--secondary-color);
    color: var(--btn-text-color);
}

.accordion-header button:not(.collapsed) {
    background: var(--primary-color);
    color: var(--btn-text-color);
}


/* Classes Layout Styles */
.classes-container {
    min-height: 100dvh;
}

.classes-layout {
    display: flex;
    min-height: calc(100dvh - 200px);
}

/* Filter Sidebar */
.filters-sidebar {
    width: 350px;
    min-width: 350px;
    border-right: 1px solid #dee2e6;
    position: sticky;
    top: 0;
    height: 100dvh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    z-index: 50;
}

.filters-content {
    padding: 1.5rem;
}

.filter-group {
    margin-bottom: 0.5rem;
}

.filter-group .form-label {
    font-weight: 600;
}

.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
    border-radius: 25px;
    padding: 0.75rem 1.25rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

.mobile-filter-toggle i {
    font-size: 1rem;
    margin-left: 0.5rem;
}

.classes-header {
    padding-left: 1rem;
    padding-right: 1rem;
    margin-bottom: 0;
    display: block;
}

/* Classes Content */
.classes-content {
    flex: 1;
    padding: 2rem;
    overflow: visible;
    max-height: none;
}

/* Class Cards */
.class-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: none;
    overflow: hidden;
}

.actions {
    width: 100%;
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin-top: .5rem
}

.actions .btn {
    flex: 1;
}

.no-click {
    pointer-events: none;
}

.card-img-container {
    position: relative;
    height: 160px;
    overflow: hidden;
}

.card-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.class-card:hover .card-img-container img {
    transform: scale(1.05);
}

.card-img-overlay-info {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
}

.class-details {
    line-height: 1.6;
}

.class-schedule {
    border-left: 3px solid var(--primary-color, #007bff);
    background: rgba(0, 123, 255, 0.05);
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
}

.enrollment-status .badge {
    font-size: 0.85rem;
}

/* Mobile Responsive */
@media (max-width: 767.98px) {
    .classes-layout {
        flex-direction: column;
        min-height: auto; /* Let body handle the scroll on mobile */
    }

    .filters-sidebar {
        width: 100%;
        min-width: unset;
        height: auto;
        max-height: 80vh;
        position: fixed;
        top: 0;
        left: -100%;
        background: white;
        border-right: none;
        border-bottom: 1px solid #dee2e6;
        transition: left 0.3s ease;
        z-index: 1050;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }

    .filters-sidebar.show {
        left: 0;
    }

    .mobile-filter-toggle {
        display: block;
    }

    .classes-header {
        padding-left: 1rem;
        padding-right: 1rem;
        text-align: center;
    }

    .classes-content {
        padding: 1rem;
        overflow-y: visible;      /* Disable inner scroll on mobile */
        max-height: none;         /* Let content flow */
    }

    .card-img-container {
        height: 140px;
    }
}

/* Tablet adjustments */
@media (min-width: 768px) and (max-width: 991.98px) {
    .filters-sidebar {
        width: 280px;
        min-width: 280px;
    }

    .classes-content {
        padding: 1.5rem;
    }
}

/* Empty state */
.text-center .display-1 {
    font-size: 4rem;
    opacity: 0.3;
}

.container h2 {
    margin-top: 0;
    padding: 10px;
}

/* Enrollment and Registration Styles */
.enroll {
    max-width: 750px;
}

.enroll input {
    outline: 0;
}

.register {
    margin: auto;
    width: 90%;
    max-width: 500px;
    padding: 1em;
}

.registration {
    /*position: relative;*/
    /*background: #FFFFFF;*/
    text-align: center;
    padding: 1em;
    margin: 0 auto;
    max-width: 750px;
}

/* List Reset in Containers */
/* Add primary-color dots to UL/LI items */
.style-ul ul li {
    position: relative;
    padding-left: 1.2em;
}

.style-ul ul li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 0.5em;
    height: 0.5em;
    border-radius: 50%;
    background-color: var(--primary-color);
}

/* Style ordered lists consistently */
.container ol li {
    position: relative;
    padding-left: 0.5em;
    margin-left: 1em;
}

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000; /* Ensures navbar stays above other content */
    background-color: var(--background-color); /* Ensures visibility */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Optional shadow for depth */
}

.navbar-toggler {
    margin-right: 0.5em;
}

/* Ensure the profile icon and navbar-toggler stay on the right */
.navbar .d-flex {
    margin-left: auto;
}

.navbar-brand {
    margin-left: 1em;
    display: flex;
    align-items: center;
    height: 40px;
}

.navbar-logo {
    height: 37px;
}

.nav-link.active {
    background-color: var(--secondary-color);
    color: var(--btn-text-color) !important;
    border-radius: 4px;
}

/* Custom Hover Effect for Buttons */
.btn-custom {
    color: #212529; /* Neutral text color */
    background-color: #f8f9fa; /* Light background */
    border: 2px solid #dee2e6; /* Subtle border */
    transition: all 0.2s ease-in-out; /* Smooth transition */
}

.btn-custom:hover {
    color: var(--btn-text-color); /* Text changes to white */
    background-color: var(--secondary-color); /* Blue background */
    border-color: var(--primary-color); /* Blue border */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

/* Small Button Adjustments */
.btn-sm {
    white-space: nowrap;
}

/* Button Active State Overrides */
/* General button active state */
.btn-check:checked + .btn,
.btn.active,
.btn.show,
.btn:first-child:active,
:not(.btn-check) + .btn:active {
    color: var(--btn-text-color);
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.time-block {
    border-left: 4px solid var(--secondary-color);
    padding-left: 15px;
    margin-bottom: 20px;
}

.time-header {
    color: var(--secondary-color);
    font-weight: bold;
    margin-bottom: 10px;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
}

/* Profile Circle Icon */
.profile-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: var(--btn-text-color);
    font-weight: bold;
    font-size: 16px;
    text-transform: uppercase;
}

/* Tab Content Styles */
.tab-content {
    padding: 2px;
    border-top: 0;
    border-radius: 0 0 0.25rem 0.25rem;
}

/* Profile Tabs Styling */
#profileTabs .nav-link {
    color: var(--text-color);
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
}

#profileTabs .nav-link:hover {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

#profileTabs .nav-link.active {
    color: var(--btn-text-color);
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: bold;
}

/* Logout Button */
.logout-btn {
    margin-top: 20px;
    width: 100%;
}

/* Bootstrap Icons - Circle Fill */
.bi[class*="-circle-fill"] {
    color: var(--primary-color);
}

.btn {
    transition: transform 0.1s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
    "important"
    "menu"
    "placeholder";
    gap: 1.5rem;
}

.dashboard-grid > .area-important {
    grid-area: important;
}

.dashboard-grid > .area-menu {
    grid-area: menu;
}

.dashboard-grid > .area-placeholder {
    grid-area: placeholder;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        grid-template-areas:
      "menu important"
      "menu placeholder";
    }

    .dashboard-grid > .area-menu {
        display: flex;
        align-items: center;
        justify-content: center;
    }
}


/* Utilities: Brand helpers */
/* Text color using brand primary CSS variable */
.text-brand {
    color: var(--color-primary) !important;
}

/* Icon-only action buttons (e.g., edit/remove in Children tab) */
.icon-btn {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    width: auto !important;
    line-height: 1;
}
.icon-btn:focus,
.icon-btn:active {
    outline: none !important;
    box-shadow: none !important;
}
/* Override broad container rule for icon buttons */
.container button.icon-btn:not(.btn-close) {
    width: auto !important;
}
/* Make sure the icon image isn't stretched and doesn't add extra spacing */
.icon-btn img {
    display: block;
}

/* Consistent enhancement for outline buttons used on About page */
.btn.info-btn {
    border-radius: 999px;
    font-weight: 600;
}
.btn-outline-primary.info-btn {
    color: var(--primary-color);
    border-color: var(--primary-color);
}
.btn-outline-primary.info-btn:hover {
    color: var(--btn-text-color);
    background-color: var(--primary-color);
}
.btn-outline-secondary.info-btn {
    color: #495057;
    border-color: #adb5bd;
}
.btn-outline-secondary.info-btn:hover {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}
