/* === Tutorial Page Styles === */

/* === Donation Banner === */
.tutorial-support-banner {
    background: linear-gradient(135deg, rgba(247, 147, 26, 0.08) 0%, rgba(247, 147, 26, 0.03) 100%);
    border: 1px solid rgba(247, 147, 26, 0.2);
    border-radius: 8px;
    padding: 0.875rem 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.tutorial-support-banner svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    color: #f7931a;
}

.tutorial-support-banner p {
    margin: 0;
    line-height: 1.5;
}

.tutorial-support-banner a {
    color: #f7931a;
    text-decoration: underline;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.tutorial-support-banner a:hover {
    opacity: 0.8;
}

@media (max-width: 600px) {
    .tutorial-support-banner {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
}

.tutorial-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

/* === Tutorial Header === */
.tutorial-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.tutorial-header a:not(.tutorial-breadcrumb a) {
    color: var(--secondary);
    text-decoration: underline;
}

.tutorial-header a:not(.tutorial-breadcrumb a):hover {
    opacity: 0.8;
}

.tutorial-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.tutorial-breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.tutorial-breadcrumb a:hover {
    color: var(--secondary);
}

.tutorial-breadcrumb span {
    color: var(--text-muted);
}

.tutorial-title {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    line-height: 1.3;
}

.tutorial-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tutorial-tag {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: rgba(50, 208, 17, 0.1);
    border: 1px solid var(--secondary);
    border-radius: 4px;
    color: var(--secondary);
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tutorial-difficulty {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.tutorial-difficulty svg {
    width: 16px;
    height: 16px;
    color: var(--secondary);
}

.tutorial-intro {
    font-size: 1.15rem;
    color: var(--text-secondary);
    line-height: 1.7;
}

/* === Table of Contents === */
.tutorial-toc {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.tutorial-toc h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tutorial-toc ol {
    list-style: none;
    counter-reset: toc-counter;
    padding: 0;
    margin: 0;
}

.tutorial-toc li {
    counter-increment: toc-counter;
    margin-bottom: 0.5rem;
}

.tutorial-toc li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 0;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.tutorial-toc li a::before {
    content: counter(toc-counter);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    flex-shrink: 0;
}

.tutorial-toc li a:hover {
    color: var(--secondary);
}

.tutorial-toc li a:hover::before {
    border-color: var(--secondary);
    color: var(--secondary);
}

/* === Tutorial Sections === */
.tutorial-section {
    margin-bottom: 3rem;
    scroll-margin-top: 100px;
}

.tutorial-section h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.tutorial-section h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.tutorial-section h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

.tutorial-section p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 1rem;
}

.tutorial-section a {
    color: var(--secondary);
    text-decoration: underline;
    transition: opacity 0.2s ease;
}

.tutorial-section a:hover {
    opacity: 0.8;
}

/* === Lists === */
.tutorial-section ul,
.tutorial-section ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.tutorial-section ul {
    list-style: disc;
}

.tutorial-section ol {
    list-style: decimal;
}

.tutorial-section li {
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 0.5rem;
}

.tutorial-section li::marker {
    color: var(--secondary);
}

/* === Code Blocks === */
.tutorial-section pre {
    background: #0d1117;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.tutorial-section code {
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.9rem;
    color: #e6edf3;
}

.tutorial-section p code,
.tutorial-section li code {
    background: rgba(50, 208, 17, 0.1);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: var(--secondary);
    font-size: 0.85em;
}

/* === Callout Boxes === */
.callout {
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    display: flex;
    gap: 0.75rem;
}

.callout-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.callout-content {
    flex: 1;
}

.callout-content p {
    margin: 0;
    color: inherit;
}

.callout-note {
    background: rgba(56, 139, 253, 0.1);
    border: 1px solid rgba(56, 139, 253, 0.4);
    color: #79c0ff;
}

.callout-note .callout-icon {
    color: #58a6ff;
}

.callout-tip {
    background: rgba(50, 208, 17, 0.1);
    border: 1px solid rgba(50, 208, 17, 0.4);
    color: #7ee787;
}

.callout-tip .callout-icon {
    color: var(--secondary);
}

.callout-warning {
    background: rgba(210, 153, 34, 0.1);
    border: 1px solid rgba(210, 153, 34, 0.4);
    color: #e3b341;
}

.callout-warning .callout-icon {
    color: #d29922;
}

/* === Tables === */
.table-wrapper {
    overflow-x: auto;
    margin-bottom: 1rem;
}

.tutorial-section table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

.tutorial-section th,
.tutorial-section td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
}

.tutorial-section th {
    background: var(--bg-elevated);
    color: var(--text-primary);
    font-weight: 600;
    white-space: nowrap;
}

.tutorial-section td {
    word-break: break-word;
}

.tutorial-section tr:last-child td {
    border-bottom: none;
}

/* === Images === */
.tutorial-section img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 1rem 0;
}

/* === Section Navigation === */
.tutorial-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
}

.tutorial-nav-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.tutorial-nav-btn:hover {
    border-color: var(--secondary);
    color: var(--secondary);
}

.tutorial-nav-btn svg {
    width: 18px;
    height: 18px;
}

.tutorial-nav-btn.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* === Images === */
.tutorial-section img,
.tutorial-header img {
    display: block;
    max-width: 400px;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.5rem 0;
    cursor: zoom-in;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.callout-content img {
    display: block;
    max-width: 300px;
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1rem 0;
    cursor: zoom-in;
    border: 1px solid var(--border);
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.tutorial-section img:hover,
.tutorial-header img:hover,
.callout-content img:hover {
    box-shadow: 0 4px 20px rgba(50, 208, 17, 0.2);
    border-color: var(--secondary);
}

/* Image Lightbox */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* === Responsive === */
@media (max-width: 768px) {
    .tutorial-content {
        padding: 1.5rem 1rem;
    }
    
    .tutorial-title {
        font-size: 1.75rem;
    }
    
    .tutorial-intro {
        font-size: 1rem;
    }
    
    .tutorial-section h2 {
        font-size: 1.3rem;
    }
    
    .tutorial-section h3 {
        font-size: 1.1rem;
    }
    
    .tutorial-toc {
        padding: 1rem;
    }
    
    .tutorial-nav {
        flex-direction: column;
    }
    
    .tutorial-nav-btn {
        justify-content: center;
    }
}
