/* Universal CSS for Science-Human-Evolution Pages */
/* Based on analysis of human-fossils.html, chromosome2.html, ERV.html, vestigial.html, atavisms.html and other human evolution pages */

:root {
    /* Primary human evolution theme - orange/amber colors matching science.css */
    --primary-color: #e67e22;
    --primary-light: #f39c12;
    --primary-dark: #d35400;
    --primary-accent-color: #e74c3c;
    --primary-gradient: linear-gradient(135deg, #e67e22, #d35400);
    
    /* Secondary colors for different evidence types */
    --fossil-brown: #8d6e63;
    --dna-blue: #2196f3;
    --evolution-green: #4caf50;
    --genetics-purple: #9c27b0;
    --molecular-cyan: #00bcd4;
    --evidence-orange: #ff7043;
    
    /* Text colors */
    --text-dark: #333333;
    --text-light: #ffffff;
    --text-muted: #6c757d;
    --text-subtle: #999999;
    
    /* Background colors */
    --background-light: #f5f5f5;
    --background-white: #ffffff;
    --surface-light: #ffffff;
    --surface-dark: #1e1e1e;
    
    /* Design system */
    --border-radius: 12px;
    --box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 15px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    --transition-fast: all 0.2s ease;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--background-light);
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    max-width: 100vw;
}

.container {
    width: 100%;
    max-width: min(1200px, calc(100vw - 40px));
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    padding: 1rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 100;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all var(--transition);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-dark);
    text-decoration: none;
    letter-spacing: -0.5px;
    line-height: 1.1;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: translateY(-1px);
}

.logo-subtitle {
    font-size: 0.85rem;
    color: #666;
    font-weight: 400;
    margin-top: 2px;
    letter-spacing: 0.3px;
}

.navigation ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navigation a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 1.1rem;
    transition: all var(--transition);
    position: relative;
}

.navigation a:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width var(--transition);
}

.navigation a:hover:after,
.navigation a.active:after {
    width: 100%;
}

.mobile-menu-button {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

/* Hero Section */
.hero {
    background: var(--primary-gradient);
    color: white;
    padding: 8rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><circle cx="10" cy="10" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="10" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="10" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="50" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="50" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="50" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="10" cy="90" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="90" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="90" cy="90" r="2" fill="rgba(255,255,255,0.1)"/></svg>');
    opacity: 0.4;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 800px;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
    letter-spacing: -1px;
}

.hero p {
    font-size: 1.4rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
    max-width: 700px;
}

.parent-topic {
    font-size: 0.9rem;
    color: var(--primary-light);
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

/* Main Content Layout */
.main-content {
    padding: 5rem 0;
}

.two-column-layout {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.main-column {
    flex: 1;
}

/* Sidebar Navigation */
.sidebar {
    width: 300px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    position: sticky;
    top: 120px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
}

.sidebar-header {
    background-color: var(--primary-color);
    color: white;
    padding: 15px;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.sidebar-nav {
    padding: 10px 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    text-decoration: none;
    color: var(--text-dark);
    transition: var(--transition-fast);
    gap: 12px;
}

.sidebar-nav-item:hover {
    background-color: rgba(141, 110, 99, 0.1);
}

.sidebar-nav-item.active {
    background-color: rgba(141, 110, 99, 0.15);
    border-left: 4px solid var(--primary-color);
}

.sidebar-nav-item i {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    color: var(--primary-color);
}

/* Content Sections */
.content-section {
    margin-bottom: var(--spacing-xl);
    scroll-margin-top: 120px;
    background: var(--background-white);
    border-radius: var(--border-radius);
    padding: var(--spacing-lg);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.content-section:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.content-section h2 {
    color: var(--primary-color);
    border-bottom: 1px solid rgba(141, 110, 99, 0.3);
    padding-bottom: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.8rem;
    font-weight: 700;
}

.content-section h3 {
    font-size: 1.4rem;
    margin: var(--spacing-md) 0 var(--spacing-sm);
    color: var(--text-dark);
}

.content-section h4 {
    font-size: 1.2rem;
    margin: var(--spacing-sm) 0;
    color: var(--primary-dark);
}

.content-section p {
    margin-bottom: var(--spacing-sm);
    line-height: 1.7;
}

.content-section ul,
.content-section ol {
    margin: var(--spacing-sm) 0;
    padding-left: 2rem;
}

.content-section ul li,
.content-section ol li {
    margin-bottom: var(--spacing-xs);
    line-height: 1.6;
}

/* Fossil Gallery Styles */
.fossil-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
}

.fossil-card {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: var(--transition);
    border-top: 4px solid var(--fossil-brown);
}

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

.fossil-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #eee;
}

.fossil-info {
    padding: var(--spacing-md);
}

.fossil-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    color: var(--primary-color);
}

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

.fossil-title a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.fossil-common-name {
    font-style: italic;
    color: var(--text-muted);
    margin-bottom: var(--spacing-sm);
    font-size: 0.95rem;
}

.fossil-meta {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-sm);
    font-size: 0.9rem;
    color: var(--text-subtle);
}

.fossil-meta i {
    margin-right: var(--spacing-xs);
    color: var(--primary-color);
}

.fossil-description {
    line-height: 1.6;
    color: var(--text-dark);
}

/* Search Container */
.search-container {
    margin-bottom: var(--spacing-lg);
}

.search-container input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 2px solid rgba(141, 110, 99, 0.2);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(141, 110, 99, 0.1);
}

