/* --- Global Styles & Variables --- */
:root {
    --primary-color: #4A90E2; /* A nice, friendly blue */
    --secondary-color: #50E3C2; /* A fresh green/teal accent */
    --dark-color: #333;
    --light-color: #f4f4f4;
    --font-family: 'Arial', sans-serif;
}

/* Basic reset */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    background: #fff;
    color: var(--dark-color);
}

a {
    text-decoration: none;
    color: var(--primary-color);
}

ul {
    list-style: none;
}

.container {
    max-width: 1100px;
    margin: auto;
    overflow: hidden;
    padding: 0 2rem;
}

/* --- Header & Navigation (Shared) --- */
.main-header {
    background: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #ddd;
    position: sticky;
    top: 0;
    z-index: 100;
}

.main-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.main-header .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--dark-color);
}

.main-nav ul {
    display: flex;
}

.main-nav ul li {
    margin-left: 1.5rem;
}

.main-nav ul a {
    color: var(--dark-color);
    font-weight: bold;
    padding-bottom: 5px;
    transition: all 0.3s;
}

.main-nav ul a:hover, .main-nav ul a.active {
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
}


/* --- Reusable Components (Buttons, Cards) --- */
.btn {
    display: inline-block;
    background: var(--primary-color);
    color: #fff;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn:hover {
    background: #357ABD;
}


/* --- Homepage Specific Styles --- */
.hero {
    background: var(--light-color);
    text-align: center;
    padding: 4rem 0;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

/* --- Course Listing Page Styles --- */
.page-header {
    background: var(--light-color);
    padding: 2rem 0;
    text-align: center;
    margin-bottom: 2rem;
}

.course-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.course-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.course-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.course-card-content {
    padding: 1.5rem;
}

.course-card-content h3 {
    margin-bottom: 0.5rem;
}

/* --- Dashboard (Progress Tracking) Styles --- */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.progress-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.progress-bar-container {
    width: 60%;
    background: #e0e0e0;
    border-radius: 10px;
    height: 20px;
    overflow: hidden;
}

.progress-bar {
    background: var(--secondary-color);
    height: 100%;
    text-align: center;
    color: white;
    font-weight: bold;
    line-height: 20px; /* Vertically center the text */
}

/* --- Video Embedding (Course Detail) --- */
.video-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    max-width: 100%;
    background: #000;
    margin-bottom: 1.5rem;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}


/* --- Footer (Shared) --- */
.main-footer {
    background: var(--dark-color);
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
}

/* --- Responsiveness --- */
@media(max-width: 768px) {
    .main-header .container {
        flex-direction: column;
    }
    .main-header .logo {
        margin-bottom: 1rem;
    }
    .main-nav ul {
        justify-content: center;
        width: 100%;
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .course-grid {
        grid-template-columns: 1fr;
    }
    .progress-card {
        flex-direction: column;
        align-items: flex-start;
    }
    .progress-card h3 {
        margin-bottom: 1rem;
    }
    .progress-bar-container {
        width: 100%;
    }
}