/* CSS remains identical to the original provided */
:root {
    --primary-color: #00ff00; /* Neon Green */
    --secondary-color: #ffffff;
    --background-color: #000000;
    --text-color: #e0e0e0;
    --card-background: rgba(15, 15, 15, 0.85);
    --border-color: #22ff22;
    --header-height: 70px; /* Base height, JS adjusts body padding */
    --font-body: 'Roboto', sans-serif;
    --font-heading: 'Orbitron', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }

body {
    font-family: var(--font-body);
    background-color: var(--background-color);
    color: var(--text-color);
    background-image: url('https://rahulhackz.in/images/background.webp'); /* Consider optimizing this image */
    background-attachment: fixed;
    padding-top: var(--header-height); /* Initial padding, JS updates */
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}
body::before {
    content: ""; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(rgba(0,0,0,0.85), rgba(0,0,0,0.95)),
                url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 50 50"><path fill="%23080808" fill-opacity="0.3" d="M0 50 L50 0 H25 L0 25 Z M50 50 V25 L25 50 Z"></path></svg>');
    z-index: -1; opacity: 0.6;
}

/* --- Header --- */
header {
    display: flex; justify-content: space-between; align-items: center;
    background-color: var(--primary-color); color: var(--background-color);
    padding: 0 2rem; min-height: var(--header-height);
    box-shadow: 0 4px 15px rgba(0, 255, 0, 0.4);
    position: fixed; width: 100%; top: 0; left: 0; z-index: 1000;
    transition: background-color 0.3s ease; flex-wrap: wrap;
}
header:hover { background-color: #00cc00; }
header .site-title a {
    font-family: var(--font-heading); font-size: clamp(1.3rem, 4vw, 1.6rem);
    font-weight: 700; white-space: nowrap; color: var(--background-color);
    text-decoration: none; padding: 10px 0;
}
header nav.actions { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; padding: 10px 0; }
header .actions a {
    padding: 0.6rem 1.2rem; border-radius: 5px; font-size: 0.95rem; font-weight: 700;
    text-decoration: none; text-align: center; transition: all 0.3s ease;
    border: 2px solid transparent; white-space: nowrap; display: inline-block;
}
header .actions a.join-now {
    background-color: var(--background-color); color: var(--primary-color); border-color: var(--background-color);
}
header .actions a.join-now:hover {
    background-color: #222; border-color: #222; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}
header .actions a:not(.join-now) { background-color: transparent; color: var(--background-color); border: 2px solid var(--background-color); }
header .actions a:not(.join-now):hover { background-color: var(--background-color); color: var(--primary-color); transform: translateY(-2px); }

/* --- Main Content Area --- */
main { padding: 0 1rem; flex-grow: 1; width: 100%; margin: 0 auto; }

/* --- Hero / Intro Section --- */
.intro-section {
    background-color: rgba(0, 0, 0, 0.8); border: 1px solid var(--border-color); border-radius: 8px;
    padding: clamp(1.5rem, 5vw, 2.5rem); margin: 2rem auto; max-width: 1000px; text-align: center;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}
.intro-section .main-heading { /* H1 */
    font-family: var(--font-heading); color: var(--primary-color); font-size: clamp(2rem, 6vw, 3rem);
    margin-bottom: 0.5rem; text-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}
.intro-section .sub-heading { /* H2 */
    color: var(--secondary-color); font-size: clamp(1.2rem, 4vw, 1.8rem); margin-bottom: 1.5rem; font-weight: 400;
}
.intro-section p { color: var(--text-color); font-size: 1rem; margin-bottom: 1.5rem; line-height: 1.7; }
.intro-section p strong { color: var(--primary-color); font-weight: 700; }
.intro-section a:not(.join-button) { color: var(--primary-color); text-decoration: none; border-bottom: 1px dashed var(--primary-color); transition: color 0.3s ease, border-bottom-color 0.3s ease; }
.intro-section a:not(.join-button):hover { color: var(--secondary-color); border-bottom-color: var(--secondary-color); }
.intro-section .join-button {
    display: inline-block; padding: 0.8rem 2rem; border-radius: 5px; font-size: 1.3rem; text-decoration: none;
    font-weight: 700; background-color: var(--primary-color); color: var(--background-color);
    border: 2px solid var(--primary-color); transition: all 0.3s ease; margin-top: 1rem;
    box-shadow: 0 0 15px rgba(0, 255, 0, 0.4);
}
.intro-section .join-button:hover { background-color: var(--background-color); color: var(--primary-color); transform: scale(1.05); box-shadow: 0 0 25px rgba(0, 255, 0, 0.6); }

/* --- Search Box --- */
.search-box { padding: 1rem 1rem 2rem 1rem; text-align: center; }
.search-input {
    padding: 0.8rem 1.2rem; width: clamp(280px, 60%, 600px); border: 2px solid var(--border-color); border-radius: 25px;
    background-color: rgba(10, 10, 10, 0.9); color: var(--secondary-color); font-size: 1.1rem; transition: all 0.3s ease;
}
.search-input::placeholder { color: #888; }
.search-input:focus { outline: none; border-color: var(--primary-color); box-shadow: 0 0 15px rgba(0, 255, 0, 0.5); background-color: rgba(0, 0, 0, 0.95); }

/* --- Course Catalog --- */
#course-catalog { padding: 0; width: 100%; }
.category-section-wrapper { margin-bottom: 3rem; width: 100%; padding: 0; }
.category-title, .subcategory-title { padding-left: 1rem; padding-right: 1rem; }
.category-title { /* H2 */
    font-family: var(--font-heading); color: var(--primary-color); margin-bottom: 1.5rem; padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-color); text-align: left; font-size: clamp(1.6rem, 4.5vw, 2.2rem);
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.3);
}
.subcategory-title { /* H3 */
    font-size: clamp(1.3rem, 3.5vw, 1.8rem); margin-top: 2rem; margin-bottom: 1rem; color: #aaf0aa;
    border-bottom: 1px dashed #6f866f; padding-bottom: 0.3rem;
}

/* --- Carousel Styling (Seamless) --- */
.carousel-container {
    overflow: hidden; position: relative; width: 100%; padding: 10px 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}
.carousel-track {
    display: flex;
    width: max-content;
    will-change: transform;
    animation-duration: 15s; /* Example: Slower speed */
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    animation-play-state: running;
}
.carousel-track.scroll-left { animation-name: scroll-left-seamless; }
.carousel-track.scroll-right { animation-name: scroll-right-seamless; }
.carousel-container:hover .carousel-track { animation-play-state: paused; }

@keyframes scroll-left-seamless {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}
@keyframes scroll-right-seamless {
    0% { transform: translateX(-50%); }
    100% { transform: translateX(0%); }
}

/* --- Course Item Styling (Inside Carousel) --- */
.course-item { /* Article */
    background: var(--card-background); border: 1px solid var(--border-color); padding: 1.5rem; border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 255, 0, 0.1); margin: 0 10px; /* Spacing */
    width: 300px; /* Fixed width */ flex-shrink: 0; /* Prevent shrinking */
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    cursor: pointer; display: flex; flex-direction: column; justify-content: space-between;
    min-height: 280px; overflow: hidden; position: relative;
}
.course-item:hover {
    transform: translateY(-5px) scale(1.02); box-shadow: 0 8px 20px rgba(0, 255, 0, 0.3);
    border-color: var(--primary-color); z-index: 10;
}
.course-item .course-title { /* H3 */
    color: var(--primary-color); font-size: 1.2rem; font-weight: 700; margin-bottom: 0.8rem;
    line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis; min-height: 2.6em;
}
.course-item .course-summary { /* P */
    color: var(--text-color); font-size: 0.9rem; margin-bottom: 1rem; flex-grow: 1;
    display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical;
    overflow: hidden; text-overflow: ellipsis;
}
.view-info-button {
    padding: 0.6rem 1rem; background-color: var(--primary-color); color: var(--background-color);
    border: none; border-radius: 5px; cursor: pointer; text-decoration: none;
    transition: background-color 0.3s, transform 0.2s; font-size: 1rem; font-weight: 700;
    align-self: flex-start; margin-top: auto; /* Push to bottom */
}
.view-info-button:hover { background-color: #00cc00; transform: scale(1.05); }

/* --- Popup --- */
.popup {
    display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.92);
    justify-content: center; align-items: center; z-index: 2000; opacity: 0;
    transition: opacity 0.3s ease-in-out; padding: 1rem;
}
.popup.show { display: flex; opacity: 1; }
.popup-content {
    background: var(--background-color); border: 2px solid var(--primary-color);
    padding: clamp(1.5rem, 4vw, 2.5rem); border-radius: 10px; width: 95%; max-width: 900px;
    position: relative; max-height: 90vh; overflow-y: auto;
    box-shadow: 0 0 35px rgba(0, 255, 0, 0.6);
    transform: scale(0.95) translateY(-20px); transition: transform 0.3s ease-out, opacity 0.3s ease-out;
    scrollbar-width: thin; scrollbar-color: var(--primary-color) #222;
}
.popup.show .popup-content { transform: scale(1) translateY(0); opacity: 1; }
.popup-content::-webkit-scrollbar { width: 8px; }
.popup-content::-webkit-scrollbar-track { background: #1a1a1a; border-radius: 4px; }
.popup-content::-webkit-scrollbar-thumb { background-color: var(--primary-color); border-radius: 4px; border: 1px solid #111; }

#popup-title { /* H2 */
    font-family: var(--font-heading); color: var(--primary-color); margin-bottom: 1rem;
    font-size: clamp(1.5rem, 5vw, 2rem); text-shadow: 0 0 5px rgba(0, 255, 0, 0.4); line-height: 1.3;
}
#popup-summary { /* P */
    color: var(--text-color); margin-bottom: 1.5rem; font-size: 1rem; line-height: 1.7;
}
#popup-price { /* SPAN */
    color: var(--secondary-color); font-size: 1.3em; font-weight: bold; margin-bottom: 1.5rem;
    border: 1px dashed var(--border-color); padding: 0.5rem 1rem; display: inline-block;
    border-radius: 5px; background: rgba(0, 255, 0, 0.1);
}
#popup-price strong { color: var(--primary-color); }