/* Evidence Items */
.evidence-item {
    background: rgba(141, 110, 99, 0.05);
    border-left: 4px solid var(--primary-color);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
}

.evidence-item:hover {
    background: rgba(141, 110, 99, 0.08);
    transform: translateX(2px);
}

.evidence-item h4 {
    color: var(--primary-dark);
    margin-bottom: var(--spacing-xs);
    font-size: 1.1rem;
}

/* Special Evidence Types */
.evidence-item.breakthrough {
    background: rgba(22, 160, 133, 0.08);
    border-left-color: #16a085;
}

.evidence-item.breakthrough h4 {
    color: #16a085;
}

/* Comparison Tables */
.comparison-table {
    margin: var(--spacing-lg) 0;
    overflow-x: auto;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: var(--background-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.comparison-table th,
.comparison-table td {
    padding: var(--spacing-sm) var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid rgba(141, 110, 99, 0.1);
}

.comparison-table th {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

.comparison-table tr:hover {
    background-color: rgba(141, 110, 99, 0.05);
}

/* Image Containers */
.image-container {
    margin: var(--spacing-lg) 0;
    text-align: center;
}

.image-container img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.image-caption {
    margin-top: var(--spacing-sm);
    font-style: italic;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Mathematical Content (for ERV calculations) */
.mjx-container {
    background: rgba(33, 150, 243, 0.05);
    padding: var(--spacing-sm);
    border-radius: var(--border-radius);
    margin: var(--spacing-sm) 0;
    border-left: 4px solid var(--dna-blue);
}

/* PDF Preview Styles */
.pdf-preview {
    background: var(--background-white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    margin: var(--spacing-lg) 0;
}

.pdf-preview-header {
    background-color: var(--primary-color);
    color: white;
    padding: var(--spacing-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.download-button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.download-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.pdf-frame {
    width: 100%;
    height: 600px;
    border: none;
}

/* Statistics Cards */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

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

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
}

.stat-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: var(--spacing-xs);
}

.stat-description {
    color: var(--text-muted);
    line-height: 1.5;
}

/* Utility Classes */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.active {
    opacity: 1;
    transform: translateY(0);
}

.text-center {
    text-align: center;
}

.text-muted {
    color: var(--text-muted);
}

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--spacing-xs); }
.mb-2 { margin-bottom: var(--spacing-sm); }
.mb-3 { margin-bottom: var(--spacing-md); }
.mb-4 { margin-bottom: var(--spacing-lg); }
.mb-5 { margin-bottom: var(--spacing-xl); }

/* Footer */
footer {
    background-color: var(--surface-dark);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr auto;
    gap: 4rem;
    align-items: start;
}

.footer-logo {
    font-size: 1.8rem;
    font-weight: 700;
    color: white;
    margin-bottom: var(--spacing-sm);
}

.footer-description {
    max-width: 400px;
    opacity: 0.7;
    margin-bottom: var(--spacing-lg);
}

.footer-links {
    list-style: none;
}

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

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: var(--transition);
}

.footer-links a:hover {
    color: white;
}

.copyright {
    margin-top: 4rem;
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
}

.changelog-button {
    display: inline-block;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: var(--spacing-xs) var(--spacing-md);
    border-radius: 20px;
    font-size: 0.9rem;
    transition: var(--transition);
}

.changelog-button:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
}

/* Scroll to Top Button */
.to-top-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 99;
    border: none;
    cursor: pointer;
}

