/* Modern Reset & Base Styles */
:root {
    --bg-color: #0f1719;
    --text-color: #ecf0f1;
    --primary-color: #27ae60;
    --accent-color: #e67e22;
    --card-bg: rgba(255, 255, 255, 0.05);
    /* Glassmorphism base */
    --card-border: rgba(255, 255, 255, 0.1);
    --header-font: 'Oswald', sans-serif;
    --body-font: 'Lato', sans-serif;
    --card-border: rgba(255, 255, 255, 0.1);
    --header-font: 'Oswald', sans-serif;
    --body-font: 'Lato', sans-serif;
    --transition-speed: 0.3s;
}

/* Scroll Animation Class */
.visible {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

body {
    font-family: var(--body-font);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.6;
    background-image: radial-gradient(circle at 20% 20%, rgba(39, 174, 96, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(230, 126, 34, 0.05) 0%, transparent 40%);
    background-attachment: fixed;
    overflow-x: hidden;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 1s ease-out forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s ease-out forwards;
    opacity: 0;
}

.delay-1 {
    animation-delay: 0.3s;
}

/* Hero Section */
.hero {
    position: relative;
    height: 70vh;
    background: url('images/hero-bg.png') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin-bottom: 2rem;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(15, 23, 25, 0.3), var(--bg-color));
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

.hero h1 {
    font-family: var(--header-font);
    font-size: 4rem;
    margin: 0 0 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    letter-spacing: 2px;
}

.hero p {
    font-size: 1.5rem;
    color: #bdc3c7;
    margin-bottom: 30px;
}

.cta-button {
    display: inline-block;
    padding: 12px 35px;
    background-color: var(--accent-color);
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-speed);
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.4);
}

.cta-button:hover {
    background-color: #d35400;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(230, 126, 34, 0.6);
}

/* Controls (Filter & Search) */
.controls-container {
    max-width: 1200px;
    margin: 0 auto 30px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    border: 1px solid var(--card-border);
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-box i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #bdc3c7;
}

.search-box input {
    width: 100%;
    padding: 12px 12px 12px 45px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    color: #fff;
    font-family: var(--body-font);
    font-size: 1rem;
    outline: none;
    transition: var(--transition-speed);
}

.search-box input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary-color);
}

.filter-buttons {
    display: flex;
    gap: 10px;
}

.filter-btn {
    padding: 8px 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: #bdc3c7;
    border-radius: 20px;
    cursor: pointer;
    transition: all var(--transition-speed);
    font-family: var(--header-font);
    text-transform: uppercase;
    font-size: 0.9rem;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    box-shadow: 0 2px 10px rgba(39, 174, 96, 0.3);
}

/* Card Grid */
.container {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    padding-bottom: 60px;
}

.dino-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all var(--transition-speed);
    position: relative;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    /* Initial state for animation */
    opacity: 0;
    transform: translateY(30px);
    cursor: pointer;
}

.dino-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    border-color: rgba(255, 255, 255, 0.2);
}

.dino-image {
    position: relative;
    height: 240px;
    overflow: hidden;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.05) 0%, rgba(0, 0, 0, 0.2) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.dino-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    padding: 20px;
    filter: drop-shadow(0 10px 10px rgba(0, 0, 0, 0.3));
}

.dino-card:hover .dino-image img {
    transform: scale(1.1) rotate(2deg);
    /* Added slight rotation for fun */
}

.era-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: var(--accent-color);
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: bold;
    text-transform: uppercase;
    font-family: var(--header-font);
    backdrop-filter: blur(2px);
}

.dino-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.dino-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.dino-info h2 {
    margin: 0;
    font-family: var(--header-font);
    font-size: 1.6rem;
    color: #fff;
}

.type-icon {
    font-size: 1.4rem;
    background: rgba(255, 255, 255, 0.05);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.carnivore {
    color: #e74c3c;
    box-shadow: 0 0 10px rgba(231, 76, 60, 0.2);
}

.herbivore {
    color: #27ae60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.2);
}

.years {
    color: var(--accent-color);
    font-weight: 400;
    font-size: 0.9rem;
    margin: 5px 0 15px;
    letter-spacing: 0.5px;
}

hr {
    border: 0;
    height: 1px;
    background: rgba(255, 255, 255, 0.1);
    width: 100%;
    margin-bottom: 15px;
}

.desc {
    font-size: 0.95rem;
    color: #bdc3c7;
    margin-bottom: 20px;
    flex-grow: 1;
}

.btn {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    width: 100%;
    font-weight: bold;
    transition: all var(--transition-speed);
    font-family: var(--header-font);
    text-transform: uppercase;
}

.btn:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Footer */
footer {
    text-align: center;
    padding: 40px 0;
    color: #7f8c8d;
    margin-top: 40px;
    border-top: 1px solid var(--card-border);
}

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

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .controls-container {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Details Page Styles */
.full-width-container {
    max-width: 100%;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
}

.split-layout {
    display: flex;
    flex-wrap: wrap;
    min-height: 100vh;
}

.main-visual {
    flex: 1;
    min-width: 50%;
    background: #000;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.main-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.8;
}

.main-visual .overlay-title {
    position: absolute;
    bottom: 40px;
    left: 40px;
    z-index: 2;
}

.main-visual h1 {
    font-size: 5rem;
    margin: 0;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.8);
    line-height: 1;
}

.main-visual .era-badge {
    background: var(--accent-color);
    padding: 5px 15px;
    border-radius: 20px;
    font-family: var(--header-font);
    text-transform: uppercase;
    font-size: 1.2rem;
    margin-bottom: 10px;
    display: inline-block;
}

.content-panel {
    flex: 1;
    min-width: 400px;
    padding: 60px;
    background: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 40px;
}

.gallery-item {
    aspect-ratio: 16/9;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.gallery-item:hover {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.back-btn-fixed {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 100;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
}

@media(max-width: 900px) {
    .split-layout {
        flex-direction: column;
    }

    .main-visual {
        height: 50vh;
    }

    .content-panel {
        padding: 30px;
    }

    .main-visual h1 {
        font-size: 3rem;
    }
}