/*
 * Blog Styles - EDUSHARK TRAINING
 * Centralized CSS for all blog/course content pages
 *
 * Color Themes (set via CSS variable --blog-theme-color):
 * - Week 1 (Blue): #0077b6
 * - Week 2 (Green): #2e7d32
 * - Week 3 (Orange): #e65100
 * - Week 4+ : Define as needed
 */

/* ========================================
   CSS Variables for Blog Theme
   ======================================== */
:root {
    /* Default theme color (can be overridden per page) */
    --blog-theme-color: #0077b6;
    --blog-theme-dark: #005a8c;
    --blog-theme-light: #e3f2fd;
    --blog-theme-gradient: linear-gradient(135deg, var(--blog-theme-color), var(--blog-theme-dark));
}

/* Theme presets - add class to body */
.theme-week1 {
    --blog-theme-color: #0077b6;
    --blog-theme-dark: #005a8c;
    --blog-theme-light: #e3f2fd;
}

.theme-week2 {
    --blog-theme-color: #2e7d32;
    --blog-theme-dark: #1b5e20;
    --blog-theme-light: #e8f5e9;
}

.theme-week3 {
    --blog-theme-color: #e65100;
    --blog-theme-dark: #bf360c;
    --blog-theme-light: #fff3e0;
}

.theme-week4 {
    --blog-theme-color: #7b1fa2;
    --blog-theme-dark: #4a0072;
    --blog-theme-light: #f3e5f5;
}

/* ========================================
   Blog Container & Layout
   ======================================== */
.blog-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 40px 20px;
}

.blog-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.blog-header h1 {
    font-size: 2.5rem;
    color: #1a1a2e;
    margin-bottom: 15px;
    line-height: 1.3;
}

.blog-header .subtitle {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 15px;
}

.blog-meta {
    color: #666;
    font-size: 0.95rem;
}

.blog-meta span {
    margin: 0 10px;
}

/* ========================================
   Blog Content Typography
   ======================================== */
.blog-content {
    line-height: 1.8;
    font-size: 1.1rem;
    color: #333;
}

.blog-content h2 {
    font-size: 1.8rem;
    color: var(--blog-theme-color);
    margin-top: 50px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid var(--blog-theme-color);
}

.blog-content h3 {
    font-size: 1.4rem;
    color: #1a1a2e;
    margin-top: 35px;
    margin-bottom: 15px;
}

.blog-content h4 {
    font-size: 1.2rem;
    color: #444;
    margin-top: 25px;
    margin-bottom: 12px;
}

.blog-content p {
    margin-bottom: 18px;
    text-align: justify;
}

.blog-content ul,
.blog-content ol {
    margin: 20px 0;
    padding-left: 25px;
}

.blog-content li {
    margin-bottom: 10px;
}

/* ========================================
   Day Sections
   ======================================== */
.day-section {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    padding: 30px;
    margin: 40px 0;
}

