:root {
    --primary-navy: #072ac8;
    --primary-yellow: #ffc600;
    --primary-blue: #1e96fc;
    --background: #f7f7f7;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Ubuntu";
}
html {
    scroll-behavior: smooth;
}
/* Basic Reset & Body Styles (adjust if needed for your overall site) */
body {
    font-family: "Ubuntu", sans-serif; /* A more modern font */
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Your existing navigation bar styles go here */

.course-page-content {
    max-width: 1200px;
    margin: 60px auto;
    padding: 0 25px;
}

.course-section {
    display: flex;
    flex-direction: column;

    border-radius: 16px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.07);
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
}

.course-section:hover {
    transform: translateY(-5px);
}

/* Image Container */
.course-image-container {
    flex: 1;
    padding: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: transparent;
    min-height: 300px;
    position: relative;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    overflow: hidden;
}

.course-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50px;
    border: 3px solid var(--primary-blue);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.6s ease-out, box-shadow 0.6s ease-out,
        border-color 0.3s ease-out;
}

/* Image hover interaction */
.course-image-container:hover .course-image {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border-color: var(--primary-yellow);
}

/* Course Details */
.course-details {
    flex: 1.5;
    padding: 45px;
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.course-name {
    font-size: 2.8em;
    color: var(--primary-navy);
    margin-bottom: 0;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.course-description {
    font-size: 1.15em;
    color: var(--primary-navy);
    margin-bottom: 0;
    line-height: 1.7;
    max-height: 150px; /* Still useful for initial description limit */
    overflow-y: auto;
    padding-right: 15px;
    scrollbar-width: thin;
    scrollbar-color: #007bff transparent; /* Firefox scrollbar colors */
}

/* Webkit scrollbar styling for description */
.course-description::-webkit-scrollbar {
    width: 8px;
}

.course-description::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.course-description::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 4px;
}

.course-description::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

/* Course Navigation (Tabs) */
.course-navigation {
    display: flex;
    gap: 20px;
    margin-bottom: 0;
    border-bottom: 2px solid var(--primary-yellow);
    padding-bottom: 12px;
}

.nav-button {
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 1.1em;
    font-weight: 600;
    color: var(--primary-blue);
    cursor: pointer;
    position: relative;
    transition: color 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.nav-button::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 0;
    height: 3px;
    background-color: var(--primary-yellow);
    border-radius: 2px;
    transition: width 0.3s ease-in-out;
}

.nav-button.active {
    color: var(--primary-yellow);
    transform: translateY(-2px);
}

.nav-button.active::after {
    width: 100%;
}

.nav-button:hover:not(.active) {
    color: #0056b3;
    transform: translateY(-1px);
}

/* Course Content Panels */
.course-content {
    background-color: transparent;
    border-radius: 10px;
    padding: 25px;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.03);
    margin-top: 0; /* Default for small screens */
    /* Mobile specific: still allow scrolling here if it gets too big */
    max-height: 170px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #007bff transparent; /* Firefox scrollbar colors */
}

.content-panel {
    display: none;
    font-size: 1em;
    color: var(--primary-blue);
    line-height: 1.8;
    animation: fadeInSlideUp 0.6s ease-out;
    height: auto; /* Default for mobile */
    overflow-y: visible; /* Default for mobile */
    padding-right: 0; /* Default for mobile */
}

/* Webkit scrollbar styling for content panels */
.content-panel::-webkit-scrollbar {
    width: 8px;
}

.content-panel::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 4px;
}

.content-panel::-webkit-scrollbar-thumb {
    background: #007bff;
    border-radius: 4px;
}

.content-panel::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

