/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-dark: #1a1a2e;
    --secondary-dark: #16213e;
    --accent-blue: #0f4c81;
    --accent-teal: #3a7ca5;
    --text-light: #e8f1f2;
    --text-muted: #b8c5d0;
    --border-color: #2d4263;
    --card-bg: rgba(22, 33, 62, 0.7);
    --hover-accent: #5ba3d0;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(180deg, #0a1128 0%, #1a1a2e 50%, #16213e 100%);
    color: var(--text-light);
    line-height: 1.8;
    overflow-x: hidden;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 40px;
}

.section {
    padding: 80px 0;
    position: relative;
}

.section-title {
    font-size: 2.8rem;
    text-align: center;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--text-light);
    letter-spacing: -0.5px;
}

.section-subtitle {
    text-align: center;
    font-size: 1.2rem;
    margin-bottom: 50px;
    color: var(--text-muted);
    font-weight: 300;
}

/* Hero Section */
.hero {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background: url('img/mosasauras2.png') center/cover no-repeat;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(180deg, rgba(10, 17, 40, 0.35) 0%, rgba(10, 17, 40, 0.55) 100%);
}

.hero-content {
    text-align: center;
    z-index: 10;
    position: relative;
}

.main-title {
    font-size: 5rem;
    font-weight: 700;
    margin-bottom: 20px;
    letter-spacing: -2px;
    text-shadow: 2px 2px 20px rgba(0, 0, 0, 0.7);
}

.hero-subtitle {
    font-size: 1.8rem;
    margin-bottom: 30px;
    font-weight: 300;
    color: #f0f4ff;
    text-shadow: 1px 1px 12px rgba(0, 0, 0, 0.85);
}

.hero-meta {
    font-size: 1.1rem;
    color: #e6ecff;
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
    text-shadow: 1px 1px 8px rgba(0, 0, 0, 0.85);
}

.hero-meta span {
    font-style: italic;
}

/* Discovery Section */
.discovery {
    background: var(--secondary-dark);
}

.discovery-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
    margin-top: 50px;
}

.discovery-content h3 {
    font-size: 2rem;
    margin-bottom: 25px;
    color: var(--hover-accent);
}

.discovery-content p {
    font-size: 1.1rem;
    line-height: 1.9;
    margin-bottom: 20px;
    color: var(--text-light);
}

.discovery-image img {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.image-caption {
    text-align: center;
    margin-top: 15px;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Anatomy Section */
.anatomy {
    background: var(--primary-dark);
}

.anatomy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.anatomy-card {
    background: var(--card-bg);
    padding: 35px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.anatomy-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-teal);
}

.anatomy-card h3 {
    font-size: 1.6rem;
    margin-bottom: 20px;
    color: var(--hover-accent);
    font-weight: 600;
}

.anatomy-card p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-light);
}

/* Size Comparison Section */
.size-comparison {
    background: var(--secondary-dark);
}

.comparison-container {
    margin-top: 50px;
}

.size-viz {
    background: rgba(0, 0, 0, 0.3);
    padding: 60px 40px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.scale-item {
    margin-bottom: 40px;
}

.scale-item:last-child {
    margin-bottom: 0;
}

.scale-bar {
    height: 60px;
    background: linear-gradient(90deg, var(--accent-teal), var(--hover-accent));
    border-radius: 4px;
    margin-bottom: 15px;
    transition: all 0.5s ease;
    box-shadow: 0 4px 15px rgba(58, 124, 165, 0.4);
    position: relative;
}

.scale-bar::after {
    content: attr(data-size) 'm';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    font-size: 1.2rem;
}

.scale-item span {
    display: block;
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 500;
}

.comparison-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.compare-btn {
    padding: 14px 28px;
    font-size: 1rem;
    background: var(--card-bg);
    color: var(--text-light);
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.compare-btn:hover,
.compare-btn.active {
    background: var(--accent-teal);
    border-color: var(--hover-accent);
    transform: translateY(-2px);
}

/* Paleobiology Section */
.paleobiology {
    background: var(--primary-dark);
}

.paleo-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    margin-top: 50px;
}

.paleo-feature img {
    width: 100%;
    border-radius: 8px;
    margin-bottom: 25px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.paleo-feature h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--hover-accent);
}

.paleo-feature p {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text-light);
}

/* Habitat Section */
.habitat {
    background: var(--secondary-dark);
}

.habitat-content {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 60px;
    margin-top: 50px;
}

.habitat-info h3 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: var(--hover-accent);
}

.habitat-info p {
    font-size: 1.05rem;
    line-height: 1.9;
    margin-bottom: 30px;
    color: var(--text-light);
}

.fossil-locations h3 {
    font-size: 1.8rem;
    margin-bottom: 30px;
    color: var(--hover-accent);
}

.locations-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.location-card {
    background: var(--card-bg);
    padding: 20px 25px;
    border-radius: 6px;
    border-left: 4px solid var(--accent-teal);
    transition: transform 0.3s ease;
}

