/* --- CSS Variables & Global Styles --- */
:root {
    --primary-color: #4f46e5;
    --primary-hover: #3b30a9;
    --background-color: #0b1220;
    --card-background: #1f2937;
    --text-color: #e5e7eb;
    --muted-text: #9ca3af;
    --border-color: #374151;
    --shadow-color: rgba(0, 0, 0, 0.4);
    --font-sans: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* General Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    font-family: var(--font-sans);
    overflow-x: hidden;
}

/* NEW: Canvas background style */
#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

/* --- Animations --- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* --- HEADER (Consistent with Home Page) --- */
header {
    background-color: rgba(31, 41, 55, 0.9);
    backdrop-filter: blur(5px);
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand .logo img {
    width: 40px;
    height: 40px;
}
.site-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
}
.tagline {
    font-size: 0.75rem;
    color: var(--muted-text);
}
nav a {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 8px;
    transition: background-color 0.3s, color 0.3s;
}
nav a:hover {
    background-color: var(--border-color);
    color: var(--text-color);
}
nav a.active {
    background-color: var(--primary-color);
    color: #fff;
}

/* --- MAIN CONTENT & LAYOUT --- */
main {
    padding: 60px 20px;
    max-width: 1200px;
    margin: auto;
    position: relative;
    z-index: 1;
}
.title {
    text-align: center;
    font-size: 3rem;
    font-weight: 700;
    color: var(--text-color);
    margin-bottom: 20px;
    position: relative;
}
.subtitle {
    text-align: center;
    color: var(--muted-text);
    margin-bottom: 50px;
    font-size: 1.1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}
.title::after {
    content: '';
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* --- COURSES GRID & CARD STYLES --- */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}
.course {
    background: var(--card-background);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 15px var(--shadow-color);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}
.course:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
    border-color: var(--primary-color);
}
.course img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.course-details {
    padding: 20px;
    flex-grow: 1; /* Allows this section to grow and push the buttons down */
}
.course h4 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 8px;
}
.course p {
    color: var(--muted-text);
    font-size: 0.95em;
    line-height: 1.5;
}
.row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px 20px;
    gap: 15px;
}
.btn-ghost, .cta {
    flex: 1;
    text-align: center;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.95em;
    text-decoration: none;
}
.btn-ghost {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.btn-ghost:hover {
    background: var(--primary-color);
    color: white;
}
.cta {
    background: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}
.cta:hover {
    background: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
}


/* --- FOOTER (Consistent with Home Page) --- */
footer {
    background-color: var(--card-background);
    padding: 60px 20px;
    border-top: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}
.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 40px;
    max-width: 1200px;
    margin: 0 auto;
}
.footer-about p {
    color: var(--muted-text);
    max-width: 400px;
    margin-top: 15px;
}
.social-links {
    margin-top: 20px;
    display: flex;
    gap: 15px;
}
.social-links svg {
    width: 24px;
    height: 24px;
    color: var(--muted-text);
    transition: color 0.3s, transform 0.3s;
}
.social-links a:hover svg {
    color: var(--primary-color);
    transform: translateY(-3px);
}
.footer-links h3, .footer-contact h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
    color: var(--text-color);
}
.footer-links ul {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.footer-links a {
    text-decoration: none;
    color: var(--muted-text);
    transition: color 0.3s;
}
.footer-links a:hover {
    color: var(--primary-color);
}
.footer-contact p {
    color: var(--muted-text);
    margin-bottom: 10px;
}
.footer-contact a {
    color: var(--primary-color);
    text-decoration: none;
}
.footer-bottom {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    color: var(--muted-text);
}

/* --- Media Queries --- */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        text-align: center;
    }
    nav {
        margin-top: 15px;
        justify-content: center;
        flex-wrap: wrap;
    }
    .title {
        font-size: 2.2rem;
    }
    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .footer-about, .footer-links, .footer-contact {
        align-items: center;
    }
}