:root[data-theme="dark"] {
    --bg-primary: #1a1a1a;
    --bg-secondary: #2d2d2d;
    --text-primary: #ffffff;
    --text-secondary: #b3b3b3;
    --accent-primary: #00599c;
    --accent-secondary: #004482;
    --card-bg: #333333;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --code-bg: #1e1e1e;
    --code-text: #d4d4d4;
}

:root[data-theme="light"] {
    --bg-primary: #f5f5f5;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --accent-primary: #00599c;
    --accent-secondary: #0077cc;
    --card-bg: #ffffff;
    --success: #4caf50;
    --error: #f44336;
    --warning: #ff9800;
    --code-bg: #f8f9fa;
    --code-text: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.3s, color 0.3s;
}

body {
    font-family: 'Segoe UI', sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Navbar */
nav {
    background-color: var(--bg-secondary);
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 1.1rem;
    transition: color 0.3s;
}

.logo a:hover {
    color: var(--accent-primary);
}

.nav-title {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-primary);
}

/* Container Principal */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.section {
    background: var(--bg-secondary);
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
    animation: fadeIn 0.5s ease-out;
}

/* Explicação */
.content {
    margin: 2rem 0;
}

h1, h2 {
    color: var(--accent-primary);
    margin-bottom: 1rem;
}

.type-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.type-card {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.type-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.type-card h3 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

code {
    display: block;
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
    font-family: 'Consolas', monospace;
    overflow-x: auto;
    white-space: pre;
    font-size: 0.9rem;
    line-height: 1.4;
}

pre {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 1.5rem;
    border-radius: 4px;
    overflow-x: auto;
    font-family: 'Consolas', monospace;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.warning-box {
    background: var(--warning);
    color: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
    display: flex;
    align-items: center;
    gap: 1rem;
    animation: pulse 2s infinite;
}

/* Quiz */
.quiz-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--accent-primary);
}

.progress {
    color: var(--text-secondary);
    font-size: 1.1rem;
    font-weight: bold;
}

.question {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.question h3 {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    line-height: 1.4;
}

.options {
    display: grid;
    gap: 1rem;
    margin-top: 1rem;
}

.option {
    background: var(--bg-secondary);
    padding: 1rem;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.option:hover {
    border-color: var(--accent-primary);
    transform: translateX(10px);
}

.option.selected {
    background: var(--accent-primary);
    color: white;
}

.option.correct {
    background: var(--success);
    color: white;
}

.option.wrong {
    background: var(--error);
    color: white;
}

.explanation {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--bg-primary);
    border-left: 4px solid var(--accent-primary);
    border-radius: 0 4px 4px 0;
}

/* Botões */
.btn {
    background: var(--accent-primary);
    color: white;
    border: none;
    padding: 1rem 2rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
}

.btn:hover {
    background: var(--accent-secondary);
    transform: translateY(-2px);
}

/* Resultado */
.result-container {
    text-align: center;
    padding: 2rem;
}

.score {
    font-size: 2.5rem;
    margin: 2rem 0;
    color: var(--accent-primary);
    font-weight: bold;
}

.feedback {
    margin: 2rem 0;
    padding: 1.5rem;
    border-radius: 8px;
    font-size: 1.2rem;
}

.feedback.good {
    background: var(--success);
    color: white;
}

.feedback.bad {
    background: var(--error);
    color: white;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    transition: transform 0.3s;
}

.theme-toggle:hover {
    transform: rotate(180deg);
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

/* Lista estilizada */
ul {
    list-style: none;
    margin: 1.5rem 0;
}

ul li {
    margin-bottom: 0.5rem;
    padding-left: 1.5rem;
    position: relative;
}

ul li::before {
    content: "•";
    color: var(--accent-primary);
    font-weight: bold;
    position: absolute;
    left: 0;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        margin: 1rem;
    }

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

    .quiz-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .section {
        padding: 1rem;
    }

    .option:hover {
        transform: none;
    }

    code, pre {
        font-size: 14px;
    }

    .warning-box {
        flex-direction: column;
        text-align: center;
    }
}