/* =========================================
   1. BRAND VARIABLES & RESET
   ========================================= */
   :root {
    --header-bg: #18211E;
    --primary: #5D7374;
    --accent-green: #DCEFE3;
    --accent-purple: #EFC9F3;
    --bg-main: #F8FAFB;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --white: #ffffff;
    --border: #e2e8f0;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-main);
    color: var(--text-main);
    margin: 0;
    line-height: 1.5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
}

/* =========================================
   2. HEADER & NAVIGATION
   ========================================= */
.dark-header {
    background-color: var(--header-bg);
    color: white;
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-main {
    font-size: 24px;
    font-weight: 700;
    color: white;
}

.sub-brand {
    font-size: 11px;
    color: #a9c1b8;
    display: block;
    margin-top: -2px;
}

.top-nav ul {
    display: flex;
    list-style: none;
    gap: 35px;
    margin: 0;
    padding: 0;
}

.top-nav a {
    text-decoration: none;
    color: white;
    font-size: 14px;
    font-weight: 600;
    opacity: 0.8;
}

.top-nav a.active {
    opacity: 1;
    border-bottom: 2px solid var(--accent-purple);
    padding-bottom: 5px;
}

/* =========================================
   3. HERO & TABS
   ========================================= */
.hero {
    padding: 60px 0 20px;
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 15px;
}

.hero h1 {
    font-size: 42px;
    margin: 0 0 15px 0;
}

.subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
}

.hero-actions {
    display: flex;
    gap: 16px;
    margin: 30px 0 40px 0;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-solid {
    background: var(--header-bg);
    color: white;
    border: 2px solid var(--header-bg);
}

.btn-outline {
    background: transparent;
    color: var(--header-bg);
    border: 2px solid #cbd5e1;
}

.btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

/* Main Navigation Tabs */
.catalog-tabs {
    display: flex;
    gap: 40px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 40px;
}

.tab-btn {
    background: none;
    border: none;
    padding: 15px 5px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    position: relative;
}

.tab-btn.active {
    color: var(--header-bg);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--accent-purple);
}

/* =========================================
   4. SECTION & COURSE GRIDS
   ========================================= */
.section-grid, .course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    padding-bottom: 80px;
}

/* Parent Cards (Home) */
.section-card {
    background: var(--white);
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    cursor: pointer;
    transition: 0.3s;
    border-top: 4px solid transparent; /* Color set by JS */
    display: flex;
    flex-direction: column;
}

.section-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    margin-bottom: 20px;
}

.count-footer {
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    margin-top: auto;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

/* Child Cards (Detail View) */
.course-card {
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-5px);
}

.course-img-container {
    position: relative;
    height: 180px;
    background: #e2e8f0;
}

.c-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Badges */
.course-status-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    background: var(--accent-green);
    color: var(--header-bg);
}

.badge-updated {
    background: var(--accent-purple);
}

/* Card Content & CTA */
.c-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.c-top-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.c-tag {
    background: #f1f5f9;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: var(--primary);
}

.c-content p {
    font-size: 14px;
    color: var(--text-muted);
    flex-grow: 1;
    margin-bottom: 20px;
}

.course-cta {
    font-size: 14px;
    font-weight: 700;
    color: var(--primary);
    border-top: 1px solid #f1f5f9;
    padding-top: 15px;
    margin-top: auto;
    transition: padding-left 0.3s;
}

.course-card:hover .course-cta {
    padding-left: 8px;
    color: var(--header-bg);
}

/* =========================================
   5. DETAIL VIEW UI
   ========================================= */
.back-nav {
    padding: 30px 0;
}

.back-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
}

.detail-header {
    margin-bottom: 40px;
}

.empty-msg {
    grid-column: 1 / -1;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    border: 2px dashed var(--border);
    border-radius: 12px;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo-img {
    height: 32px; /* Adjust this value to make the logo larger or smaller */
    width: auto;  /* Maintains aspect ratio */
    display: block;
}

.sub-brand {
    font-size: 11px;
    color: #a9c1b8;
    display: block;
    margin-top: 4px; /* Space between the image and the sub-brand text */
    padding-left: 2px; /* Slight offset to align with logo edge if needed */
}

/* Search Bar Styles */
.search-container {
    position: relative;
    max-width: 500px;
    margin: 20px 0 30px 0;
}

#course-search {
    width: 100%;
    padding: 12px 20px 12px 45px;
    font-size: 16px;
    border: 2px solid var(--border);
    border-radius: 30px;
    background: var(--white);
    outline: none;
    transition: border-color 0.3s ease;
}

#course-search:focus {
    border-color: var(--primary);
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 18px;
}

/* Styling for the search results state */
#search-results-grid {
    margin-top: 20px;
    padding-bottom: 50px;
}

.empty-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
}