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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 40px 20px;
    transition: background 0.3s ease;
}

.container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: fadeIn 0.8s ease-in-out;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Back Link */
.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.back-link:hover {
    color: #764ba2;
    transform: translateX(-5px);
}

/* Typography */
h1 {
    color: #333;
    font-size: 2.5em;
    margin-bottom: 20px;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.description {
    color: #666;
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: 40px;
    text-align: center;
    transition: color 0.3s ease;
}

h2 {
    color: #444;
    font-size: 1.8em;
    margin-bottom: 20px;
    margin-top: 30px;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 15px;
}

h3 {
    color: #555;
    font-size: 1.2em;
    margin-bottom: 15px;
    transition: color 0.3s ease;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 0.6em;
    font-weight: bold;
}

/* Tutorial Sections */
.tutorial-section {
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f0f0f0;
}

.tutorial-section:last-of-type {
    border-bottom: none;
}

.tutorial-section p {
    color: #666;
    font-size: 1.05em;
    line-height: 1.6;
    margin-bottom: 20px;
    transition: color 0.3s ease;
}

/* Code Blocks */
pre {
    margin: 20px 0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

pre[class*="language-"] {
    margin: 20px 0;
    border-radius: 10px;
}

code {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.95em;
}

:not(pre) > code {
    background: #f4f4f4;
    padding: 2px 8px;
    border-radius: 4px;
    color: #e94560;
    font-size: 0.9em;
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border-left: 4px solid #667eea;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    color: #333;
    transition: all 0.3s ease;
}

.info-box strong {
    color: #667eea;
}

/* Carousel Styles */
.carousel {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
    overflow: hidden;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.carousel-container {
    display: flex;
    transition: transform 0.5s ease-in-out;
}

.carousel-slide {
    min-width: 100%;
    height: 500px;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Carousel Buttons */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 15px 20px;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    border-radius: 5px;
}

.carousel-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: translateY(-50%) scale(1.1);
}

.carousel-btn.prev {
    left: 20px;
}

.carousel-btn.next {
    right: 20px;
}

/* Carousel Indicators */
.carousel-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 10;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.indicator:hover {
    background: rgba(255, 255, 255, 0.8);
}

.indicator.active {
    background: white;
    transform: scale(1.2);
}

/* Demo Section */
.demo-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 40px;
    border-radius: 15px;
    margin: 40px 0;
}

/* Improvements Grid */
.improvements-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 30px;
}

.improvement-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 25px;
    border-radius: 12px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.improvement-card:hover {
    border-color: #667eea;
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.2);
}

.improvement-card h3 {
    margin-bottom: 15px;
}

.improvement-card pre {
    margin-top: 15px;
}

.improvement-card p {
    font-size: 0.95em;
    color: #666;
    margin: 0;
}

/* Footer Note */
.footer-note {
    background: linear-gradient(135deg, #fff3cd 0%, #ffe69c 100%);
    border-left: 4px solid #f39c12;
    padding: 20px;
    border-radius: 8px;
    margin-top: 40px;
    text-align: center;
}

.footer-note p {
    color: #333;
    margin: 0;
    font-size: 1.05em;
}

/* Theme Toggle Button */
.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5em;
    transition: all 0.3s ease;
    z-index: 1000;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
}

.theme-toggle .sun-icon,
.theme-toggle .moon-icon {
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.theme-toggle .moon-icon {
    opacity: 0;
    transform: rotate(180deg);
}

/* Dark Mode Styles */
body.dark-mode {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .container {
    background: #0f3460;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

body.dark-mode h1 {
    background: linear-gradient(135deg, #e94560 0%, #f39c12 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

body.dark-mode .description,
body.dark-mode .tutorial-section p {
    color: #bbb;
}

body.dark-mode h2,
body.dark-mode h3 {
    color: #e0e0e0;
}

body.dark-mode .back-link {
    color: #e94560;
}

body.dark-mode .back-link:hover {
    color: #f39c12;
}

body.dark-mode .step-number {
    background: linear-gradient(135deg, #e94560 0%, #f39c12 100%);
}

body.dark-mode .info-box {
    background: linear-gradient(135deg, #1e3a5f 0%, #2a4d7c 100%);
    border-left-color: #e94560;
    color: #e0e0e0;
}

body.dark-mode .info-box strong {
    color: #e94560;
}

body.dark-mode :not(pre) > code {
    background: #1a2332;
    color: #f39c12;
}

body.dark-mode .demo-section {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
}

body.dark-mode .improvement-card {
    background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
}

body.dark-mode .improvement-card:hover {
    border-color: #e94560;
    box-shadow: 0 10px 25px rgba(233, 69, 96, 0.2);
}

body.dark-mode .improvement-card p {
    color: #bbb;
}

body.dark-mode .footer-note {
    background: linear-gradient(135deg, #2d3436 0%, #34495e 100%);
    border-left-color: #f39c12;
}

body.dark-mode .footer-note p {
    color: #e0e0e0;
}

body.dark-mode .tutorial-section {
    border-bottom-color: #1a2332;
}

body.dark-mode .theme-toggle {
    background: #0f3460;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.3);
}

body.dark-mode .theme-toggle .sun-icon {
    opacity: 0;
    transform: rotate(-180deg);
}

body.dark-mode .theme-toggle .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 20px 10px;
    }

    .container {
        padding: 25px;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
        flex-direction: column;
        align-items: flex-start;
    }

    .carousel-slide {
        height: 300px;
    }

    .carousel-btn {
        padding: 10px 15px;
        font-size: 18px;
    }

    .carousel-btn.prev {
        left: 10px;
    }

    .carousel-btn.next {
        right: 10px;
    }

    .improvements-grid {
        grid-template-columns: 1fr;
    }

    pre[class*="language-"] {
        font-size: 0.85em;
    }
}