.content-panel.active {
    display: block;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.content-panel ul {
    list-style: none;
    padding: 0;
    margin: 15px 0 0 0;
}

.content-panel ul li {
    margin-bottom: 12px;
    padding-left: 25px;
    position: relative;
}

.content-panel ul li::before {
    content: "✓";
    color: var(--primary-blue);
    font-weight: bold;
    position: absolute;
    left: 0;
    top: 0;
}

/*
|--------------------------------------------------------------------------
| Responsive Design (Desktop Specific Rules)
|--------------------------------------------------------------------------
|
| These rules apply when the screen width is 768px or greater.
|
*/
@media (min-width: 768px) {
    .course-section {
        flex-direction: row;
        gap: 30px;
        align-items: flex-start;
        /* **CRUCIAL NEW ADDITION:** Make the course-section itself a flex item that doesn't grow beyond content */
        /*
           By default, flex containers might stretch if their children are flex-grow.
           Setting an explicit height on .course-image-container and then ensuring
           .course-section itself doesn't stretch beyond that is key.
           If the image container has a fixed height, the section's height will be driven by it.
        */
    }

    .course-image-container {
        border-top-right-radius: 0;
        border-bottom-left-radius: 16px;
        /* **CRUCIAL CHANGE:** Define a fixed height for the image container on desktop. */
        /* This height will dictate the maximum height of the entire .course-section. */
        height: 550px; /* Adjust this value to your desired fixed image frame height */
        min-height: auto; /* Override default min-height for desktop */
    }

    .course-details {
        /* **CRUCIAL CHANGE:** Make this flex column take up the full height of its parent (.course-section) */
        height: 100%;
        /* Change padding to correctly distribute space when height is constrained */
        padding-top: 40px;
        padding-bottom: 40px;
        padding-right: 45px;
        padding-left: 0; /* No left padding as gap handles it */

        /* Override mobile gap, use margins for vertical spacing */
        gap: 0;
        /* **CRUCIAL:** Enable column flex for internal scrolling setup */
        display: flex;
        flex-direction: column;
        /* **CRUCIAL:** Add overflow hidden to the .course-details column itself */
        /* This prevents its content from pushing the parent .course-section taller */
        overflow: hidden;
    }

    /* Apply consistent margin-bottom for all direct children of .course-details except the last one */
    .course-details > *:not(:last-child) {
        margin-bottom: 25px;
    }

    /* Override for .course-description - keep its own scroll if needed */
    .course-description {
        flex-shrink: 0; /* Prevents description from shrinking too much */
        /* max-height could be set here relative to the overall height, or let it grow if short */
        /* For now, keep its own scrolling as it might be short */
        max-height: 120px; /* Adjust as needed */
        overflow-y: auto;
    }

    /* Course Content (tabbed area) */
    .course-content {
        flex-grow: 1; /* Make it take up all remaining space */
        min-height: 0; /* Essential for flex items with overflow */
        overflow-y: auto; /* Add scroll if its content overflows */
        /* Ensure its padding is handled internally, not from outside */
        padding-right: 15px; /* For scrollbar */
        margin-top: 0; /* No external margin-top for flex items, rely on parent gap/margins */
    }

    /* Ensure content-panel also takes full height for internal scrolling */
    .content-panel {
        height: 100%; /* Makes content panel fill its parent (.course-content) */
        overflow-y: auto; /* Add scrollbar to the panel itself */
        padding-right: 15px; /* Padding for scrollbar within content-panel */
    }

    /* Remove padding from content-panel if it's already on .course-content */
    .course-content > .content-panel {
        padding: 0; /* Remove padding if .course-content already has it */
    }

    /* Adjust scrollbar padding inside content-panel */
    .content-panel p,
    .content-panel ul {
        padding-right: 15px; /* Apply padding to content inside content-panel for scrollbar */
    }
}

/*
|--------------------------------------------------------------------------
| Mobile Specific Rules (Max-width 767px)
|--------------------------------------------------------------------------
|
| These rules apply when the screen width is less than 768px.
|
*/
@media (max-width: 767px) {
    .course-details {
        padding: 30px;
    }

    .course-name {
        font-size: 2.2em;
    }

    .course-navigation {
        flex-direction: column;
        gap: 10px;
    }

    .nav-button {
        width: 100%;
        text-align: center;
        padding: 12px 0;
    }

    .nav-button::after {
        left: 50%;
        transform: translateX(-50%);
    }

    /* Reset desktop-specific heights for mobile */
    .course-image-container {
        height: auto;
    }

    .course-details {
        height: auto;
        gap: 25px; /* Re-enable gap for mobile */
    }
    .course-details > *:not(:last-child) {
        margin-bottom: 0; /* Remove desktop margins for mobile */
    }
    .course-content {
        height: auto;
        padding-right: 25px; /* Re-apply initial padding for mobile */
    }
    .content-panel {
        height: auto;
        overflow-y: visible;
        padding-right: 0;
    }
    .content-panel p,
    .content-panel ul {
        padding-right: 0;
    }
}

/* All previous CSS from previous interactions goes here */

/* --- Available Classes Section --- */

.available-classes-section {
    max-width: 1200px;
    margin: 80px auto;
    padding: 0 25px;
}

.section-header {
    font-size: 2.5em;
    color: var(--primary-yellow);
    text-align: center;
    margin-bottom: 50px;
    font-weight: 700;
}

.class-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 35px;
}

