/* =================================================================
   LearnFlash Template-Specific Styles
   Extracted from PHP templates for better organization
   ================================================================= */

/* === FONT INHERITANCE FIX === */
/* Ensure all template elements inherit parent theme/Elementor fonts */
.learnflash-page-header,
.content-box,
.progress-card,
.topics-section,
.module-title,
.course-title,
.topic-title-header,
.course-accordion,
.module-grid {
    font-family: inherit;
}

/* === SHARED TEMPLATE COMPONENTS === */

/* Main Container */
.learnflash-outter {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Page Header (used in topic templates) */
.learnflash-page-header {
    margin-bottom: 2rem;
    margin-left: 8px;
    margin-right: 8px;
}

.learnflash-page-header .lf-row {
    align-items: center;
}

.hamburger-menu-button {
    background: none;
    border: 1px solid #6c757d;
    border-radius: 6px;
    padding: 6px 12px;
    color: #6c757d;
    cursor: pointer;
    transition: all 0.2s ease;
}

.hamburger-menu-button:hover {
    background-color: #6c757d;
    color: #fff;
}

.breadcrumb-container {
    font-size: 0.875rem;
}

.breadcrumb-container a {
    color: #0055ff;
    text-decoration: none;
}

.breadcrumb-container a:hover {
    color: #0044cc;
    text-decoration: underline;
}

.progress-container {
    width: 100%;
}

.progress-container .lf-progress {
    height: 12px;
    background-color: #eef1f6;
    border-radius: 6px;
    overflow: hidden;
}

.progress-container .lf-progress-bar {
    background: linear-gradient(90deg, #0055ff, #00aaff);
    height: 100%;
    border-radius: 6px;
    transition: width 0.5s ease;
    font-size: 0.75rem;
    line-height: 12px;
    text-align: center;
    color: white;
    font-weight: 600;
}

/* Progress Card (shared) */
.progress-card {
    background-color: white;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    margin-bottom: 1.5rem;
}

.progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.progress-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.progress-percentage {
    font-size: 0.9rem;
    font-weight: 600;
    color: #0055ff;
}

.module-progress {
    height: 8px;
    background-color: #eef1f6;
    border-radius: 4px;
    overflow: hidden;
}

.module-progress .lf-progress-bar {
    background: linear-gradient(90deg, #0055ff, #00aaff);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* Topic Lists (shared) */
.topics-section {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
}

.topics-header {
    font-size: 1.2rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.topics-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.topic-item {
    border-radius: 6px;
    margin-bottom: 4px;
    transition: all 0.2s ease;
}

.topic-item:last-child {
    margin-bottom: 0;
}

.topic-item a {
    color: #555;
    padding: 12px 14px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.topic-item.incomplete a {
    background-color: #fff;
    border: 1px solid rgba(0,0,0,0.05);
}

.topic-item.completed a {
    color: #00a67d;
    background-color: rgba(0, 166, 125, 0.05);
    border: 1px solid rgba(0, 166, 125, 0.1);
}

.topic-item a:hover {
    transform: translateX(3px);
}

.topic-item.incomplete a:hover {
    color: #0055ff;
    background-color: rgba(0, 85, 255, 0.03);
    border-color: rgba(0, 85, 255, 0.1);
}

.topic-item.completed a:hover {
    color: #008d69;
    background-color: rgba(0, 166, 125, 0.08);
}

.topic-title {
    font-weight: 500;
    font-family: inherit;
}

/* Status Icons */
.status-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    position: relative;
}

.completed .status-icon {
    background-color: #00a67d;
    border-radius: 50%;
}

.completed .status-icon .lf-icon {
    transform: scale(0.7);
    color: white;
}

/* === MODULE TEMPLATE SPECIFIC === */

/* Module Header Navigation */
.module-header-nav {
    border-bottom: 1px solid #eee;
    padding-bottom: 16px;
    padding-left: 1rem;
    padding-right: 1rem;
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.course-breadcrumb {
    grid-column: 1;
    grid-row: 1 / 3;
    align-self: center;
    font-size: 0.9rem;
}

.module-counter {
    grid-column: 2;
    grid-row: 1;
    text-align: right;
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
    margin: 0;
}

.module-navigation {
    grid-column: 2;
    grid-row: 2;
    justify-self: end;
}

.course-link {
    color: #0055ff;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.course-link:hover {
    color: #0044cc;
}


.module-navigation {
    display: flex;
    gap: 8px;
}

.nav-btn {
    background-color: #eef1f6;
    color: #555;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    background-color: #0055ff;
    color: white;
}

.nav-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-btn .lf-icon {
    width: 14px;
    height: 14px;
}

/* Module Title */
.module-title {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Module Content */
.module-content {
    margin-bottom: 2rem;
}

/* === COURSE TEMPLATE SPECIFIC === */

/* Course Title */
.course-title {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Module Grid Layout (for course accordion) */
.module-grid {
    display: grid;
    grid-template-columns: 40px minmax(200px, 1fr) 150px 120px 40px;
    align-items: center;
    padding: 16px;
    background-color: #ffffff;
    border-radius: 10px;
    grid-gap: 16px;
}

.module-number {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0055ff;
    text-align: center;
}

.module-title-area {
    overflow: hidden;
}

.module-title-link {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    font-family: inherit;
}

.module-title-link:hover {
    color: #0055ff;
}

/* Progress Bar in Module Grid */
.module-progress-container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.module-progress-container .lf-progress {
    flex: 1;
    height: 8px;
    background-color: #eef1f6;
    border-radius: 4px;
    overflow: hidden;
}

.module-progress-container .lf-progress-bar {
    background: linear-gradient(90deg, #0055ff, #00aaff);
    height: 100%;
    border-radius: 4px;
    transition: width 0.5s ease;
}

.progress-text {
    min-width: 36px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #0055ff;
    text-align: right;
}

/* Lessons Count */
.lessons-count {
    text-align: center;
}

.lessons-count .lf-badge {
    background-color: #eef1f6;
    color: #666;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 20px;
    white-space: nowrap;
}

/* Toggle Button */
.toggle-container {
    display: flex;
    justify-content: center;
}

.toggle-btn {
    background-color: #eef1f6;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    cursor: pointer;
}

.toggle-btn:hover {
    background-color: #0055ff;
}

.toggle-btn:hover .lf-icon {
    filter: brightness(5);
}

.toggle-btn .lf-icon {
    width: 14px;
    height: 14px;
    transition: all 0.2s ease;
}

/* Chevron Animation */
.toggle-btn[aria-expanded="true"] .lf-icon.lf-chevron-down {
    transform: rotate(180deg);
    transition: transform 0.3s ease;
}

.toggle-btn[aria-expanded="false"] .lf-icon.lf-chevron-down {
    transform: rotate(0deg);
    transition: transform 0.3s ease;
}

/* Course Accordion */
.course-accordion {
    margin-top: 1.5rem;
}

.course-accordion .lf-accordion-item {
    margin-bottom: 16px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    overflow: hidden;
}

.course-accordion .lf-accordion-item:hover {
    box-shadow: 0 6px 12px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.course-accordion .lf-accordion-body {
    background-color: #f8f9fa;
    border-top: 1px solid #eee;
    padding: 16px !important;
}

/* === TOPIC TEMPLATES SPECIFIC === */

/* Topic Page Title */
.topic-title-header {
    font-size: 1.5rem !important;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
}

/* Content Box */
.content-box {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 3px 8px rgba(0,0,0,0.08);
    margin-bottom: 2rem;
}

/* === RESPONSIVE ADJUSTMENTS === */
@media (max-width: 768px) {
    /* Prevent horizontal overflow */
    .learnflash-outter {
        max-width: 100vw;
        overflow-x: hidden;
    }
    
    .lf-container {
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
    }
    /* Module Header Navigation - mobile layout */
    .module-header-nav {
        flex-direction: row !important;
        gap: 8px;
        align-items: flex-start;
        justify-content: space-between;
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .module-counter {
        margin: 0;
        text-align: right;
        font-size: 0.8rem;
    }
    
    .module-navigation {
        flex-shrink: 0;
    }
    
    /* Module Grid Layout */
    .module-grid {
        grid-template-columns: 30px 1fr 40px;
        grid-template-rows: auto auto;
        grid-gap: 8px;
        padding: 12px;
    }
    
    .module-title-area {
        grid-column: 2 / 3;
    }
    
    .toggle-container {
        grid-column: 3 / 4;
        grid-row: 1 / 2;
    }
    
    .module-progress-container {
        grid-column: 2 / 4;
        grid-row: 2 / 3;
    }
    
    .lessons-count {
        grid-column: 1 / 3;
        grid-row: 3 / 4;
        text-align: left;
        padding-left: 30px;
    }
    
    /* Page Header - Mobile two row layout */
    .learnflash-page-header {
        margin-left: 4px;
        margin-right: 4px;
    }
    
    .learnflash-page-header .lf-row {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }
    
    /* First row: hamburger + progress together */
    .learnflash-page-header .lf-col-md-6 {
        flex: 0 0 auto;
        width: auto;
        order: 1;
    }
    
    .learnflash-page-header .lf-col-md-2 {
        flex: 1 1 auto;
        width: auto;
        order: 1;
        display: block !important;
    }
    
    /* Second row: buttons take full width */
    .learnflash-page-header .lf-col-md-4 {
        flex: 1 1 100%;
        width: 100%;
        order: 2;
        margin-left: 0 !important;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
    }
    
    .breadcrumb-container {
        display: none;
    }
    
    .progress-container {
        width: 100%;
        min-width: 60px;
    }
    
    .progress-container .lf-progress {
        height: 10px;
    }
    
    .progress-container .lf-progress-bar {
        font-size: 0;
        text-indent: -9999px;
    }
    
    /* Hide status badge on mobile */
    .learnflash-badge {
        display: none;
    }
    
    /* Smaller hamburger button on mobile */
    .hamburger-menu-button {
        padding: 4px 8px;
        font-size: 0.875rem;
    }
    
    /* Smaller action buttons on mobile */
    .learnflash-mark-complete {
        padding: 4px 8px !important;
        font-size: 0.75rem !important;
    }
    
    .learnflash-page-header .lf-btn-sm {
        padding: 4px 8px !important;
        font-size: 0.875rem !important;
    }
    
    /* Titles */
    .module-title,
    .course-title,
    .topic-title-header {
        font-size: 1.5rem;
    }
    
    /* Content adjustments */
    .content-box {
        padding: 1rem;
    }
    
    .progress-card {
        padding: 12px;
        margin-left: 1rem;
        margin-right: 1rem;
    }
    
    .topics-section {
        padding: 15px;
    }
} 