/* =======================================
   LEARNING PLATFORM PROFESSIONAL STYLING
   W3Schools-Inspired Design
   ======================================= */

/* General Learning Layout */
.learning-container {
    max-width: 100%;
    padding: 0;
}

/* Sidebar Styling */
.learning-sidebar {
    background: #ffffff;
    padding: 0;
    height: calc(100vh - 100px);
    overflow-y: auto;
    position: sticky;
    top: 80px;
    border-right: 1px solid #e0e0e0;
    box-shadow: 2px 0 10px rgba(0,0,0,0.05);
}


.sidebar-subject-header {
    background: #f8f9fa;
    color: #1a252f;
    padding: 20px;
    border-bottom: 3px solid #04AA6D;
    margin-bottom: 0;
}

.sidebar-subject-header h3 {
    margin: 0 0 12px 0;
    font-size: 17px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #2c3e50;
}

.progress-container {
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    height: 26px;
    border: 1px solid #dee2e6;
}

.progress-bar-learning {
    background: #04AA6D;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 700;
    font-size: 13px;
    transition: width 0.3s ease;
}

/* Chapter Sections in Sidebar */
.sidebar-chapter {
    background: transparent;
    border-radius: 0;
    margin-bottom: 0;
    overflow: hidden;
    border-bottom: 1px solid #e9ecef;
}

.sidebar-chapter-header {
    background: #f1f3f5;
    color: #2c3e50;
    padding: 16px 20px;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-bottom: 1px solid #dee2e6;
}

.sidebar-chapter-header i {
    color: #04AA6D;
    font-size: 14px;
}

.sidebar-topics-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: #ffffff;
}

.sidebar-topics-list li {
    border-bottom: 1px solid #f1f3f5;
}

.sidebar-topics-list li:last-child {
    border-bottom: none;
}

.sidebar-topics-list li a {
    display: block;
    padding: 12px 20px;
    color: #495057;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s ease;
    position: relative;
    border-left: 3px solid transparent;
    font-weight: 500;
}

.sidebar-topics-list li a:hover {
    background: #f8f9fa;
    border-left-color: #04AA6D;
    color: #2c3e50;
    padding-left: 25px;
    transition: all 0.2s ease;
}

.sidebar-topics-list li.active a {
    background: #e7f5ee;
    color: #04AA6D !important;
    font-weight: 700;
    border-left-color: #04AA6D;
    border-left-width: 4px;
}

.sidebar-topics-list li.active a::before {
    content: '▶';
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 10px;
    color: #04AA6D;
}

/* Main Content Area */
.learning-content {
    background: white;
    padding: 40px;
    min-height: calc(100vh - 200px);
}

.learning-content h1 {
    color: #1a252f;
    font-size: 36px;
    margin-bottom: 20px;
    border-bottom: 4px solid #3498db;
    padding-bottom: 15px;
    font-weight: 700;
}

.learning-content h2 {
    color: #1a252f;
    font-size: 28px;
    margin-top: 30px;
    margin-bottom: 15px;
    padding-left: 15px;
    border-left: 4px solid #3498db;
    font-weight: 700;
}

.learning-content h3 {
    color: #1a252f;
    font-size: 22px;
    margin-top: 25px;
    margin-bottom: 12px;
    font-weight: 700;
}

.learning-content p {
    font-size: 16px;
    line-height: 1.8;
    color: #2d3748;
    margin-bottom: 15px;
}

.learning-content ul, .learning-content ol {
    padding-left: 30px;
    margin-bottom: 20px;
}

.learning-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}

