/* ===================================
   DPS Local Media Library - Styles
   =================================== */

:root {
    --primary-color: #003D7A;
    --secondary-color: #1FAB5C;
    --accent-color: #FF9D00;
    --light-bg: #F5F5F5;
    --light-cream: #FAFAF8;
    --text-dark: #333333;
    --text-light: #666666;
    --border-color: #E0E0E0;
    --white: #FFFFFF;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* ===================================
   Global Styles
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-dark);
    line-height: 1.6;
}

body {
    overflow-x: hidden;
    display: flex;
}

/* ===================================
   Mini Sidebar Navigation
   =================================== */

.mini-sidebar {
    position: fixed;
    top: 0;
    left: 220px;
    width: 200px;
    height: 100vh;
    background: linear-gradient(180deg, #1FAB5C 0%, #1a8a4a 100%);
    color: var(--white);
    padding: 1rem 0;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    display: none;
    flex-direction: column;
}

.mini-sidebar.active {
    display: flex;
}

.mini-sidebar-subjects {
    left: 220px;
}

.mini-sidebar-chapters {
    left: 420px;
}

.mini-sidebar-header {
    padding: 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.mini-sidebar-header h3 {
    font-size: 1rem;
    font-weight: 700;
    margin: 0;
}

.mini-close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.mini-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.mini-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.75rem;
    flex: 1;
}

.mini-sidebar-link {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.7rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    font-weight: 500;
    text-align: left;
    width: 100%;
}

.mini-sidebar-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(4px);
}

.mini-sidebar-link:active {
    background: var(--accent-color);
    border-color: var(--accent-color);
}

/* ===================================
   Sidebar Navigation
   =================================== */

.sidebar {
    width: 220px;
    background: linear-gradient(180deg, var(--primary-color) 0%, #0D4A8E 100%);
    color: var(--white);
    padding: 1.5rem 0;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
}

.sidebar-header {
    padding: 0 1rem 1.5rem 1rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 1rem;
}

.sidebar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.75rem;
    margin-bottom: 2rem;
}

.sidebar-link {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
    text-align: left;
}

.sidebar-link:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateX(4px);
}

.sidebar-link:active {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
}

