/* Tutorial Styles - MakersDeck */
/* Uses variables from styles.css */

.tutorial-container {
    max-width: 900px;
    margin: 40px auto;
    padding: 40px;
    background: var(--bg-card);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    border: 1px solid var(--border-card);
}

.tutorial-header {
    text-align: center;
    margin-bottom: 50px;
    padding-bottom: 40px;
    border-bottom: 2px solid var(--bg-dark-soft);
}

.tutorial-header h1 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 15px;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.tutorial-meta {
    font-size: 14px;
    color: var(--text-muted);
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-wrap: wrap;
    font-weight: 500;
}

.section {
    margin-bottom: 60px;
}

.section h2 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 25px;
    padding-bottom: 12px;
    border-bottom: 3px solid var(--accent-primary);
    display: inline-block;
    color: var(--text-primary);
}

.section h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--accent-primary);
    margin-top: 35px;
    margin-bottom: 18px;
}

.section p,
.tutorial-container>p,
.info-box p {
    margin-bottom: 20px;
    color: var(--text-secondary);
    line-height: 1.8;
}

/* Lists and Items */
.section ul,
.section ol,
.info-box ul,
.info-box ol {
    margin-bottom: 25px;
    padding-left: 20px;
}

.section li,
.info-box li {
    margin-bottom: 20px;
    /* Matched to paragraph margin-bottom */
    line-height: 1.8;
    color: var(--text-secondary);
}

.section li:last-child,
.info-box li:last-child {
    margin-bottom: 0;
}

/* Tables */
.specs-table,
.wiring-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 25px 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-card);
}

.specs-table th,
.wiring-table th {
    background: var(--bg-dark-medium);
    color: var(--accent-primary);
    padding: 15px;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 1px;
}

.specs-table td,
.wiring-table td {
    padding: 15px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--bg-dark-soft);
}

.specs-table tr:last-child td,
.wiring-table tr:last-child td {
    border-bottom: none;
}

.specs-table tr:nth-child(even) {
    background: var(--bg-page);
}

/* Info Boxes */
.info-box {
    background: var(--bg-page);
    border-left: 5px solid var(--accent-primary);
    padding: 25px;
    margin: 30px 0;
    border-radius: 0 12px 12px 0;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.info-box.tip {
    border-left-color: var(--color-success);
    background: rgba(72, 187, 120, 0.05);
}

.info-box.warning {
    border-left-color: var(--color-warning);
    background: rgba(237, 137, 54, 0.05);
}

.info-box h4 {
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Code Blocks */
pre {
    background: #1a1f2e;
    color: #e0e6ff;
    padding: 25px;
    border-radius: 14px;
    overflow-x: auto;
    margin: 30px 0;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid rgba(30, 58, 138, 0.4);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Circuit Container */
.circuit-container {
    text-align: center;
    margin: 40px 0;
    padding: 30px;
    background: var(--bg-page);
    border-radius: 16px;
    border: 1px solid var(--border-card);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.circuit-container img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    display: block;
    margin: 0 auto;
}

.circuit-caption {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 15px;
    font-style: italic;
}

/* PDF Bar */
.pdf-download-bar {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.pdf-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--accent-gradient);
    color: #fff;
    border: none;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(30, 58, 138, 0.4);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.pdf-btn:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 0 15px 35px rgba(30, 58, 138, 0.5);
}

/* Footer */
.tutorial-footer {
    margin-top: 80px;
    padding-top: 40px;
    border-top: 2px solid var(--bg-dark-soft);
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.tutorial-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 700;
}

@media (max-width: 768px) {
    .tutorial-container {
        padding: 15px;
        margin: 15px 8px;
        border-radius: 12px;
        overflow-x: hidden;
    }

    .tutorial-header h1 {
        font-size: 26px;
    }

    /* Code blocks mobile fixes */
    pre {
        padding: 15px;
        font-size: 12px;
        margin: 20px -15px;
        border-radius: 0;
        max-width: calc(100% + 30px);
    }

    /* Circuit/Image container mobile fixes */
    .circuit-container {
        padding: 15px;
        margin: 25px -15px;
        border-radius: 0;
        overflow-x: hidden;
        /* Hide overflow instead of scroll */
    }

    .circuit-container img {
        max-width: 100% !important;
        /* Override inline styles */
        width: 100% !important;
        /* Force full container width */
        height: auto !important;
        object-fit: contain;
        /* Maintain aspect ratio while fitting */
    }

    /* PDF button mobile sizing */
    .pdf-download-bar {
        bottom: 20px;
        right: 15px;
    }

    .pdf-btn {
        width: 44px;
        height: 44px;
        box-shadow: 0 6px 15px rgba(30, 58, 138, 0.35);
    }

    .pdf-btn svg {
        width: 20px;
        height: 20px;
    }

    /* Tables mobile */
    .specs-table,
    .wiring-table {
        font-size: 13px;
    }

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

    .section h2 {
        font-size: 22px;
    }

    .section h3 {
        font-size: 18px;
    }
}