.class-card {
      max-width: 300px;
    /*background-color: #ffffff; */
    border-radius: 12px;
    /* box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08); */
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 450px;
    
}



/* New Image Frame Styling */
.class-image-frame {
    width: 100%;
    height: 280px;
    display: flex;
    justify-content: center;
    align-items: center;
    /* background-color: #eaf2ff; */
    /* border-bottom: 1px solid #dee2e6; */
    overflow: hidden;
    position: relative;
    /* box-shadow: inset 0 -3px 8px rgba(0, 0, 0, 0.05);*/
}

.class-image {
    width: 100%;
    height: 90%;
    object-fit: fill;
    border-radius: 50px;
    border: 3px solid var(--primary-yellow);
    transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

/* Card Content Area */
.class-card-content {
    flex-grow: 1; /* Allows this content area to take remaining height */
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 15px; /* Padding for the entire content area */
    overflow-y: auto; /* Enable scrolling for content if it overflows */
    padding-bottom: 10px; /* Adjust bottom padding for scrollbar visibility */
    /* Custom scrollbar styling */
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: var(--primary-blue) transparent; /* Firefox */
}

/* Webkit scrollbar styling */
.class-card-content::-webkit-scrollbar {
    width: 6px;
}

.class-card-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.class-card-content::-webkit-scrollbar-thumb {
    background: var(--primary-blue);
    border-radius: 3px;
}

.class-card-content::-webkit-scrollbar-thumb:hover {
    background: var(--primary-blue);
}

.class-card .class-name {
    font-size: 1.1em;
    color: var(--primary-navy);
    margin-bottom: 8px; /* Reduced margin due to padding on parent */
    font-weight: 600;
    line-height: 1.3; /* Adjust line height for multi-line titles */
}

.class-card .class-dates {
    font-size: 0.95em;
    color: var(--primary-navy);
    margin-bottom: 4px; /* Reduced margin */
}

.register-button {
    border: 3pc solid var(--primary-yellow);
    background-color: #007bff;
    color: #ffffff;
    border: none;
    border-radius: 50px;
    padding: 12px 25px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease-in-out, transform 0.2s ease-in-out;
    margin-top: auto; /* Push button to the bottom using flexbox */
}

.register-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}
/* From Uiverse.io by gharsh11032000 */ 
.button {
  cursor: pointer;
  position: relative;
  padding: 10px 24px;
  font-size: 18px;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
  border-radius: 34px;
  background-color: transparent;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.23, 1, 0.320, 1);
  overflow: hidden;
  margin-top: auto;
}

.button::before {
  content: '';
  position: absolute;
  inset: 0;
  margin: auto;
  width: 50px;
  height: 50px;
  border-radius: inherit;
  scale: 0;
  z-index: -1;
  background-color:var(--primary-blue);
  transition: all 0.6s cubic-bezier(0.23, 1, 0.320, 1);
}

.button:hover::before {
  scale: 7;
}

.button:hover {
  color: var(--background);


}




/* --- Responsive Adjustments for Available Classes --- */
@media (max-width: 992px) {
    .class-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 767px) {
    .section-header {
        font-size: 2em;
        margin-bottom: 30px;
    }

    .class-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .class-card {
        height: auto; /* Allow height to be dynamic on mobile */
        padding-bottom: 20px;
    }

    .class-card-content {
        overflow-y: visible; /* Disable scroll on mobile if card height is auto */
    }
}
