/* ========================================
   CSS Variables & Reset
   ======================================== */

:root {
    /* Color Palette - Dinosaur Theme */
    --primary-color: #2d6a4f;
    --primary-dark: #1b4332;
    --primary-light: #40916c;
    --accent-color: #f4a261;
    --accent-hover: #e76f51;
    --background: #fefefe;
    --background-alt: #f8f9fa;
    --text-primary: #2b2d42;
    --text-secondary: #6c757d;
    --border-color: #dee2e6;
    --success: #52b788;
    --error: #e63946;
    --warning: #ffd60a;

    /* Typography */
    --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-heading: 'Georgia', 'Times New Roman', serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 3rem;
    --spacing-xl: 4rem;

    /* Layout */
    --max-width: 1200px;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-primary);
    line-height: 1.7;
    color: var(--text-primary);
    background-color: var(--background);
    overflow-x: hidden;
}

/* ========================================
   Accessibility
   ======================================== */

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    text-decoration: none;
    z-index: 100;
}

.skip-link:focus {
    top: 0;
}

/* ========================================
   Typography
   ======================================== */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: var(--spacing-sm);
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

.lead {
    font-size: 1.2rem;
    line-height: 1.8;
}

/* ========================================
   Layout Components
   ======================================== */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: var(--spacing-lg);
    color: var(--primary-dark);
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: var(--accent-color);
    margin: var(--spacing-sm) auto 0;
    border-radius: 2px;
}

/* ========================================
   Header & Navigation
   ======================================== */

.header {
    background: white;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: var(--spacing-sm) 0;
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.5rem;
    margin: 0;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: var(--spacing-md);
}

.nav-menu a {
    font-weight: 500;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.nav-menu a:hover {
    background: var(--background-alt);
    color: var(--primary-color);
}

/* ========================================
   Hero Section
   ======================================== */

.hero {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    padding: var(--spacing-xl) var(--spacing-md);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    min-height: 500px;
}

.hero-content {
    max-width: 600px;
}

.hero-title {
    font-size: 3rem;
    color: white;
    margin-bottom: var(--spacing-sm);
    animation: fadeInUp 0.8s ease-out;
}

.hero-subtitle {
    font-size: 1.4rem;
    margin-bottom: var(--spacing-md);
    color: rgba(255, 255, 255, 0.9);
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.hero-cta {
    display: flex;
    gap: var(--spacing-sm);
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.dinosaur-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 300px;
    animation: float 3s ease-in-out infinite;
}

.dinosaur-silhouette {
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 150"><ellipse cx="40" cy="100" rx="35" ry="45" fill="rgba(255,255,255,0.2)"/><ellipse cx="100" cy="80" rx="60" ry="50" fill="rgba(255,255,255,0.2)"/><path d="M 90 80 Q 120 60 150 70" stroke="rgba(255,255,255,0.2)" stroke-width="15" fill="none" stroke-linecap="round"/><circle cx="150" cy="70" r="20" fill="rgba(255,255,255,0.2)"/><rect x="30" y="130" width="8" height="20" fill="rgba(255,255,255,0.2)" rx="4"/><rect x="50" y="130" width="8" height="20" fill="rgba(255,255,255,0.2)" rx="4"/><rect x="90" y="115" width="8" height="20" fill="rgba(255,255,255,0.2)" rx="4"/><rect x="110" y="115" width="8" height="20" fill="rgba(255,255,255,0.2)" rx="4"/></svg>') no-repeat center;
    background-size: contain;
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.3));
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

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

/* ========================================
   Buttons
   ======================================== */

.btn {
    display: inline-block;
    padding: 0.75rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

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

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
}

.btn-secondary:hover {
    background: transparent;
    color: white;
}

/* ========================================
   Quick Answer Section
   ======================================== */

.quick-answer {
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--background-alt);
}

.answer-card {
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 900px;
    margin: 0 auto;
    border-left: 6px solid var(--accent-color);
}

.answer-card h2 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   About Section
   ======================================== */

.about-section {
    padding: var(--spacing-xl) var(--spacing-md);
}

.about-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
}

.about-card {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-top: 4px solid var(--primary-color);
}

.about-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-sm);
}

.about-card h3 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   Facts Section
   ======================================== */

.facts-section {
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--background-alt);
}

.facts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-md);
}

.fact-card {
    position: relative;
    height: 250px;
    perspective: 1000px;
    cursor: pointer;
}

.fact-front,
.fact-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    transition: transform 0.6s;
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.fact-front {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
}

.fact-back {
    background: white;
    transform: rotateY(180deg);
    border: 2px solid var(--primary-color);
}

.fact-card.flipped .fact-front {
    transform: rotateY(180deg);
}

.fact-card.flipped .fact-back {
    transform: rotateY(0deg);
}

.fact-number {
    font-size: 3rem;
    font-weight: 700;
    opacity: 0.3;
    display: block;
    margin-bottom: var(--spacing-xs);
}

