/* Tutorial Page Styles */

/* Navigation */
.site-nav {
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    padding: 1rem 0;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-handwritten);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    text-decoration: none;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.8;
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-links a:hover {
    color: var(--primary);
}

.cta-link {
    background: var(--primary);
    color: white !important;
    padding: 0.6rem 1.5rem;
    border-radius: 8px;
    font-weight: 600;
}

.cta-link:hover {
    opacity: 0.9;
}

/* Tutorial Container */
.tutorial-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 200px);
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .separator {
    color: var(--text-tertiary);
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* Tutorial Article */
.tutorial-article {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 3rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

/* Tutorial Header */
.tutorial-header {
    margin-bottom: 3rem;
}

.tutorial-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.tutorial-meta span {
    background: var(--bg-primary);
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.category {
    color: var(--primary);
}

.difficulty {
    color: var(--text-secondary);
}

.read-time {
    color: var(--text-tertiary);
}

.tutorial-title {
    font-family: var(--font-handwriting);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.2;
    margin: 0;
}

/* Tutorial Layout */
.tutorial-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (max-width: 968px) {
    .tutorial-layout {
        grid-template-columns: 1fr;
    }

    .tutorial-sidebar {
        order: -1;
    }
}

/* Table of Contents */
.toc {
    position: sticky;
    top: 100px;
    background: var(--bg-primary);
    border-radius: 8px;
    padding: 1.5rem;
    max-height: calc(100vh - 150px);
    overflow-y: auto;
}

.toc h2 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 1rem 0;
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 0.75rem;
}

.toc a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    line-height: 1.5;
    transition: color 0.2s;
    display: block;
}

.toc a:hover {
    color: var(--primary);
}

/* Tutorial Content */
.tutorial-content {
    max-width: 100%;
}

.tutorial-content h2 {
    font-family: var(--font-handwriting);
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 2.5rem 0 1rem 0;
    padding-top: 1rem;
    border-top: 2px solid var(--border-primary);
}

.tutorial-content h2:first-child {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.tutorial-content h3 {
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 2rem 0 1rem 0;
}

.tutorial-content p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.tutorial-content ul,
.tutorial-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.tutorial-content li {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

.tutorial-content strong {
    font-weight: 600;
    color: var(--text-primary);
}

.tutorial-content code {
    background: var(--bg-primary);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--primary);
}

.tutorial-content pre {
    background: var(--bg-primary);
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary);
}

.tutorial-content pre code {
    background: none;
    padding: 0;
    color: var(--text-primary);
}

.tutorial-content blockquote {
    border-left: 4px solid var(--primary);
    padding-left: 1.5rem;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-style: italic;
}

.tutorial-content a {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.tutorial-content a:hover {
    border-bottom-color: var(--primary);
}

.tutorial-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.tutorial-content hr {
    border: none;
    border-top: 2px solid var(--border-primary);
    margin: 3rem 0;
}

.tutorial-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.tutorial-content thead {
    background: var(--bg-tertiary);
}

.tutorial-content th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-primary);
}

.tutorial-content td {
    padding: 1rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-primary);
}

.tutorial-content tr:last-child td {
    border-bottom: none;
}

.tutorial-content tbody tr:hover {
    background: var(--bg-secondary);
}

/* Tutorial Footer */
.tutorial-footer {
    border-top: 2px solid var(--border-primary);
    padding-top: 2rem;
    margin-top: 3rem;
}

.feedback {
    text-align: center;
    margin-bottom: 2rem;
}

.feedback p {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.feedback-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.feedback-thanks {
    color: var(--primary);
    font-weight: 600;
}

.tutorial-actions {
    display: flex;
    gap: 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-block;
    text-align: center;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-primary);
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    transform: translateY(-2px);
}

/* Site Footer */
.site-footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-primary);
    padding: 2rem 0;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 2rem;
    justify-content: center;
    margin-bottom: 1rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-content p {
    color: var(--text-tertiary);
    font-size: 0.9rem;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .tutorial-container {
        padding: 1rem;
    }

    .tutorial-article {
        padding: 1.5rem;
    }

    .toc {
        position: static;
        max-height: none;
    }

    .tutorial-actions {
        flex-direction: column;
    }

    .tutorial-actions .btn-primary,
    .tutorial-actions .btn-secondary {
        width: 100%;
    }

    .footer-links {
        flex-direction: column;
        gap: 1rem;
    }
}