.day-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.day-number {
    background: var(--blog-theme-gradient);
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.day-header h2 {
    margin: 0;
    border: none;
    padding: 0;
    color: #1a1a2e;
}

.day-header .day-subtitle {
    margin: 5px 0 0;
    color: #666;
    font-size: 1rem;
}

/* ========================================
   Content Boxes
   ======================================== */
.highlight-box {
    background: linear-gradient(135deg, var(--blog-theme-light), var(--blog-theme-light));
    border-left: 4px solid var(--blog-theme-color);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.highlight-box h4 {
    color: var(--blog-theme-color);
    margin-top: 0;
}

.example-box {
    background: #fff9e6;
    border: 1px solid #ffd700;
    padding: 20px;
    margin: 25px 0;
    border-radius: 8px;
}

.example-box h4 {
    color: #b8860b;
    margin-top: 0;
}

.definition-box {
    background: #e3f2fd;
    border: 1px solid #1976d2;
    padding: 20px;
    margin: 25px 0;
    border-radius: 8px;
}

.definition-box strong {
    color: #1565c0;
}

.warning-box {
    background: #ffebee;
    border-left: 4px solid #c62828;
    padding: 20px;
    margin: 25px 0;
    border-radius: 0 8px 8px 0;
}

.warning-box h4 {
    color: #c62828;
    margin-top: 0;
}

.key-takeaway {
    background: var(--blog-theme-gradient);
    color: white;
    padding: 25px;
    border-radius: 12px;
    margin: 30px 0;
}

.key-takeaway h4 {
    color: white;
    margin-top: 0;
}

.key-takeaway ul {
    padding-left: 20px;
}

.key-takeaway li {
    margin-bottom: 8px;
}

/* ========================================
   Tables
   ======================================== */
.comparison-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    font-size: 0.95rem;
}

.comparison-table th,
.comparison-table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

.comparison-table th {
    background: var(--blog-theme-color);
    color: white;
}

.comparison-table tr:nth-child(even) {
    background: #f9f9f9;
}

.comparison-table tr:hover {
    background: #f5f5f5;
}

/* ========================================
   Code Blocks
   ======================================== */
.code-block {
    background: #1a1a2e;
    color: #e0e0e0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Courier New', Consolas, monospace;
    overflow-x: auto;
    margin: 20px 0;
    font-size: 0.95rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.code-block .keyword {
    color: #569cd6;
}

.code-block .function {
    color: #dcdcaa;
}

.code-block .string {
    color: #ce9178;
}

.code-block .comment {
    color: #6a9955;
}

.code-block .number {
    color: #b5cea8;
}

.sql-syntax {
    background: #f5f5f5;
    padding: 15px 20px;
    border-radius: 8px;
    font-family: 'Courier New', Consolas, monospace;
    margin: 15px 0;
    border: 1px solid #ddd;
}

/* ========================================
   Table of Contents
   ======================================== */
.toc {
    background: #f8f9fa;
    padding: 25px 30px;
    border-radius: 12px;
    margin: 30px 0;
}

.toc h3 {
    margin-top: 0;
    color: #1a1a2e;
}

.toc ul {
    list-style: none;
    padding-left: 0;
}

.toc li {
    margin: 8px 0;
}

.toc a {
    color: var(--blog-theme-color);
    text-decoration: none;
    transition: color 0.2s;
}

.toc a:hover {
    text-decoration: underline;
    color: var(--blog-theme-dark);
}

/* ========================================
   Video Section (Collapsible)
   ======================================== */
.video-toggle {
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.video-toggle summary {
    padding: 12px 18px;
    background: var(--blog-theme-gradient);
    color: white;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    list-style: none;
}

.video-toggle summary::-webkit-details-marker {
    display: none;
}

.video-toggle summary::before {
    content: "▶";
    font-size: 12px;
    transition: transform 0.2s;
}

.video-toggle[open] summary::before {
    transform: rotate(90deg);
}

.video-toggle summary:hover {
    filter: brightness(0.9);
}

.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ========================================
   Navigation Buttons
   ======================================== */
.nav-buttons {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #e0e0e0;
    gap: 15px;
}

.nav-btn {
    display: inline-block;
    padding: 12px 25px;
    background: var(--blog-theme-color);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: background 0.2s, transform 0.2s;
}

.nav-btn:hover {
    background: var(--blog-theme-dark);
    transform: translateY(-2px);
}

/* ========================================
   Author Bio Section
   ======================================== */
.author-section {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
}

.author-section h3 {
    margin-top: 0;
    color: #1565c0;
}

.author-content {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    align-items: flex-start;
}

.author-info {
    flex: 1;
    min-width: 280px;
}

.author-info h4 {
    color: #1a1a2e;
    margin-top: 0;
}

.author-info p {
    color: #555;
    line-height: 1.7;
}

.author-link {
    display: inline-block;
    padding: 10px 20px;
    background: linear-gradient(135deg, #1565c0, #0d47a1);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    margin-top: 15px;
    transition: transform 0.2s;
}

.author-link:hover {
    transform: translateY(-2px);
}

/* ========================================
   Quiz Section
   ======================================== */
.quiz-section {
    background: linear-gradient(135deg, #fff3e0, #ffe0b2);
    border-radius: 12px;
    padding: 30px;
    margin: 40px 0;
}

.quiz-section h3 {
    margin-top: 0;
    color: var(--blog-theme-color);
}

.quiz-question {
    background: #fff9e6;
    border: 1px solid #ffd700;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
}

.quiz-question h4 {
    color: #b8860b;
    margin-top: 0;
}

.quiz-question details summary {
    cursor: pointer;
    color: var(--blog-theme-color);
    font-weight: 500;
    padding: 8px 0;
}

.quiz-question details p {
    margin-top: 10px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 6px;
}

/* ========================================
   Mobile Responsive Styles
   ======================================== */
@media screen and (max-width: 768px) {
    .blog-container {
        padding: 30px 15px;
    }

    .blog-header h1 {
        font-size: 2rem;
        line-height: 1.2;
    }

    .blog-content {
        font-size: 1.05rem;
    }

    .blog-content h2 {
        font-size: 1.6rem;
        margin-top: 40px;
    }

    .day-section {
        padding: 25px 20px;
        margin: 30px 0;
    }

    .day-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .day-number {
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }

    .comparison-table {
        font-size: 0.9rem;
        display: block;
        overflow-x: auto;
    }

    .code-block {
        font-size: 0.85rem;
        padding: 15px;
    }

    .nav-buttons {
        flex-direction: column;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
    }

    .author-content {
        flex-direction: column;
    }
}

@media screen and (max-width: 480px) {
    .blog-header h1 {
        font-size: 1.6rem;
    }

    .blog-content {
        font-size: 1rem;
    }

    .blog-content p {
        text-align: left;
    }

    .day-section {
        padding: 20px 15px;
    }

    .code-block {
        font-size: 0.8rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 8px 10px;
    }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .video-toggle,
    .nav-buttons,
    .navbar,
    footer {
        display: none;
    }

    .day-section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }

    .blog-content h2 {
        page-break-after: avoid;
    }

    .code-block {
        background: #f5f5f5;
        color: #333;
        border: 1px solid #ddd;
    }
}
