/* ===========================================
   TUTORIALS PAGE STYLES
   Colorful, modern design with sidebar navigation
   =========================================== */

/* CSS Variables for Tutorial Colors */
:root {
    --tut-primary: #1a237e;
    --tut-secondary: #D4AF37;
    --tut-csharp: #9b4dca;
    --tut-html: #e44d26;
    --tut-css: #264de4;
    --tut-js: #f7df1e;
    --tut-code-bg: #1e1e1e;
    --tut-code-text: #d4d4d4;
    --tut-output-bg: #0d2818;
    --tut-output-text: #4ec9b0;
    --tut-sidebar-bg: #f8f9fa;
    --tut-border: #e0e0e0;
}

/* Tutorial Page Layout */
.tutorial-container {
    display: flex;
    min-height: calc(100vh - 80px);
    margin-top: 80px;
}

/* Sidebar Navigation */
.tutorial-sidebar {
    width: 280px;
    background: var(--tut-sidebar-bg);
    border-right: 1px solid var(--tut-border);
    position: fixed;
    height: calc(100vh - 80px);
    overflow-y: auto;
    padding: 20px 0;
    z-index: 100;
}

.sidebar-header {
    padding: 15px 20px;
    border-bottom: 2px solid var(--tut-secondary);
    margin-bottom: 10px;
}

