/* ==========================================
   W3Schools-Style Info Boxes for Lessons
   ========================================== */

/* Note Box - Light Green */
.lesson-content .note-box,
.lesson-content .w3-note {
    background-color: #d4edda;
    border-left: 6px solid #04AA6D;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.lesson-content .note-box h4,
.lesson-content .w3-note h4 {
    color: #04AA6D;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Info Box - Light Blue */
.lesson-content .info-box {
    background-color: #d1ecf1;
    border-left: 6px solid #17a2b8;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.lesson-content .info-box h4 {
    color: #17a2b8;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Warning Box - Light Yellow */
.lesson-content .warning-box {
    background-color: #fff3cd;
    border-left: 6px solid #ffc107;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.lesson-content .warning-box h4 {
    color: #856404;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Danger/Important Box - Light Red */
.lesson-content .danger-box,
.lesson-content .important-box {
    background-color: #f8d7da;
    border-left: 6px solid #dc3545;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.lesson-content .danger-box h4,
.lesson-content .important-box h4 {
    color: #dc3545;
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 1.1rem;
}

/* Example Box - W3Schools Style */
.lesson-content .example-box,
.lesson-content .w3-example {
    background-color: #f1f1f1;
    border: 1px solid #ddd;
    border-radius: 5px;
    margin: 20px 0;
    overflow: hidden;
}

.lesson-content .example-box .example-header,
.lesson-content .w3-example .example-header {
    background-color: #04AA6D;
    color: white;
    padding: 10px 15px;
    font-weight: 600;
    font-size: 1rem;
}

.lesson-content .example-box .example-body,
.lesson-content .w3-example .example-body {
    padding: 15px;
    background-color: white;
}

.lesson-content .example-box pre,
.lesson-content .w3-example pre {
    margin: 0;
    background-color: #282c34;
    color: #abb2bf;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
}

.lesson-content .example-box .try-it-btn,
.lesson-content .w3-example .try-it-btn {
    background-color: #04AA6D;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background-color 0.3s;
}

.lesson-content .example-box .try-it-btn:hover,
.lesson-content .w3-example .try-it-btn:hover {
    background-color: #028a56;
}

/* Code inline */
.lesson-content code {
    background-color: #f4f4f4;
    color: #e83e8c;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
}

.lesson-content pre code {
    background-color: transparent;
    color: inherit;
    padding: 0;
}

/* Better Pre styling */
.lesson-content pre {
    background: #282c34 !important;
    color: #abb2bf !important;
    padding: 20px !important;
    border-radius: 8px !important;
    overflow-x: auto !important;
    margin: 20px 0 !important;
    border-left: 4px solid #04AA6D;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Highlight important words */
.lesson-content strong {
    color: #04AA6D;
    font-weight: 700;
}

/* Better list styling */
.lesson-content ul li::marker {
    color: #04AA6D;
}

.lesson-content ol li::marker {
    color: #04AA6D;
    font-weight: 700;
}

/* Emoji support - bigger */
.lesson-content li {
    line-height: 1.9;
}

/* H2 with icon */
.lesson-content h2 {
    color: #282A35 !important;
    font-size: 1.75rem !important;
    margin: 35px 0 20px !important;
    padding-bottom: 12px !important;
    border-bottom: 2px solid #04AA6D !important;
    font-weight: 700 !important;
}

.lesson-content h3 {
    color: #282A35 !important;
    font-size: 1.4rem !important;
    margin: 25px 0 15px !important;
    font-weight: 600 !important;
    background-color: #f1f1f1;
    padding: 10px 15px;
    border-radius: 5px;
    border-left: 4px solid #04AA6D;
}

/* Responsive images */
.lesson-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
}

/* Table styling */
.lesson-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.lesson-content table thead {
    background-color: #04AA6D;
    color: white;
}

.lesson-content table th,
.lesson-content table td {
    padding: 12px 15px;
    text-align: left;
    border: 1px solid #ddd;
}

.lesson-content table tbody tr:nth-child(even) {
    background-color: #f9f9f9;
}

.lesson-content table tbody tr:hover {
    background-color: #f1f1f1;
}

/* Quiz/Practice Box */
.lesson-content .quiz-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 30px 0;
}

.lesson-content .quiz-box h4 {
    color: white;
    margin-top: 0;
}

/* Remember Box */
.lesson-content .remember-box {
    background-color: #e7f3ff;
    border-left: 6px solid #2196F3;
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 5px;
}

.lesson-content .remember-box::before {
    content: "💡 ";
    font-size: 1.5rem;
}

/* Fun Fact Box */
.lesson-content .fun-box {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.lesson-content .fun-box h4 {
    color: white;
    margin-top: 0;
}

/* Better paragraph spacing */
.lesson-content p {
    line-height: 1.9;
    margin-bottom: 18px;
    color: #333;
}

/* Blockquote */
.lesson-content blockquote {
    border-left: 5px solid #04AA6D;
    padding-left: 20px;
    margin: 20px 0;
    font-style: italic;
    color: #666;
    background-color: #f9f9f9;
    padding: 15px 20px;
    border-radius: 5px;
}

/* ==========================================
   Enhanced Lesson Sidebar Styling
   ========================================== */
.lessons-sidebar {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 16px;
    padding: 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.lessons-sidebar .sidebar-title {
    background: linear-gradient(135deg, #04AA6D 0%, #028a56 100%);
    color: white;
    padding: 18px 25px;
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.lessons-sidebar .sidebar-title i {
    background: rgba(255, 255, 255, 0.25);
    padding: 10px;
    border-radius: 10px;
    font-size: 1rem;
    margin-right: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.lessons-sidebar .text-muted {
    color: #6c757d !important;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 10px;
}

.lessons-sidebar .lesson-list {
    list-style: none;
    padding: 15px 0;
    margin: 0;
    max-height: 600px;
    overflow-y: auto;
}

.lessons-sidebar .lesson-list::-webkit-scrollbar {
    width: 8px;
}

.lessons-sidebar .lesson-list::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

.lessons-sidebar .lesson-list::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #04AA6D, #028a56);
    border-radius: 10px;
}

.lessons-sidebar .lesson-list::-webkit-scrollbar-thumb:hover {
    background: #04AA6D;
}

.lessons-sidebar .lesson-item {
    margin: 0;
    position: relative;
}

.lessons-sidebar .lesson-item::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9ecef, transparent);
}

.lessons-sidebar .lesson-item:last-child::after {
    display: none;
}

.lessons-sidebar .lesson-item a {
    display: flex;
    align-items: center;
    padding: 14px 25px;
    color: #2c3e50;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 4px solid transparent;
    position: relative;
    letter-spacing: 0.2px;
    line-height: 1.4;
}

.lessons-sidebar .lesson-item a:hover {
    background: linear-gradient(90deg, rgba(4, 170, 109, 0.08) 0%, transparent 100%);
    color: #04AA6D;
    border-left-color: #04AA6D;
    padding-left: 30px;
    transform: translateX(2px);
}

.lessons-sidebar .lesson-item a i {
    opacity: 0;
    transition: all 0.3s ease;
    margin-right: 10px;
    font-size: 0.75rem;
    transform: translateX(-5px);
}

.lessons-sidebar .lesson-item a:hover i {
    opacity: 1;
    transform: translateX(0);
}

/* Active lesson highlight */
.lessons-sidebar .lesson-item.active a {
    background: linear-gradient(90deg, rgba(4, 170, 109, 0.12) 0%, rgba(4, 170, 109, 0.05) 100%);
    color: #04AA6D;
    border-left-color: #04AA6D;
    font-weight: 700;
}

.lessons-sidebar .lesson-item.active a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 4px;
    height: 60%;
    background: #04AA6D;
    border-radius: 0 4px 4px 0;
}

/* Lesson name styling */
.lessons-sidebar .lesson-item a span:not(.lesson-number) {
    flex: 1;
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Section Headers in Sidebar */
.lessons-sidebar .section-header {
    background: linear-gradient(90deg, rgba(4, 170, 109, 0.1), transparent);
    color: #04AA6D;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    padding: 12px 25px;
    margin: 15px 0 5px;
    border-left: 4px solid #04AA6D;
    display: flex;
    align-items: center;
}

.lessons-sidebar .section-header i {
    font-size: 0.9rem;
    opacity: 0.8;
}

.lessons-sidebar .section-header:first-child {
    margin-top: 0;
}

/* Sticky sidebar on scroll */
@media (min-width: 992px) {
    .lessons-sidebar {
        position: sticky;
        top: 90px;
        max-height: calc(100vh - 120px);
    }
}

/* Responsive */
@media (max-width: 991px) {
    .lessons-sidebar .lesson-item a {
        font-size: 0.9rem;
        padding: 12px 20px;
    }

    .lessons-sidebar .sidebar-title {
        font-size: 1.05rem;
        padding: 15px 20px;
    }
}