/* Topic Meta Information */
.topic-meta {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.topic-meta-badge {
    background: white;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.topic-meta-badge i {
    margin-right: 5px;
}

.badge-time {
    border-left: 3px solid #3498db;
}

.badge-views {
    border-left: 3px solid #e74c3c;
}

.badge-chapter {
    border-left: 3px solid #2ecc71;
}

/* Code Examples Styling */
.learning-content pre {
     background: #ffffff;
    color: #2c3e50;
    border: 1px solid #e1e4e8;
    
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
    
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.learning-content code {
    font-family: 'Courier New', Consolas, monospace;
    font-size: 14px;
}

.learning-content :not(pre) > code {
    background: #f4f4f4;
    color: #c7254e;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 90%;
}

/* Example Boxes */
.example-box {
    background: #e7f3ff;
    border-left: 4px solid #2196f3;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.example-box::before {
    content: 'Example';
    display: block;
    font-weight: bold;
    color: #2196f3;
    margin-bottom: 10px;
    font-size: 14px;
}

.note-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.note-box::before {
    content: 'Note';
    display: block;
    font-weight: bold;
    color: #856404;
    margin-bottom: 10px;
    font-size: 14px;
}

.warning-box {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.warning-box::before {
    content: 'Warning';
    display: block;
    font-weight: bold;
    color: #721c24;
    margin-bottom: 10px;
    font-size: 14px;
}

.tip-box {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.tip-box::before {
    content: 'Tip';
    display: block;
    font-weight: bold;
    color: #155724;
    margin-bottom: 10px;
    font-size: 14px;
}

/* Navigation Buttons */
.topic-navigation {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #ecf0f1;
}

.nav-button {
    flex: 1;
    text-align: center;
    padding: 20px 30px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.nav-button-prev {
    background: #282A35;
    color: white;
    border: 2px solid #04AA6D;
}

.nav-button-prev:hover {
    background: #1e1f26;
}

.nav-button-next {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    font-weight: 600;
    border: 2px solid #2574a9;
}

.nav-button-next:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2574a9 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.nav-button-complete {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    color: #fff;
    font-weight: 600;
    border: 2px solid #1e8449;
}

.nav-button-complete:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
}

.nav-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.nav-button i {
    font-size: 24px;
}

.nav-button-title {
    font-size: 16px;
    font-weight: 600;
}

.nav-button-subtitle {
    font-size: 12px;
    opacity: 0.9;
}

/* Subject Cards (Index Page) */
.subject-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    border: 1px solid #e0e0e0;
}

.subject-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    border-color: #3498db;
}

.subject-card-image {
    height: 120px;
    overflow: hidden;
    position: relative;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
}

.subject-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.subject-card-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ffd700;
    color: #000;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
}

.subject-card-body {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.subject-card-icon {
    text-align: center;
    margin-bottom: 10px;
}

.subject-card-icon img {
    height: 40px;
    width: auto;
}

.subject-card-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a252f;
    margin-bottom: 10px;
    text-align: left;
    line-height: 1.3;
}

.subject-card-description {
    color: #4a5568;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
    flex: 1;
}

.subject-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid #ecf0f1;
}

.subject-card-link {
    color: #3498db;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
    font-size: 13px;
}

.subject-card-link:hover {
    color: #2980b9;
}

.subject-card-stats {
    color: #95a5a6;
    font-size: 12px;
}

/* Chapter Cards (Subject Page) */
.chapter-card {
    background: white;
    border-radius: 10px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    border-left: 5px solid #3498db;
}

.chapter-card:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.12);
    border-left-color: #2980b9;
}

.chapter-number {
    display: inline-block;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    font-weight: bold;
    margin-right: 15px;
}

.chapter-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.chapter-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a252f;
    margin: 0;
}

.chapter-description {
    color: #4a5568;
    margin-bottom: 15px;
    line-height: 1.7;
    font-size: 15px;
}

.chapter-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chapter-lessons {
    color: #3498db;
    font-weight: 600;
}

/* Responsive Design */
@media (max-width: 991px) {
    .learning-sidebar {
        position: relative;
        height: auto;
        margin-bottom: 30px;
    }
    
    .learning-content {
        padding: 20px;
    }
    
    .topic-navigation {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .learning-content h1 {
        font-size: 24px;
    }
    
    .learning-content h2 {
        font-size: 20px;
    }
    
    .learning-content {
        padding: 20px 15px;
    }
    
    .subject-card-image {
        height: 140px;
    }
    
    .sidebar-subject-header h3 {
        font-size: 16px;
    }
    
    .topic-navigation {
        gap: 10px;
    }
    
    .nav-button {
        padding: 15px 20px;
    }
}

@media (max-width: 576px) {
    .subject-card-image {
        height: 100px;
    }
    
    .subject-card-title {
        font-size: 15px;
    }
    
    .subject-card-description {
        font-size: 12px;
    }
    
    .subject-card-body {
        padding: 15px;
    }
}

/* Light Scrollbar for Sidebar */
.learning-sidebar::-webkit-scrollbar {
    width: 8px;
}

.learning-sidebar::-webkit-scrollbar-track {
    background: #f8f9fa;
}

.learning-sidebar::-webkit-scrollbar-thumb {
    background: #ced4da;
    border-radius: 4px;
}

.learning-sidebar::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Animation for Page Load */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.learning-content {
    animation: fadeInUp 0.5s ease;
}

/* Try It Yourself Button */
.try-it-button {
    background: #04AA6D;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.try-it-button:hover {
    background: #059862;
    box-shadow: 0 3px 10px rgba(4, 170, 109, 0.3);
}

/* Table Styling */
.learning-content table,
.learning-content .description table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
}

.learning-content table th,
.learning-content .description table th {
    background: #04AA6D;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    border: 1px solid #059862;
}

.learning-content table td,
.learning-content .description table td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    background: white;
}