.sidebar-header h2 {
    font-size: 1.3rem;
    color: var(--tut-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header .icon {
    font-size: 1.5rem;
}

/* Sidebar Navigation Links */
.sidebar-nav {
    padding: 0;
}

.sidebar-section {
    margin-bottom: 5px;
}

.sidebar-section-title {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    font-weight: 600;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.sidebar-section-title:hover {
    background: #e8e8e8;
}

.sidebar-section-title.active {
    background: linear-gradient(90deg, rgba(212, 175, 55, 0.1) 0%, transparent 100%);
    border-left-color: var(--tut-secondary);
    color: var(--tut-primary);
}

.sidebar-section-title .color-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 10px;
}

.sidebar-section-title .arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.sidebar-section-title.expanded .arrow {
    transform: rotate(90deg);
}

/* Subsection Links */
.sidebar-subsections {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background: #fff;
}

.sidebar-subsections.show {
    max-height: 1000px;
}

.sidebar-link {
    display: block;
    padding: 10px 20px 10px 46px;
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border-left: 4px solid transparent;
}

.sidebar-link:hover {
    background: #f0f0f0;
    color: var(--tut-primary);
}

.sidebar-link.active {
    background: linear-gradient(90deg, rgba(26, 35, 126, 0.1) 0%, transparent 100%);
    border-left-color: var(--tut-primary);
    color: var(--tut-primary);
    font-weight: 500;
}

/* Tutorial Content Area */
.tutorial-content {
    flex: 1;
    margin-left: 280px;
    padding: 40px 60px;
    max-width: calc(100% - 280px);
    background: #fff;
}

/* Tutorial Header */
.tutorial-header {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 3px solid var(--tut-secondary);
}

.tutorial-breadcrumb {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 15px;
}

.tutorial-breadcrumb a {
    color: var(--tut-primary);
    text-decoration: none;
}

.tutorial-breadcrumb a:hover {
    text-decoration: underline;
}

.tutorial-title {
    font-size: 2.5rem;
    color: var(--tut-primary);
    margin: 0 0 15px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.tutorial-title .lang-badge {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 1rem;
    color: white;
}

.lang-badge.csharp { background: var(--tut-csharp); }
.lang-badge.html { background: var(--tut-html); }
.lang-badge.css { background: var(--tut-css); }
.lang-badge.js { background: var(--tut-js); color: #000; }

.tutorial-subtitle {
    font-size: 1.1rem;
    color: #666;
    margin: 0;
}

/* Section Styling */
.tutorial-section {
    margin-bottom: 50px;
}

.section-title {
    font-size: 1.8rem;
    color: var(--tut-primary);
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title .num {
    background: var(--tut-secondary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: bold;
}

.subsection-title {
    font-size: 1.4rem;
    color: #333;
    margin: 30px 0 15px 0;
}

/* Text Content */
.tutorial-text {
    font-size: 1.05rem;
    line-height: 1.8;
    color: #444;
    margin-bottom: 20px;
}

/* Key Concept Box */
.concept-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 5px solid var(--tut-primary);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 12px 12px 0;
}

.concept-box h4 {
    color: var(--tut-primary);
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.concept-box p {
    margin: 0;
    color: #333;
    line-height: 1.6;
}

/* Definition Box */
.definition-box {
    background: linear-gradient(135deg, #fff8e1 0%, #ffecb3 100%);
    border-left: 5px solid var(--tut-secondary);
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 12px 12px 0;
}

.definition-box h4 {
    color: #b8860b;
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.definition-box p {
    margin: 0;
    color: #5d4037;
    line-height: 1.6;
}

/* Tip Box */
.tip-box {
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-left: 5px solid #4caf50;
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 12px 12px 0;
}

.tip-box h4 {
    color: #2e7d32;
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.tip-box p {
    margin: 0;
    color: #1b5e20;
    line-height: 1.6;
}

/* Warning Box */
.warning-box {
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border-left: 5px solid #f44336;
    padding: 20px 25px;
    margin: 25px 0;
    border-radius: 0 12px 12px 0;
}

.warning-box h4 {
    color: #c62828;
    margin: 0 0 10px 0;
    font-size: 1.1rem;
}

.warning-box p {
    margin: 0;
    color: #b71c1c;
    line-height: 1.6;
}

/* Code Block Styling */
.code-container {
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.code-header {
    background: linear-gradient(135deg, #37474f 0%, #263238 100%);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.code-header .lang-label {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.code-header .lang-label .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.code-header .copy-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.code-header .copy-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.code-block {
    background: var(--tut-code-bg);
    padding: 20px;
    overflow-x: auto;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
}

.code-block pre {
    margin: 0;
    color: var(--tut-code-text);
}

/* Syntax Highlighting */
.code-block .keyword { color: #569cd6; }
.code-block .string { color: #ce9178; }
.code-block .comment { color: #6a9955; font-style: italic; }
.code-block .function { color: #dcdcaa; }
.code-block .number { color: #b5cea8; }
.code-block .class { color: #4ec9b0; }
.code-block .variable { color: #9cdcfe; }
.code-block .tag { color: #569cd6; }
.code-block .attribute { color: #9cdcfe; }
.code-block .value { color: #ce9178; }
.code-block .selector { color: #d7ba7d; }
.code-block .property { color: #9cdcfe; }

/* Output Block */
.output-container {
    margin: -10px 0 25px 0;
    border-radius: 0 0 12px 12px;
    overflow: hidden;
}

.output-header {
    background: linear-gradient(135deg, #1b5e20 0%, #2e7d32 100%);
    padding: 10px 20px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.output-block {
    background: var(--tut-output-bg);
    padding: 20px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--tut-output-text);
}

.output-block pre {
    margin: 0;
}

/* Flow Diagram Styles */
.diagram-container {
    margin: 30px 0;
    padding: 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8ec 100%);
    border-radius: 16px;
    text-align: center;
}

.diagram-title {
    font-size: 1.2rem;
    color: var(--tut-primary);
    margin-bottom: 25px;
    font-weight: 600;
}

.flow-diagram {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.flow-box {
    padding: 20px 30px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    min-width: 120px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.flow-box:hover {
    transform: translateY(-5px);
}

.flow-box.purple { background: linear-gradient(135deg, #9b4dca 0%, #7b1fa2 100%); }
.flow-box.blue { background: linear-gradient(135deg, #2196f3 0%, #1565c0 100%); }
.flow-box.green { background: linear-gradient(135deg, #4caf50 0%, #2e7d32 100%); }
.flow-box.orange { background: linear-gradient(135deg, #ff9800 0%, #e65100 100%); }
.flow-box.red { background: linear-gradient(135deg, #f44336 0%, #c62828 100%); }
.flow-box.navy { background: linear-gradient(135deg, #1a237e 0%, #0d1b4c 100%); }
.flow-box.gold { background: linear-gradient(135deg, #d4af37 0%, #b8860b 100%); }

.flow-box .title {
    font-size: 1rem;
    margin-bottom: 5px;
}

.flow-box .subtitle {
    font-size: 0.8rem;
    opacity: 0.9;
    font-weight: normal;
}

.flow-arrow {
    font-size: 2rem;
    color: var(--tut-secondary);
    font-weight: bold;
}

/* Vertical Flow Diagram */
.flow-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.flow-arrow-down {
    font-size: 2rem;
    color: var(--tut-secondary);
}

/* Table Styling */
.tutorial-table {
    width: 100%;
    border-collapse: collapse;
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.tutorial-table th {
    background: linear-gradient(135deg, var(--tut-primary) 0%, #0d1b4c 100%);
    color: white;
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
}

.tutorial-table td {
    padding: 12px 20px;
    border-bottom: 1px solid #eee;
}

.tutorial-table tr:nth-child(even) {
    background: #f8f9fa;
}

.tutorial-table tr:hover {
    background: #e3f2fd;
}

.tutorial-table code {
    background: #e8e8e8;
    padding: 3px 8px;
    border-radius: 4px;
    font-family: 'Consolas', monospace;
    font-size: 0.9rem;
}

/* Bullet List */
.tutorial-list {
    padding-left: 25px;
    margin: 20px 0;
}

.tutorial-list li {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #444;
}

.tutorial-list li strong {
    color: var(--tut-primary);
}

/* Navigation Buttons */
.tutorial-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px 25px;
    background: linear-gradient(135deg, var(--tut-primary) 0%, #0d1b4c 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-btn:hover {
    transform: translateX(5px);
    box-shadow: 0 5px 20px rgba(26, 35, 126, 0.3);
}

.nav-btn.prev:hover {
    transform: translateX(-5px);
}

.nav-btn .arrow {
    font-size: 1.2rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .tutorial-sidebar {
        width: 250px;
    }
    
    .tutorial-content {
        margin-left: 250px;
        padding: 30px 40px;
        max-width: calc(100% - 250px);
    }
}

@media (max-width: 768px) {
    .tutorial-container {
        flex-direction: column;
    }
    
    .tutorial-sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--tut-border);
    }
    
    .tutorial-content {
        margin-left: 0;
        padding: 30px 20px;
        max-width: 100%;
    }
    
    .tutorial-title {
        font-size: 1.8rem;
        flex-wrap: wrap;
    }
    
    .flow-diagram {
        flex-direction: column;
    }
    
    .flow-arrow {
        transform: rotate(90deg);
    }
    
    .tutorial-nav {
        flex-direction: column;
        gap: 15px;
    }
    
    .nav-btn {
        justify-content: center;
    }
}

/* Ensure mobile menu shows above sidebar on tutorial pages */
.nav-mobile {
    z-index: 200;
    position: relative;
    background: #000;
}