.location-card:hover {
    transform: translateX(10px);
}

.location-card h4 {
    font-size: 1.3rem;
    margin-bottom: 8px;
    color: var(--text-light);
}

.location-card p {
    font-size: 1rem;
    color: var(--text-muted);
}

/* Taxonomy Section */
.taxonomy {
    background: var(--primary-dark);
}

.taxonomy-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.taxonomy-card {
    background: var(--card-bg);
    padding: 35px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.taxonomy-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-teal);
}

.taxonomy-card h3 {
    font-size: 1.7rem;
    margin-bottom: 25px;
    color: var(--hover-accent);
    font-weight: 600;
}

.taxonomy-card p {
    font-size: 1.05rem;
    line-height: 1.8;
    margin-bottom: 15px;
    color: var(--text-light);
}

.classification-tree p {
    margin-bottom: 10px;
    padding-left: 20px;
    border-left: 2px solid var(--accent-teal);
}

.classification-tree strong {
    color: var(--hover-accent);
}

.species-list {
    list-style: none;
    padding-left: 0;
}

.species-list li {
    padding: 12px 20px;
    margin-bottom: 10px;
    background: rgba(58, 124, 165, 0.15);
    border-radius: 4px;
    border-left: 3px solid var(--accent-teal);
    font-size: 1.05rem;
}

.species-list em {
    color: var(--hover-accent);
    font-style: italic;
}

/* Comparative Section */
.comparative {
    background: var(--secondary-dark);
}

.specimens-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-top: 50px;
}

.specimen-card {
    background: var(--card-bg);
    padding-bottom: 25px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.specimen-card.interactive:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(58, 124, 165, 0.3);
}

.specimen-card img {
    width: 100%;
    height: 240px;
    object-fit: cover;
}

.specimen-card h3 {
    font-size: 1.5rem;
    padding: 25px 25px 15px;
    color: var(--hover-accent);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
}

.specimen-card.interactive h3::after {
    content: '';
    flex-shrink: 0;
    width: 12px;
    height: 12px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    opacity: 0.7;
}

.specimen-card.interactive.active h3::after {
    transform: rotate(-135deg);
    opacity: 1;
}

.specimen-details {
    padding: 0 25px;
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-light);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
}

.specimen-card.active .specimen-details {
    max-height: 800px;
    padding: 15px 25px 0;
}

/* Timeline Section */
.timeline {
    background: var(--primary-dark);
}

.timeline-container {
    max-width: 900px;
    margin: 50px auto 0;
    position: relative;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background: var(--accent-teal);
}

.timeline-item {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 40px;
    margin-bottom: 60px;
    align-items: center;
}

.timeline-item:nth-child(odd) .timeline-content {
    grid-column: 1;
    text-align: right;
}

.timeline-item:nth-child(even) .timeline-content {
    grid-column: 3;
    text-align: left;
}

.timeline-marker {
    width: 20px;
    height: 20px;
    background: var(--hover-accent);
    border-radius: 50%;
    border: 4px solid var(--primary-dark);
    grid-column: 2;
    z-index: 10;
    transition: transform 0.3s ease;
}

.timeline-item:hover .timeline-marker {
    transform: scale(1.4);
}

.timeline-content {
    background: var(--card-bg);
    padding: 25px 30px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.timeline-item:hover .timeline-content {
    transform: translateY(-5px);
    border-color: var(--accent-teal);
}

.timeline-content h3 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: var(--hover-accent);
}

.timeline-content p {
    font-size: 1.05rem;
    line-height: 1.7;
    color: var(--text-light);
}

.timeline-content em {
    color: var(--hover-accent);
    font-style: italic;
}

/* Footer */
.footer {
    background: rgba(0, 0, 0, 0.5);
    padding: 60px 0 30px;
    border-top: 1px solid var(--border-color);
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

.footer-section h4 {
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: var(--hover-accent);
}

.footer-section p {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--text-muted);
}

.footer-meta {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    padding-top: 30px;
    border-top: 1px solid var(--border-color);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .container {
        padding: 0 30px;
    }

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

@media (max-width: 992px) {
    .main-title {
        font-size: 3.5rem;
    }

    .discovery-grid,
    .paleo-grid,
    .habitat-content {
        grid-template-columns: 1fr;
    }

    .anatomy-grid,
    .taxonomy-grid {
        grid-template-columns: 1fr;
    }

    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .timeline-container::before {
        left: 0;
    }

    .timeline-item {
        grid-template-columns: auto 1fr;
        gap: 20px;
    }

    .timeline-item:nth-child(odd) .timeline-content,
    .timeline-item:nth-child(even) .timeline-content {
        grid-column: 2;
        text-align: left;
    }

    .timeline-marker {
        grid-column: 1;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 50px 0;
    }

    .container {
        padding: 0 20px;
    }

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

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

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

    .hero-meta {
        flex-direction: column;
        gap: 10px;
    }

    .comparison-controls {
        flex-direction: column;
    }

    .compare-btn {
        width: 100%;
    }
}
