/* FONT IMPORT */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700;900&family=Montserrat:wght@400;500;600&display=swap');

/* BASIC RESET & THEME */
:root {
    --primary-green: #556b2f;
    --dark-green: #2e4034;
    --background-dark: #1a2a26;
    --text-light: #f2f2f2;
    --text-muted: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.15);
    --module-bg: rgba(255, 255, 255, 0.05);
    --module-bg-hover: rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--background-dark);
    color: var(--text-light);
    margin: 0;
    padding-top: 80px; /* Space for fixed header */
}

/* BACKGROUND CYCLER & OVERLAY */
#background-cycler {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background-size: cover;
    background-position: center;
    transition: background-image 1.5s ease-in-out;
}
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(26, 42, 38, 0.9), rgba(26, 42, 38, 0.7));
    z-index: -1;
}

/* GLOBAL UI SHELL */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: rgba(46, 64, 52, 0.8);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
    padding: 10px 20px;
}
.header-content {
    max-width: 95%; 
    margin: 0 auto; 
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}
.logo-link img { height: 60px; vertical-align: middle; }
.main-nav { display: flex; align-items: center; gap: 5px; }
.main-nav a.nav-button, .main-nav .dropbtn {
    color: var(--text-light); text-decoration: none; padding: 8px 12px; border-radius: 5px; transition: background-color 0.3s; font-size: 0.9rem; white-space: nowrap;
}
.main-nav a.nav-button:hover, .main-nav .dropdown:hover .dropbtn, .main-nav a.nav-button.active {
    background-color: #3d4c21;
}

.dropbtn { background-color: inherit; border: none; font-family: inherit; cursor: pointer; }
.dropdown { position: relative; display: inline-block; }
.dropdown-content { display: none; position: absolute; background-color: #3d4c21; min-width: 160px; box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2); z-index: 1; border-radius: 5px; }
.dropdown-content a { color: var(--text-light); padding: 12px 16px; text-decoration: none; display: block; font-size: 0.9rem; }
.dropdown-content a:hover {background-color: #4f583d;}
.dropdown:hover .dropdown-content {
    display: block;
}

/* MAIN LAYOUT */
.page-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 20px;
}

/* PAGE HEADER */
.page-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}
.page-header h1 {
    font-family: 'Merriweather', serif;
    font-size: 3rem;
    margin: 0;
}
.page-header .subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0.5rem 0 0 0;
}
.action-btn {
    background-color: var(--module-bg);
    border: 1px solid var(--border-color);
    color: var(--text-light);
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
}

/* FILTER BAR */
.filter-bar {
    display: flex;
    flex-wrap: wrap; /* Allows filters to wrap on smaller screens */
    gap: 1rem;
    align-items: center;
    padding: 1rem;
    background-color: var(--module-bg);
    border-radius: 8px;
    margin-bottom: 2rem;
}
.filter-bar input[type="search"] {
    flex-grow: 1;
    min-width: 200px; /* Ensures search bar doesn't get too small */
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid #444;
    background-color: #333;
    color: #fff;
    font-size: 1rem;
}
.filter-bar select {
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #444;
    background-color: #333;
    color: #fff;
}

/* COURSE GRID */
.course-grid {
    display: grid;
    /* Responsive grid: creates as many columns as fit, with a minimum width of 280px */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.course-card {
    background-color: var(--module-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease-in-out, background-color 0.2s ease-in-out;
}
.course-card:hover {
    transform: translateY(-5px);
    background-color: var(--module-bg-hover);
}
.course-thumbnail img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.course-info {
    padding: 1rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}
.course-info h3 { font-family: 'Merriweather', serif; margin: 0 0 0.5rem 0; font-size: 1.2rem; }
.course-info .instructor { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1rem; }

.course-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}
.difficulty-tag {
    background-color: var(--primary-green);
    color: white;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: capitalize;
}
.price .free {
    color: #4caf50;
    font-weight: bold;
    font-size: 1.1rem;
}
.price .member-price {
    font-weight: bold;
    font-size: 1.1rem;
}