/* Reset & Basic Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-color: #000000;
    --card-bg: #1C1C1E;
    --secondary-bg: #2C2C2E;
    --text-primary: #FFFFFF;
    --text-secondary: #A1A1A6;
    --accent-color: #BB86FC;
    /* Purple */
    --accent-glow: rgba(187, 134, 252, 0.3);
    --border-color: #333333;
    --warning-bg: #2C2510;
    --warning-text: #FFD60A;
    --glass-bg: rgba(28, 28, 30, 0.8);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

html {
    scroll-behavior: smooth;
}

/* Container */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Typography */
h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
    line-height: 1.3;
}

h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--accent-color);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
}

h3 {
    font-size: 18px;
    font-weight: 700;
    margin: 20px 0 10px 0;
    color: var(--text-primary);
}

p {
    font-size: 16px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.instruction {
    font-weight: 500;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.caption {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-top: 8px;
}

.note {
    font-size: 14px;
    color: var(--warning-text);
    background-color: var(--warning-bg);
    padding: 12px;
    border-radius: 8px;
    margin-top: 15px;
}

/* Header & Progress */
.header {
    text-align: center;
    padding: 20px 0 10px 0;
    position: sticky;
    top: 0;
    background: var(--bg-color);
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
}

.header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    padding: 0 20px;
}

.logo {
    width: 120px;
    height: auto;
    margin-bottom: 0px;
}

.btn-menu {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--secondary-bg);
    border: none;
    color: var(--text-primary);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.progress-container {
    width: calc(100% - 40px);
    margin: 15px auto 0 auto;
    height: 6px;
    background: var(--secondary-bg);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color), #7F39FB);
    box-shadow: 0 0 10px var(--accent-glow);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.step-counter {
    font-size: 13px;
    color: var(--accent-color);
    font-weight: 700;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Card UI */
.card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Images */
.image-container {
    background-color: transparent;
    /* 투명 배경 PNG를 위해 투명으로 변경 */
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 15px;
    text-align: center;
}

.image-container img {
    width: 100%;
    height: auto;
    display: block;
}

/* Buttons */
.btn-download {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 18px;
    background-color: #6200EE;
    color: white;
    text-align: center;
    text-decoration: none;
    font-size: 18px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(98, 0, 238, 0.4);
    transition: all 0.2s;
    height: 60px;
    line-height: 24px;
    animation: pulse 2s infinite;
}

.btn-download:active {
    background-color: #3700B3;
    transform: scale(0.98);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(98, 0, 238, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(98, 0, 238, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(98, 0, 238, 0);
    }
}

.icon {
    margin-right: 10px;
    font-size: 20px;
}

/* Footer */
.footer {
    text-align: center;
    margin-top: 40px;
    padding-bottom: 60px;
    color: var(--text-secondary);
    font-size: 14px;
}

.footer a {
    color: var(--accent-color);
    text-decoration: underline;
}

.copyright {
    margin-top: 30px;
    font-size: 12px;
    color: #444;
}

/* Detailed Manual Specifics */
.checklist {
    list-style: none;
    background: var(--secondary-bg);
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.checklist li {
    font-size: 16px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    color: var(--text-primary);
}

.checklist li::before {
    content: "✓";
    margin-right: 12px;
    color: var(--accent-color);
    font-weight: bold;
}

.instruction-list {
    padding-left: 20px;
    margin-bottom: 15px;
}

.instruction-list li {
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--text-secondary);
}

.instruction-list strong {
    color: var(--text-primary);
}

/* Table Styles */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background-color: var(--bg-color);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    text-align: left;
}

th,
td {
    padding: 14px;
    border-bottom: 1px solid var(--border-color);
}

th {
    background-color: var(--secondary-bg);
    font-weight: 700;
    color: var(--accent-color);
}

td {
    color: var(--text-secondary);
}

/* Warning Box */
.warning {
    background-color: var(--warning-bg);
    border-left: 4px solid var(--warning-text);
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-size: 15px;
    color: var(--warning-text);
}

.warning strong {
    color: var(--warning-text);
}

/* Code Snippet */
code {
    background: #333;
    color: #E0E0E0;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 14px;
}

pre {
    background: #000;
    color: #A1A1A6;
    padding: 20px;
    border-radius: 12px;
    overflow-x: auto;
    margin: 15px 0;
    font-size: 13px;
    line-height: 1.6;
    border: 1px solid var(--border-color);
}

.btn-secondary {
    display: inline-block;
    padding: 12px 24px;
    background-color: var(--secondary-bg);
    color: var(--text-primary);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 15px;
    transition: background-color 0.2s;
}

.btn-secondary:active {
    background-color: var(--border-color);
}

/* Step Items */
.step-item {
    display: none;
    animation: fadeIn 0.5s ease;
}

.step-item.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Nav Buttons */
.nav-buttons {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(to top, var(--bg-color) 80%, transparent);
    display: flex;
    gap: 12px;
    z-index: 1000;
}

.btn-nav {
    flex: 1;
    padding: 16px;
    border-radius: 14px;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-prev {
    background: var(--secondary-bg);
    color: var(--text-primary);
}

.btn-next {
    background: var(--accent-color);
    color: #000;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.btn-nav:active:not(:disabled) {
    transform: scale(0.95);
}

.container {
    padding-bottom: 120px;
    /* Space for fixed buttons */
}

/* Hide original download button animation for steps */
.hw-step .btn-download {
    animation: none;
    margin-top: 20px;
}

/* H/W Steps Enhancement */
.hw-step {
    margin-bottom: 40px;
}

.hw-step:last-child {
    margin-bottom: 0;
}

.hw-step .instruction {
    display: block;
    margin-bottom: 12px;
    font-size: 18px;
}

hr {
    border: 0;
    border-top: 1px solid var(--border-color);
    margin: 30px 0;
}

/* Tutorial Meta & Badges */
.tutorial-meta {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.badge.time {
    background: #2C2C2E;
    color: var(--text-primary);
}

.badge.difficulty {
    background: #1A391A;
    color: #4ADE80;
}

/* Checklist Grid */
.checklist-grid {
    list-style: none;
    display: grid;
    gap: 12px;
    padding: 0;
}

.check-item {
    background: var(--secondary-bg);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.check-icon {
    font-size: 24px;
}

/* Success Card */
.success-card {
    text-align: center;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.next-steps {
    text-align: left;
    background: var(--secondary-bg);
    padding: 20px;
    border-radius: 12px;
    margin-top: 25px;
}

.next-steps h3 {
    margin-top: 0;
    font-size: 16px;
    color: var(--accent-color);
}

.next-steps-list {
    list-style: none;
    padding: 0;
}

.next-steps-list li {
    font-size: 14px;
    margin-top: 10px;
    color: var(--text-secondary);
    position: relative;
    padding-left: 15px;
}

.next-steps-list li::before {
    content: "•";
    color: var(--accent-color);
    position: absolute;
    left: 0;
}

/* Navigation Overlay Show */
.nav-overlay.show {
    display: flex;
    opacity: 1;
}

.nav-overlay {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.nav-modal {
    background: var(--card-bg);
    width: 90%;
    max-width: 400px;
    max-height: 80vh;
    border-radius: 24px;
    padding: 30px;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
}

/* Quick Jump List Styles */
.jump-list {
    list-style: none;
    padding: 0;
    margin: 20px 0 0 0;
}

.jump-item {
    margin-bottom: 8px;
}

.jump-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    background: var(--secondary-bg);
    transition: all 0.2s;
}

.jump-link:hover {
    background: #3A3A3C;
    transform: translateX(5px);
}

.jump-link:active {
    transform: scale(0.98);
}

.step-tag {
    background: var(--accent-color);
    color: #000;
    font-size: 11px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 6px;
    text-transform: uppercase;
    min-width: 55px;
    text-align: center;
}

.section-break {
    background: transparent;
    color: var(--warning-text);
    font-weight: 700;
    font-size: 16px;
    margin-top: 20px;
    margin-bottom: 10px;
    padding-left: 5px;
    border-left: 3px solid var(--warning-text);
    border-radius: 0;
    pointer-events: none;
}

.btn-close {
    background: var(--secondary-bg);
    border: none;
    color: var(--text-primary);
    width: 32px;
    height: 32px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
}