.popup-actions { display: flex; gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap; }
.enroll-button, .popup-close-button {
    padding: 0.7rem 1.5rem; border-radius: 5px; text-decoration: none; transition: all 0.3s ease;
    font-weight: 700; font-size: 1.1rem; cursor: pointer; text-align: center; border: 2px solid transparent;
}
.enroll-button {
    background-color: var(--primary-color); color: var(--background-color); border-color: var(--primary-color); flex-grow: 1;
}
.enroll-button:hover { background-color: #00cc00; border-color: #00cc00; transform: scale(1.03); box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); }
.popup-close-button {
    background-color: #555; color: #fff; border-color: #555; position: absolute; top: 15px; right: 15px;
    font-size: 1.5rem; padding: 0.2rem 0.8rem; line-height: 1; z-index: 2010;
}
.popup-close-button:hover { background-color: #777; border-color: #777; transform: rotate(90deg); }

/* --- Course Curriculum in Popup --- */
#popup-curriculum {
    margin-top: 2rem; border: 1px solid #333; border-radius: 8px; padding: 1rem; background: rgba(10, 10, 10, 0.5);
}
#popup-curriculum > .syllabus-title { /* H3 */
    color: var(--secondary-color); font-family: var(--font-heading); margin-bottom: 1.5rem;
    font-size: 1.5rem; padding-bottom: 0.5rem; border-bottom: 1px solid #444;
}
.module {
    margin-bottom: 1rem; border: 1px solid #444; border-radius: 5px; background: #1a1a1a; overflow: hidden;
    transition: box-shadow 0.3s ease;
}
.module:last-child { margin-bottom: 0; }
.module:hover { box-shadow: 0 0 10px rgba(0, 255, 0, 0.2); }

