:root {
    --bg-body: #f4f6f8;
    --bg-card: #ffffff;
    --primary-color: #8b0000;
    --primary-gradient: linear-gradient(135deg, #4a0000, #8b0000);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.06);
}

body.high-contrast {
    --bg-body: #000000;
    --bg-card: #121212;
    --primary-color: #ffff00;
    --primary-gradient: #121212;
    --text-main: #ffffff;
    --text-muted: #e2e8f0;
    --border-color: #444444;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 40px;
}

.hero {
    background: var(--primary-gradient);
    color: #ffffff;
    padding: 15px 20px 25px 20px;
    border-radius: 0 0 20px 20px;
    text-align: center;
}

.accessibility-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 20px;
    margin-bottom: 15px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.toolbar-label { font-size: 0.75rem; font-weight: bold; }

.toolbar-btns button {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: 4px;
}

.hero-content h1 { font-size: 1.8rem; font-weight: 800; }
.hero-content p { font-size: 0.85rem; opacity: 0.9; }

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    display: inline-block;
    margin-bottom: 5px;
}

.sticky-nav {
    position: sticky;
    top: 0;
    background: var(--bg-card);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.sticky-nav ul {
    display: flex;
    overflow-x: auto;
    list-style: none;
    padding: 10px 15px;
    gap: 15px;
    white-space: nowrap;
}

.sticky-nav a {
    text-decoration: none;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.85rem;
}

.sticky-nav a:hover { color: var(--primary-color); }

.main-container { max-width: 800px; margin: 0 auto; padding: 15px 10px; }
.section { margin-top: 25px; }

.section-title h2 { font-size: 1.25rem; }
.section-title p { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 10px; }

.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 18px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.card-header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.card-header-actions h3 { font-size: 1rem; }

.btn-audio {
    background: rgba(139, 0, 0, 0.08);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
    padding: 5px 10px;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
}

.description-text { font-size: 0.9rem; margin-bottom: 15px; }

.media-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 12px 0;
}

@media (max-width: 500px) { .media-grid { grid-template-columns: 1fr; } }

.media-placeholder {
    background: var(--bg-body);
    border: 1px dashed var(--border-color);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
}

.placeholder-tag { display: block; font-size: 0.75rem; color: var(--text-muted); font-weight: 600; }

.newton-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    margin: 15px 0;
}

.disk {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(red, orange, yellow, green, blue, indigo, violet, red);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    transition: transform 2.5s cubic-bezier(0.15, 0.85, 0.35, 1.2);
}

.disk.spinning { transform: rotate(1800deg); }

.btn-primary {
    background: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
}

.tech-box {
    background: rgba(139, 0, 0, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    margin: 15px 0;
    font-size: 0.85rem;
}
.tech-box h4 { color: var(--primary-color); margin-bottom: 6px; font-size: 0.9rem; }
.tech-box ul { padding-left: 18px; }

.fact-box {
    background: var(--bg-body);
    border-radius: 10px;
    padding: 12px;
    margin: 15px 0;
    border-left: 4px solid var(--primary-color);
    font-size: 0.85rem;
}

.fact-badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: bold;
}
.fact-badge.mito { background: #fee2e2; color: #dc2626; }
.fact-badge.fato { background: #d1fae5; color: #059669; }
.fact-box hr { border: none; border-top: 1px solid var(--border-color); margin: 8px 0; }

/* FLASHCARDS LADO A LADO E FUNCIONANDO */
.flashcard-group {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-top: 15px;
}

.flashcard {
    cursor: pointer;
    user-select: none;
}

.flashcard-inner {
    background: var(--bg-card);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 14px 10px;
    text-align: center;
    min-height: 110px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background 0.3s ease, color 0.3s ease;
}

.flashcard.flipped .flashcard-inner {
    background: var(--primary-color);
    color: #ffffff;
}

.card-type {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 4px;
}

.flashcard-back { display: none; }
.flashcard.flipped .flashcard-front { display: none; }
.flashcard.flipped .flashcard-back { display: block; }

footer { text-align: center; margin-top: 30px; padding: 15px; border-top: 1px solid var(--border-color); font-size: 0.8rem; }