/* Basic Resets & Global Styles */
body {
    font-family: 'Arial', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa; /* Light background for the platform */
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

a {
    text-decoration: none;
    color: #007bff;
}

a:hover {
    color: #0056b3;
}

button {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #0056b3;
}

/* --- Header --- */
.header {
    background-color: #ffffff;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.header .logo {
    font-size: 28px;
    font-weight: bold;
    color: #333;
}

.header .nav-links a {
    margin-left: 25px;
    font-size: 17px;
    color: #555;
    transition: color 0.3s ease;
}

.header .nav-links a:hover {
    color: #007bff;
}

.header .nav-right {
    display: flex;
    align-items: center;
}

.header .search-bar input {
    border: 1px solid #ccc;
    border-radius: 20px;
    padding: 8px 15px;
    width: 200px;
    font-size: 15px;
}

.header .icons {
    margin-left: 20px;
}

.header .icons i { /* For Font Awesome Icons */
    font-size: 22px;
    color: #555;
    margin-left: 15px;
    cursor: pointer;
}

.header .user-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    margin-left: 20px;
    cursor: pointer;
}

/* --- Footer --- */
.footer {
    background-color: #333;
    color: white;
    padding: 30px;
    text-align: center;
    font-size: 15px;
    margin-top: 50px;
}

.footer .footer-links a {
    color: white;
    margin: 0 15px;
    transition: color 0.3s ease;
}

.footer .footer-links a:hover {
    color: #007bff;
}

.footer .social-icons {
    margin-top: 20px;
}

.footer .social-icons i { /* For Font Awesome Icons */
    font-size: 26px;
    margin: 0 12px;
    color: white;
    transition: color 0.3s ease;
}

.footer .social-icons i:hover {
    color: #007bff;
}

/* --- Course Card (Reused Component) --- */
.course-card {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    width: auto; /* Let the grid control the width */
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

.course-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.course-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Allows content to take available space */
}

.course-card h3 {
    font-size: 20px;
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
}

.course-card .instructor {
    font-size: 15px;
    color: #777;
    margin-bottom: 10px;
}

.course-card .rating {
    color: #ffc107;
    font-size: 16px;
    margin-bottom: 10px;
}

.course-card .price {
    font-weight: bold;
    color: #28a745;
    font-size: 19px;
    margin-bottom: 15px;
}

.course-card .progress-bar {
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 5px;
    margin-top: 10px;
    margin-bottom: 15px;
    overflow: hidden; /* Ensures the inner bar stays within bounds */
}

.course-card .progress-bar-fill {
    height: 100%;
    background-color: #28a745; /* Green for progress */
    border-radius: 5px;
}

.course-card .progress-text {
    font-size: 14px;
    color: #555;
    margin-top: 5px;
    margin-bottom: 15px;
}