.module-title {
    font-weight: bold; background: #2a2a2a; color: var(--primary-color); padding: 12px 15px;
    position: relative; transition: background-color 0.3s ease;
    display: flex; justify-content: space-between; align-items: center;
}
.module-title:hover { background: #3a3a3a; }
.module-content {
    padding: 15px 15px; background-color: #111; border-top: 1px solid #444;
}
.submodule {
    margin-left: 10px; padding: 8px 0; color: var(--text-color); border-bottom: 1px solid #333;
    font-size: 0.95rem; display: block;
}
.submodule strong[itemprop="name"] { color: #c0ffc0; font-weight: 600; }
.submodule a[itemprop="url"] { display: none; }
.submodule:last-child { border-bottom: none; }

/* --- Footer --- */
footer {
    text-align: center; padding: 2rem 1rem; margin-top: 3rem; background-color: rgba(0, 0, 0, 0.85);
    color: #aaa; font-size: 0.9rem; border-top: 1px solid #333; width: 100%;
}
footer a { color: var(--primary-color); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* --- Accessibility: Focus visible --- */
:focus-visible {
    outline: 3px solid var(--primary-color); outline-offset: 2px;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5); border-radius: 3px;
}

/* --- Load More Trigger --- */
#load-more-trigger {
    height: 100px;
    margin-top: 20px;
    text-align: center;
    color: var(--primary-color);
    font-size: 1.2em;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}
 #load-more-trigger.hidden {
     display: none;
 }
 /* Simple Loader */
.loader {
  border: 4px solid rgba(0, 255, 0, 0.3);
  border-left-color: var(--primary-color);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    html { font-size: 15px; }
    header { padding: 5px 1rem; justify-content: space-around; }
    header .site-title a { font-size: 1.4rem; margin-bottom: 5px; }
    header nav.actions { justify-content: center; gap: 0.5rem; width: 100%; }
    header .actions a { font-size: 0.9rem; padding: 0.5rem 0.8rem; }
    .intro-section { padding: 1.5rem; margin: 1rem; }
    .search-input { width: 90%; }
    .course-item { width: 270px; min-height: 260px; }
    .popup-content { width: 95%; padding: 1.5rem; max-height: 88vh; }
    .popup-close-button { top: 10px; right: 10px; font-size: 1.4rem; padding: 0.1rem 0.7rem; }
    #popup-curriculum > .syllabus-title { font-size: 1.3rem; }
}
 @media (max-width: 480px) {
    html { font-size: 14px; }
    header .site-title a { font-size: 1.2rem; text-align: center; width: 100%; }
    header nav.actions { gap: 0.4rem; }
    header .actions a { font-size: 0.8rem; padding: 0.4rem 0.6rem; flex-grow: 1; min-width: 90px; }
    .course-item { width: 240px; min-height: 250px;}
    .enroll-button, .popup-actions a { font-size: 1rem; padding: 0.6rem 1.2rem; }
    .popup-close-button { font-size: 1.2rem; padding: 0.1rem 0.6rem; }
 }