.to-top-button.visible {
    opacity: 1;
    visibility: visible;
}

.to-top-button:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        max-width: 100%;
        padding: 0 var(--spacing-md);
    }
}

@media (max-width: 992px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .two-column-layout {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        position: relative;
        top: 0;
        margin-bottom: 30px;
        max-height: none;
    }
    
    .fossil-gallery {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    
    .stat-cards {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero {
        padding: 8rem 0 4rem;
    }

    .hero h1 {
        font-size: 2.6rem;
    }

    .hero p {
        font-size: 1.2rem;
    }
    
    .content-section {
        padding: var(--spacing-md);
    }
    
    .fossil-gallery {
        grid-template-columns: 1fr;
    }
    
    .fossil-image {
        height: 180px;
    }
    
    .stat-cards {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .header-container {
        padding: 0 15px;
    }

    .mobile-menu-button {
        display: block;
    }

    .navigation {
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: white;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        padding: 0;
        z-index: 99;
        display: none;
    }
    
    .navigation.active {
        display: block;
    }

    .navigation ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
    }
    
    .navigation ul li {
        width: 100%;
    }
    
    .navigation ul li a {
        display: block;
        padding: var(--spacing-sm) var(--spacing-md);
        border-bottom: 1px solid #eee;
    }

    .hero h1 {
        font-size: 2.2rem;
    }
    
    .hero p {
        font-size: 1.1rem;
    }
    
    .content-section h2 {
        font-size: 1.5rem;
    }
    
    .sidebar-nav-item {
        padding: 10px 15px;
    }
    
    .fossil-card {
        margin-bottom: var(--spacing-md);
    }
    
    .fossil-image {
        height: 160px;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .comparison-table {
        font-size: 0.9rem;
    }
    
    .comparison-table th,
    .comparison-table td {
        padding: var(--spacing-xs) var(--spacing-sm);
    }
}

/* Print Styles */
@media print {
    .navigation,
    .sidebar,
    .to-top-button,
    .mobile-menu-button {
        display: none;
    }
    
    .hero {
        background: none;
        color: var(--text-dark);
        padding: var(--spacing-lg) 0;
    }
    
    .content-section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
}



/* Objection dropdown styles */
.objection-dropdown {
    margin-bottom: 1rem;
}

.objection-header {
    background: rgba(230, 126, 34, 0.1);
    padding: 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
    border-left: 3px solid var(--primary-color);
}

.objection-header:hover {
    background: rgba(230, 126, 34, 0.2);
}

.objection-header h4 {
    margin: 0;
    color: var(--primary-dark);
}

.objection-content {
    background: rgba(230, 126, 34, 0.05);
    padding: 0 1rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.objection-dropdown.active .objection-content {
    max-height: 500px;
    padding: 1rem;
}

.objection-icon {
    transition: transform 0.3s ease;
}

.objection-dropdown.active .objection-icon {
    transform: rotate(180deg);
} 