.course-card .btn {
    display: block;
    width: calc(100% - 0px); /* Adjust for padding within card-content */
    text-align: center;
    margin-top: auto; /* Pushes button to the bottom */
    padding: 10px;
    background-color: #007bff;
    color: white;
    border-radius: 5px;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.course-card .btn:hover {
    background-color: #0056b3;
}

/* --- Home Page Specifics --- */
.hero-section {
    background-color: #e0f7fa;
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.hero-section h1 {
    font-size: 42px;
    color: #007bff;
    margin-bottom: 15px;
}

.hero-section p {
    font-size: 20px;
    color: #555;
    margin-bottom: 30px;
}

.hero-section .button {
    background-color: #007bff;
    color: white;
    padding: 15px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 18px;
    transition: background-color 0.3s ease;
}

.hero-section .button:hover {
    background-color: #0056b3;
}

/* For sections that contain grids/lists of courses */
.section-title {
    font-size: 32px;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

/* Updated: Course list for general use (e.g., dashboard, recommended) */
.course-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* Responsive grid */
    gap: 30px; /* Space between cards */
    margin-bottom: 50px; /* Space before next section or footer */
    justify-content: center; /* Center items if not filling full width */
}

/* --- Courses Page Specifics --- */
.courses-page-content {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.sidebar-filters {
    width: 280px;
    padding: 25px;
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    flex-shrink: 0; /* Prevents shrinking */
}

.sidebar-filters h3 {
    font-size: 22px;
    color: #333;
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.filter-group {
    margin-bottom: 30px;
}

.filter-group label {
    display: block;
    margin-bottom: 12px;
    font-size: 16px;
    color: #555;
    cursor: pointer;
}

.filter-group input[type="checkbox"],
.filter-group input[type="radio"] {
    margin-right: 8px;
    transform: scale(1.1); /* Slightly larger checkboxes/radios */
}

.filter-group .rating i {
    color: #ffc107;
}

.course-grid-section {
    flex-grow: 1;
}

.course-grid-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 10px 0;
}

.course-grid-header select {
    padding: 8px 15px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
    background-color: white;
    cursor: pointer;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.pagination {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.pagination a {
    padding: 12px 18px;
    border: 1px solid #ddd;
    margin: 0 5px;
    border-radius: 5px;
    background-color: #ffffff;
    color: #555;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.pagination a.active,
.pagination a:hover {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}


/* --- Course Detail Page Specifics --- */
.course-hero-section {
    background-color: #f8f9fa;
    padding: 60px 0;
    text-align: center;
    margin-bottom: 40px;
}

.course-hero-section h1 {
    font-size: 52px;
    color: #2c3e50;
    margin-bottom: 15px;
}

.course-hero-section .short-description {
    font-size: 22px;
    color: #666;
    margin-bottom: 25px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.course-hero-section .meta-info {
    font-size: 18px;
    color: #777;
    margin-bottom: 30px;
}

.course-hero-section .enroll-button {
    padding: 18px 40px;
    font-size: 24px;
    border-radius: 8px;
    background-color: #28a745; /* Green for enrollment */
}

.course-hero-section .enroll-button:hover {
    background-color: #218838;
}

.course-content-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start; /* Align items to the top */
}

.main-course-area {
    flex: 3; /* Takes 3 parts of available space */
}

.sidebar-course-details {
    flex: 1; /* Takes 1 part of available space */
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    padding: 25px;
    position: sticky; /* Makes it sticky */
    top: 100px; /* Adjust based on header height */
    /* max-height: calc(100vh - 120px); /* Adjust to fit viewport */
    /* overflow-y: auto; */
}

.video-player-container {
    width: 100%;
    background-color: #000;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-player-container iframe {
    width: 100%;
    height: 450px; /* Adjust height or use aspect-ratio */
    border: none;
    display: block;
}

/* --- Tabs for Course Content --- */
.course-tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.course-tab-button {
    padding: 15px 25px;
    font-size: 18px;
    cursor: pointer;
    border: none;
    background: none;
    color: #777;
    border-bottom: 3px solid transparent;
    transition: color 0.3s ease, border-color 0.3s ease;
}

.course-tab-button.active {
    color: #007bff;
    border-color: #007bff;
    font-weight: bold;
}

.tab-content {
    padding: 20px 0;
    background-color: #ffffff;
    border-radius: 0 0 10px 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    min-height: 200px; /* Placeholder height */
}

.tab-content h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #333;
    padding: 0 20px; /* Add padding inside content area */
}

.tab-content ul {
    list-style: none;
    padding: 0 20px; /* Add padding inside content area */
}

.tab-content ul li {
    padding: 15px 0;
    border-bottom: 1px dashed #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 17px;
    color: #444;
}

.tab-content ul li:last-child {
    border-bottom: none;
}

.tab-content .lesson-icon {
    margin-right: 10px;
    color: #007bff;
}

.tab-content .lesson-duration {
    color: #888;
    font-size: 15px;
}

.tab-content p {
    padding: 0 20px; /* Add padding inside content area */
}


/* --- Sidebar Details --- */
.sidebar-course-details h3 {
    font-size: 22px;
    margin-bottom: 20px;
    color: #333;
}

.detail-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 17px;
    color: #555;
}

.detail-item i {
    margin-right: 15px;
    color: #007bff;
    font-size: 20px;
}

.instructor-profile {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.instructor-profile img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
    border: 3px solid #007bff;
}

.instructor-profile h4 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #333;
}

.instructor-profile p {
    font-size: 15px;
    color: #666;
    margin-bottom: 15px;
}

.instructor-profile .btn {
    background-color: #6c757d; /* Grey button */
    padding: 10px 20px;
    font-size: 16px;
}

.instructor-profile .btn:hover {
    background-color: #5a6268;
}

.reviews-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.reviews-section .overall-rating {
    font-size: 48px;
    font-weight: bold;
    color: #ffc107;
    text-align: center;
    margin-bottom: 20px;
}

.reviews-section .rating-breakdown div {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    font-size: 16px;
}

.reviews-section .rating-breakdown .bar {
    flex-grow: 1;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    margin: 0 10px;
    overflow: hidden;
}

.reviews-section .rating-breakdown .bar-fill {
    height: 100%;
    background-color: #007bff;
    border-radius: 5px;
}

.reviews-list {
    margin-top: 30px;
}

.review-item {
    background-color: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #eee;
}

.review-item .reviewer-info {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.review-item .reviewer-info img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 15px;
}

.review-item .reviewer-name {
    font-weight: bold;
    font-size: 18px;
    color: #333;
}

.review-item .review-rating {
    color: #ffc107;
    font-size: 16px;
    margin-top: 5px;
}

.review-item p {
    font-size: 16px;
    color: #555;
}


/* Responsive Adjustments */
@media (max-width: 992px) {
    .header {
        padding: 0 20px;
    }
    .header .nav-links {
        display: none; /* Hide nav links for smaller screens, could add a hamburger menu with JS */
    }
    .header .search-bar input {
        width: 150px;
    }
    .hero-section h1 {
        font-size: 36px;
    }
    .hero-section p {
        font-size: 18px;
    }
    .course-list {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Adjust for smaller cards */
    }
    .courses-page-content {
        flex-direction: column; /* Stack sidebar and grid on smaller screens */
    }
    .sidebar-filters {
        width: 100%;
        margin-right: 0;
        margin-bottom: 30px;
    }
    .sidebar-course-details {
        position: static; /* Remove sticky for mobile */
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    .header {
        padding: 0 15px;
        height: 60px;
    }
    .header .logo {
        font-size: 24px;
    }
    .header .search-bar input {
        width: 120px;
        padding: 6px 10px;
    }
    .header .icons i, .header .user-avatar {
        font-size: 18px;
        width: 35px;
        height: 35px;
    }
    .hero-section {
        padding: 30px 20px;
    }
    .hero-section h1 {
        font-size: 30px;
    }
    .hero-section p {
        font-size: 16px;
    }
    .hero-section .button {
        padding: 12px 25px;
        font-size: 16px;
    }
    .section-title {
        font-size: 26px;
    }
    .course-card {
        width: 100%; /* Full width on very small screens */
    }
    .course-grid-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .course-grid-header select {
        margin-top: 10px;
    }
    .video-player-container iframe {
        height: 300px; /* Adjust video player height */
    }
    .course-tabs {
        flex-wrap: wrap; /* Allow tabs to wrap */
    }
    .course-tab-button {
        padding: 10px 15px;
        font-size: 16px;
        margin-bottom: 10px;
    }
    .reviews-section .overall-rating {
        font-size: 36px;
    }
}