.fact-prompt {
    margin-top: var(--spacing-sm);
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ========================================
   Interactive Quiz Section
   ======================================== */

.interactive-section {
    padding: var(--spacing-xl) var(--spacing-md);
    background: white;
}

.quiz-container {
    max-width: 800px;
    margin: 0 auto;
}

.quiz {
    background: var(--background-alt);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.question-text {
    font-size: 1.5rem;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-md);
}

.options {
    display: grid;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
}

.option-btn {
    background: white;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    font-size: 1rem;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background: var(--primary-light);
    color: white;
}

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

.option-btn.incorrect {
    background: var(--error);
    color: white;
    border-color: var(--error);
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.feedback {
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-md);
    font-weight: 500;
}

.feedback.correct {
    background: rgba(82, 183, 136, 0.2);
    color: var(--success);
    border-left: 4px solid var(--success);
}

.feedback.incorrect {
    background: rgba(230, 57, 70, 0.2);
    color: var(--error);
    border-left: 4px solid var(--error);
}

.quiz-controls {
    display: flex;
    gap: var(--spacing-sm);
    justify-content: center;
}

.quiz-progress {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 2px solid var(--border-color);
}

#score {
    display: block;
    text-align: center;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: var(--border-color);
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    transition: width 0.5s ease;
    width: 0%;
}

/* ========================================
   Comparison Section
   ======================================== */

.comparison-section {
    padding: var(--spacing-xl) var(--spacing-md);
    background: white;
}

.comparison-visual {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: var(--spacing-lg);
    padding: var(--spacing-lg);
    background: var(--background-alt);
    border-radius: var(--border-radius);
    margin: 0 auto;
    max-width: 800px;
}

.comparison-item {
    text-align: center;
    transition: var(--transition);
}

.comparison-item:hover {
    transform: scale(1.1);
}

.comparison-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-xs);
}

.comparison-item.highlight .comparison-icon {
    font-size: 5rem;
}

.comparison-item p {
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.comparison-item small {
    color: var(--text-secondary);
}

.comparison-item.highlight p {
    color: var(--primary-color);
}

/* ========================================
   FAQ Section
   ======================================== */

.faq-section {
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--background-alt);
}

.faq-list {
    max-width: 900px;
    margin: 0 auto;
}

.faq-item {
    background: white;
    margin-bottom: var(--spacing-sm);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.faq-question {
    width: 100%;
    background: none;
    border: none;
    padding: var(--spacing-md);
    text-align: left;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.faq-question:hover {
    background: var(--background-alt);
}

.faq-question h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-dark);
}

.faq-icon {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: transform 0.3s;
}

.faq-item.active .faq-icon {
    transform: rotate(45deg);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.faq-item.active .faq-answer {
    max-height: 500px;
}

.faq-answer p {
    padding: 0 var(--spacing-md) var(--spacing-md);
    color: var(--text-secondary);
    line-height: 1.8;
}

/* ========================================
   Expert Section
   ======================================== */

.expert-section {
    padding: var(--spacing-xl) var(--spacing-md);
    background: white;
}

.expert-card {
    max-width: 900px;
    margin: 0 auto;
    background: var(--background-alt);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
}

.expert-quote {
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background: white;
    border-left: 4px solid var(--accent-color);
    border-radius: var(--border-radius);
}

.expert-quote blockquote {
    font-size: 1.1rem;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.expert-quote cite {
    display: block;
    font-style: normal;
    font-weight: 600;
    color: var(--primary-color);
}

.expert-info h3 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-sm);
}

.source-list {
    list-style: none;
    padding-left: var(--spacing-sm);
}

.source-list li {
    padding: var(--spacing-xs) 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.source-list li::before {
    content: "📚 ";
    margin-right: var(--spacing-xs);
}

/* ========================================
   Related Topics
   ======================================== */

.related-topics {
    padding: var(--spacing-xl) var(--spacing-md);
    background: var(--background-alt);
}

.topics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-md);
    max-width: var(--max-width);
    margin: 0 auto;
}

.topic-card {
    background: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    cursor: pointer;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-top: 4px solid var(--accent-color);
}

.topic-card h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.topic-card p {
    color: var(--text-secondary);
    margin: 0;
}

/* ========================================
   Footer
   ======================================== */

.footer {
    background: var(--primary-dark);
    color: white;
    padding: var(--spacing-xl) var(--spacing-md) var(--spacing-md);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.footer-section h3 {
    color: white;
    margin-bottom: var(--spacing-sm);
}

.footer-section p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--spacing-xs);
}

.footer-section a {
    color: rgba(255, 255, 255, 0.8);
}

.footer-section a:hover {
    color: var(--accent-color);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: var(--spacing-md);
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 968px) {
    .hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-cta {
        justify-content: center;
    }

    .nav-menu {
        gap: var(--spacing-sm);
    }

    .section-title {
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    html {
        font-size: 14px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }

    .comparison-visual {
        flex-direction: column;
        align-items: center;
    }

    .comparison-item {
        margin-bottom: var(--spacing-sm);
    }

    .facts-grid,
    .about-grid,
    .topics-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .header,
    .hero-cta,
    .quiz-controls,
    .footer {
        display: none;
    }

    body {
        font-size: 12pt;
        color: black;
    }

    a {
        text-decoration: underline;
    }
}

/* ========================================
   Animations & Utilities
   ======================================== */

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease-out;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000;
        --text-primary: #000;
        --background: #fff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
