:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-color: #2c3e50;
    --text-secondary: #6c757d;
    --border-color: #e9ecef;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --accent-color: #fcb426;
    --accent-hover: #e3a021;
    --step-bg: #ecf0f1;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --card-bg: #2d2d2d;
    --text-color: #ffffff;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --accent-color: #fcb426;
    --accent-hover: #e3a021;
    --step-bg: #404040;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
    padding-top: 50px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.theme-toggle {
    position: absolute;
    top: 2rem;
    right: 2rem;
    background: var(--card-bg);
    border: 2px solid var(--border-color);
    border-radius: 50px;
    width: 60px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    z-index: 100;
}

.theme-toggle:hover {
    border-color: var(--accent-color);
}

.theme-toggle .toggle-ball {
    width: 24px;
    height: 24px;
    background: var(--accent-color);
    border-radius: 50%;
    transition: transform 0.3s ease;
}

[data-theme="dark"] .theme-toggle .toggle-ball {
    transform: translateX(30px);
}

.instruction-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.step-number {
    background: var(--step-bg);
    color: var(--text-color);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.instruction-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.instruction-image {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    object-fit: cover;
    object-position: center;
    clip-path: inset(4px);
}

.download-button {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.download-button:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.completion-note {
    background: linear-gradient(135deg, var(--accent-color), var(--accent-hover));
    color: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 2rem;
    font-size: 1.2rem;
    font-weight: 500;
}

.back-button {
    position: absolute;
    top: 2rem;
    left: 2rem;
    background: var(--card-bg);
    color: var(--text-color);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 16px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 100;
}

.back-button:hover {
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-button::before {
    content: "←";
    font-size: 1.2rem;
}

/* Table of contents specific styles */
.toc-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
}

.toc-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.toc-card h3 {
    color: var(--text-color);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.toc-card p {
    color: var(--text-secondary);
    font-size: 1rem;
    margin-bottom: 1rem;
}

.toc-link {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.toc-link:hover {
    background: var(--accent-hover);
}

.toc-link::after {
    content: "→";
    margin-left: 8px;
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .instruction-card {
        padding: 1.5rem;
    }

    .toc-card {
        padding: 1rem;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }

    .back-button {
        top: 1rem;
        left: 1rem;
        padding: 6px 12px;
        font-size: 0.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }
}