/*
Theme Name: EJSS CK-12 Theme
Theme URI: https://ejobsitesoftware.com
Author: eJobSiteSoftware
Author URI: https://ejobsitesoftware.com
Description: A clean, modern WordPress theme inspired by CK-12 Flexi for displaying LMS courses
Version: 1.0.0
Requires at least: 5.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ejss-ck12
Tags: education, lms, courses, clean, modern
*/

/* ===================================
   CSS RESET & BASE STYLES
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #48B699;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #3a9580;
}

/* ===================================
   TYPOGRAPHY
   =================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #2C3E50;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
}

h3 {
    font-size: 1.75rem;
}

h4 {
    font-size: 1.5rem;
}

h5 {
    font-size: 1.25rem;
}

h6 {
    font-size: 1rem;
}

p {
    margin-bottom: 1rem;
}

/* ===================================
   LAYOUT UTILITIES
   =================================== */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.container-wide {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: 60px 0;
}

.section-light {
    background-color: #F9F9F9;
}

/* ===================================
   HEADER & NAVIGATION
   =================================== */

.site-header {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 0;
}

.site-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2C3E50;
}

.site-logo a {
    color: #2C3E50;
}

.site-logo a:hover {
    color: #48B699;
}

/* Search Bar */
.header-search {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}

.search-form {
    position: relative;
    display: flex;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: #48B699;
}

.search-form button {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: #48B699;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    color: #fff;
    cursor: pointer;
    transition: background 0.3s ease;
}

.search-form button:hover {
    background: #3a9580;
}

/* Main Navigation */
.main-navigation {
    display: flex;
    align-items: center;
    gap: 20px;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
}

.main-navigation a {
    color: #2C3E50;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 5px;
    transition: all 0.3s ease;
}

.main-navigation a:hover {
    background-color: #F9F9F9;
    color: #48B699;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #2C3E50;
}

/* ===================================
   BUTTONS
   =================================== */

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 8px;
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: #48B699;
    color: #fff;
}

.btn-primary:hover {
    background-color: #3a9580;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(72, 182, 153, 0.3);
}

.btn-large {
    padding: 15px 40px;
    font-size: 1.1rem;
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #48B699;
    color: #48B699;
}

.btn-outline:hover {
    background-color: #48B699;
    color: #fff;
}

/* ===================================
   COURSE CARDS
   =================================== */

.course-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.course-card {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
}

.course-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.course-card-thumbnail {
    position: relative;
    padding-top: 140%;
    /* 5:7 aspect ratio for book cover */
    background-color: #f0f0f0;
    overflow: hidden;
}

.course-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-card-content {
    padding: 20px;
}

.course-card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2C3E50;
    line-height: 1.4;
}

.course-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 0.85rem;
    color: #666;
}

.course-card-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.course-badge {
    display: inline-block;
    padding: 4px 10px;
    background-color: #48B699;
    color: #fff;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 10px;
}

/* ===================================
   SUBJECT CATEGORIES
   =================================== */

.subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.subject-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 40px 20px;
    border-radius: 10px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.subject-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.subject-card h3 {
    color: #fff;
    margin-bottom: 10px;
}

.subject-card .course-count {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Different colors for subjects */
.subject-card.math {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.subject-card.science {
    background: linear-gradient(135deg, #48B699 0%, #2C7A7B 100%);
}

.subject-card.social-studies {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.subject-card.english {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

/* ===================================
   HERO SECTIONS
   =================================== */

.hero {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    color: #fff;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    color: #fff;
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.course-hero {
    background: linear-gradient(135deg, #2C3E50 0%, #34495E 100%);
    color: #fff;
    padding: 60px 0;
}

.course-hero-content {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
}

.course-hero-thumbnail {
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    max-height: 350px;
    /* Limit thumbnail height */
}

.course-hero-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Plugin's course featured image - make it shorter */
.ejss-lms-course-featured-image {
    max-height: 300px;
    overflow: hidden;
    border-radius: 10px;
    margin-bottom: 20px;
}

.ejss-lms-course-featured-image img {
    width: 100%;
    height: 100%;
    max-height: 300px;
    object-fit: cover;
}

.course-hero-info h1 {
    color: #fff;
    margin-bottom: 15px;
}

.course-hero-info p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 20px;
}

.course-meta-list {
    list-style: none;
    margin: 20px 0;
}

.course-meta-list li {
    padding: 8px 0;
    color: rgba(255, 255, 255, 0.9);
}

.course-meta-list strong {
    color: #fff;
}

/* ===================================
   LESSON ACCORDION
   =================================== */

.lessons-section {
    background: #fff;
    padding: 40px 0;
}

.lesson-accordion {
    max-width: 900px;
    margin: 0 auto;
}

.lesson-unit {
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.lesson-unit-header {
    background: #F9F9F9;
    padding: 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.lesson-unit-header:hover {
    background: #f0f0f0;
}

.lesson-unit-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.lesson-unit-toggle {
    font-size: 1.5rem;
    color: #666;
    transition: transform 0.3s ease;
}

.lesson-unit.active .lesson-unit-toggle {
    transform: rotate(180deg);
}

.lesson-list {
    list-style: none;
    display: none;
    padding: 20px;
    background: #fff;
}

.lesson-unit.active .lesson-list {
    display: block;
}

.lesson-list li {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.lesson-list li:last-child {
    border-bottom: none;
}

.lesson-list a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2C3E50;
    font-weight: 500;
}

.lesson-list a:hover {
    color: #48B699;
}

.lesson-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    background: #F9F9F9;
    border-radius: 50%;
    font-size: 0.85rem;
    color: #666;
}

/* ===================================
   FOOTER
   =================================== */

.site-footer {
    background: #2C3E50;
    color: rgba(255, 255, 255, 0.8);
    padding: 40px 0 20px;
    margin-top: 60px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-widget h3 {
    color: #fff;
    margin-bottom: 15px;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget ul li {
    margin-bottom: 8px;
}

.footer-widget a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-widget a:hover {
    color: #48B699;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 20px;
    text-align: center;
    font-size: 0.9rem;
}

/* ===================================
   BREADCRUMBS
   =================================== */

.breadcrumbs {
    padding: 15px 0;
    font-size: 0.9rem;
    color: #666;
}

.breadcrumbs a {
    color: #48B699;
}

.breadcrumbs span {
    margin: 0 8px;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */

@media (max-width: 768px) {
    .header-main {
        flex-wrap: wrap;
    }

    .header-search {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin: 15px 0 0 0;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .main-navigation {
        display: none;
        width: 100%;
        order: 4;
    }

    .main-navigation.active {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .main-navigation ul {
        flex-direction: column;
        width: 100%;
    }

    .course-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }

    .course-hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .course-hero-thumbnail {
        max-width: 300px;
        margin: 0 auto;
    }

    .hero h1 {
        font-size: 2rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.75rem;
    }

    h3 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .course-grid {
        grid-template-columns: 1fr;
    }

    .subject-grid {
        grid-template-columns: 1fr;
    }
}