.grade-icon {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.grade-nepali {
    font-size: 0.75rem;
    opacity: 0.8;
    font-weight: 400;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 2px solid rgba(255, 255, 255, 0.1);
    position: absolute;
    bottom: 0;
    width: 100%;
}

.footer-text {
    font-size: 0.8rem;
    opacity: 0.7;
    margin: 0;
}

/* ===================================
   Header & Navigation
   =================================== */

.header {
    background: linear-gradient(135deg, var(--primary-color) 0%, #0D4A8E 100%);
    color: var(--white);
    padding: 1.5rem 1rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.logo-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.subtitle {
    font-size: 0.95rem;
    opacity: 0.95;
    font-weight: 300;
}

.breadcrumb {
    font-size: 0.95rem;
    opacity: 0.9;
    flex-grow: 1;
}

.btn-back {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.btn-back:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: translateX(-2px);
}

/* Header buttons container */
.header-buttons {
    display: flex;
    gap: 0.8rem;
    align-items: center;
}

.btn-home {
    background-color: rgba(255, 255, 255, 0.2);
    color: var(--white);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.btn-home:hover {
    background-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

/* ===================================
   Main Content Area
   =================================== */

#app {
    min-height: 100vh;
    background-color: var(--light-bg);
    flex: 1;
    margin-left: 220px;
}

.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================================
   Search Section
   =================================== */

.search-section {
    margin-bottom: 2rem;
}

.search-box {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--white);
    color: var(--text-dark);
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.search-box:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}

.search-box::placeholder {
    color: var(--text-light);
}

/* ===================================
   Cards Grid
   =================================== */

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1.2rem;
    margin-top: 1.5rem;
}

@media (max-width: 768px) {
    .cards-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
}

.card {
    background-color: var(--white);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 140px;
    box-shadow: var(--shadow);
}

.card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
    display: block;
}

.card-subtitle {
    font-size: 0.9rem;
    color: var(--text-light);
    display: block;
}

/* Grade Cards Styling */
.grade-card {
    background: linear-gradient(135deg, var(--white) 0%, #F9F9F9 100%);
}

.grade-card:hover {
    background: linear-gradient(135deg, #F0F7FF 0%, #E8F3FF 100%);
}

/* ===================================
   Video Lesson Section
   =================================== */

.lesson-card {
    background-color: var(--white);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    border-left: 4px solid var(--secondary-color);
}

.lesson-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.video-player {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    background-color: #000;
    margin-bottom: 1.5rem;
}

.lesson-resources {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.resource-btn {
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 0.8rem;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.resource-btn:hover {
    background-color: #158A4A;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.resource-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    transform: none;
}

/* ===================================
   Teacher Progress Section
   =================================== */

.teacher-progress {
    background-color: #FFF9E6;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 1.2rem;
    margin-top: 1.5rem;
}

.progress-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.progress-item {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.progress-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--secondary-color);
}

.progress-label {
    font-weight: 500;
    color: var(--text-dark);
    cursor: pointer;
}

.progress-info {
    background-color: var(--white);
    border-radius: 6px;
    padding: 0.8rem;
    margin-top: 0.8rem;
    font-size: 0.95rem;
}

.progress-info span {
    font-weight: 600;
    color: var(--primary-color);
}

.remarks-section {
    margin-top: 1rem;
}

.remarks-label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.remarks-input {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 60px;
}

.remarks-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 61, 122, 0.1);
}

/* ===================================
   Buttons
   =================================== */

.btn-primary {
    background-color: var(--primary-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: #0D3A6E;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    font-size: 0.95rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background-color: #158A4A;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   Search Results
   =================================== */

.search-results {
    animation: fadeIn 0.3s ease-in;
}

.search-results h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.search-results.hidden {
    display: none;
}

#search-results-container {
    display: grid;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-result-item {
    background-color: var(--white);
    border-left: 4px solid var(--secondary-color);
    border-radius: 8px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.search-result-item:hover {
    box-shadow: var(--shadow-lg);
    transform: translateX(4px);
}

.result-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.3rem;
}

.result-meta {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 768px) {
    .header {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .logo-section h1 {
        font-size: 1.4rem;
    }

    .subtitle {
        font-size: 0.85rem;
    }

    .main-content {
        padding: 0 1rem 1.5rem;
    }

    .lesson-resources {
        grid-template-columns: 1fr;
    }

    /* Sidebar adjustments for tablet */
    .sidebar {
        width: 180px;
    }

    #app {
        margin-left: 180px;
    }

    .sidebar-link {
        font-size: 0.85rem;
        padding: 0.6rem 0.8rem;
    }

    .cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Mini sidebar adjustments for tablet */
    .mini-sidebar {
        width: 170px;
        left: 180px;
        font-size: 0.8rem;
    }

    .mini-sidebar-subjects {
        left: 180px;
    }

    .mini-sidebar-chapters {
        left: 350px;
    }

    .mini-sidebar-link {
        font-size: 0.8rem;
        padding: 0.6rem 0.8rem;
    }
}

@media (max-width: 480px) {
    .logo-section h1 {
        font-size: 1.2rem;
    }

    .subtitle {
        font-size: 0.8rem;
    }

    .lesson-card {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }

    .lesson-title {
        font-size: 1.1rem;
    }

    .teacher-progress {
        padding: 1rem;
    }

    /* Sidebar adjustments for mobile */
    .sidebar {
        width: 160px;
        padding: 1rem 0;
    }

    #app {
        margin-left: 160px;
    }

    .sidebar-header {
        padding: 0 0.75rem 1rem 0.75rem;
    }

    .sidebar-header h3 {
        font-size: 0.95rem;
    }

    .sidebar-link {
        font-size: 0.75rem;
        padding: 0.5rem 0.6rem;
    }

    .grade-icon {
        font-size: 1rem;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    /* Mini sidebar adjustments for mobile */
    .mini-sidebar {
        width: 150px;
        left: 160px;
        font-size: 0.75rem;
    }

    .mini-sidebar-subjects {
        left: 160px;
    }

    .mini-sidebar-chapters {
        left: 310px;
    }

    .mini-sidebar-header {
        padding: 0.8rem;
    }

    .mini-sidebar-header h3 {
        font-size: 0.85rem;
    }

    .mini-sidebar-link {
        font-size: 0.7rem;
        padding: 0.5rem 0.6rem;
    }

    .mini-close-btn {
        width: 24px;
        height: 24px;
        font-size: 1rem;
    }

    /* Header buttons for mobile */
    .header {
        padding: 1rem 0.8rem;
    }

    .header-buttons {
        gap: 0.5rem;
        width: 100%;
        justify-content: flex-start;
    }

    .btn-back,
    .btn-home {
        padding: 0.5rem 0.8rem;
        font-size: 0.9rem;
    }
}

/* ===================================
   Utility Classes
   =================================== */

.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ===================================
   Chapter Page Styles
   =================================== */

.chapter-page h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

/* ===================================
   Subject Page Styles
   =================================== */

.subject-page h2 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}