.learning-content table tr:nth-child(even) td,
.learning-content .description table tr:nth-child(even) td {
    background: #f8f9fa;
}

.learning-content table tr:hover td,
.learning-content .description table tr:hover td {
    background: #e8f4f8;
}

/* Breadcrumb Enhancements */
.learning-breadcrumb {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.learning-breadcrumb .breadcrumb {
    margin-bottom: 0;
    background: transparent;
}

.learning-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: '›';
    font-size: 18px;
    color: #3498db;
}

.learning-breadcrumb .breadcrumb-item a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.learning-breadcrumb .breadcrumb-item a:hover {
    color: #2980b9;
}

.learning-breadcrumb .breadcrumb-item.active {
    color: #2c3e50;
    font-weight: 600;
}

/* Sidebar Chapter Collapse */
.sidebar-chapter.collapsed .sidebar-topics-list {
    display: none;
}

.sidebar-chapter-header {
    cursor: pointer;
    user-select: none;
}

.sidebar-chapter-header:hover {
    background: #e9ecef;
    transition: background 0.2s ease;
}

/* Search Box Enhancement */
.learning-search {
    background: white;
    border-radius: 50px;
    padding: 5px 5px 5px 25px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    margin-bottom: 30px;
}

.learning-search input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 15px;
    padding: 10px 15px;
}

.learning-search button {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border: none;
    color: white;
    padding: 12px 30px;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.learning-search button:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Topic Content Blockquotes */
.learning-content blockquote {
    background: #f9f9f9;
    border-left: 5px solid #3498db;
    padding: 20px 25px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
    border-radius: 0 8px 8px 0;
}

.learning-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Highlight Text */
.learning-content mark,
.learning-content .highlight {
    background: #04AA6D;
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Print Styles */
@media print {
    .learning-sidebar,
    .topic-navigation,
    .topic-meta {
        display: none !important;
    }
    
    .learning-content {
        padding: 0;
        max-width: 100%;
    }
}

/* Skeleton Loading */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Smooth Scrolling for Sidebar */
html {
    scroll-behavior: smooth;
}

/* Topic Reading Progress Bar */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #3498db 0%, #2980b9 100%);
    z-index: 9999;
    transition: width 0.2s ease;
}

/* Content Width Control */
.learning-content {
    max-width: 1200px;
}

/* Description Content Styling */
.learning-content .description {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

/* Force table header styling */
.learning-content .description table thead {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
}

.learning-content .description table thead th {
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%) !important;
    color: #ffffff !important;
    font-weight: 700 !important;
}

.learning-content .description h1,
.learning-content .description h2,
.learning-content .description h3,
.learning-content .description h4 {
    margin-top: 25px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.learning-content .description h2 {
    font-size: 26px;
    border-left: 4px solid #04AA6D;
    padding-left: 15px;
}

.learning-content .description h3 {
    font-size: 22px;
}

.learning-content .description p {
    margin-bottom: 15px;
    line-height: 1.8;
}

.learning-content .description ul,
.learning-content .description ol {
    margin-bottom: 20px;
    padding-left: 30px;
}

.learning-content .description li {
    margin-bottom: 8px;
    line-height: 1.7;
}

.learning-content .description img {
    max-width: 100%;
    height: auto;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.learning-content .description strong,
.learning-content .description b {
    font-weight: 600;
    color: #2c3e50;
}

.learning-content .description em,
.learning-content .description i {
    font-style: italic;
}

.learning-content .description blockquote {
    background: #f9f9f9;
    border-left: 5px solid #04AA6D;
    padding: 20px 25px;
    margin: 20px 0;
    font-style: italic;
    color: #555;
    border-radius: 0 8px 8px 0;
}

.learning-content .description code {
    background: #f4f4f4;
    color: #c7254e;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 90%;
    font-family: 'Courier New', Consolas, monospace;
}

.learning-content .description pre {
      background: #ffffff;
    color: #2c3e50;
    border: 1px solid #e1e4e8;
    border-radius: 8px;
    padding: 20px;
    overflow-x: auto;
    margin: 20px 0;
 
}

.learning-content .description pre code {
    background: transparent;
    
    color: #2c3e50;
    padding: 0;
}

@media (min-width: 1400px) {
    .learning-content {
        max-width: 1000px;
    }
}

/* Collapsible Sections */
.collapsible-section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 15px;
    overflow: hidden;
}

.collapsible-header {
    background: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s ease;
}

.collapsible-header:hover {
    background: #e9ecef;
}

.collapsible-content {
    padding: 20px;
    display: none;
}

.collapsible-section.active .collapsible-content {
    display: block;
}

.collapsible-section.active .collapsible-header {
    background: #3498db;
    color: white;
}
