@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;600;700&display=swap');

:root {
    --primary-color: #2d5a27;
    --accent-color: #3498db;
    --bg-light: #ffffff;
    --bg-soft: #f8fafc;
    --sand-beige: #fdf5e6;
    --text-main: #2c3e50;
    --text-muted: #7f8c8d;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

html {
    scroll-behavior: smooth;
}

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

body {
    font-family: 'Cairo', sans-serif;
    direction: rtl;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

/* Navigation - Pure CSS Sticky */
nav {
    position: sticky;
    top: 0;
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: var(--shadow-soft);
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.logo {
    font-weight: 700;
    font-size: 1.5rem;
    color: var(--primary-color);
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: 600;
    transition: var(--transition);
}

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

/* Hero Section - Fixed performance */
.hero {
    height: 80vh; /* Reduced height for better UX */
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
    background-size: cover;
    background-position: center;
    /* background-attachment: fixed; - REMOVED FOR PERFORMANCE */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2), rgba(0,0,0,0.4));
}

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

.hero h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease-out forwards;
}

.hero p {
    font-size: 1.3rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out forwards;
}

/* Gallery Section */
.gallery-section {
    padding: 6rem 5%;
    background-color: var(--bg-soft);
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

.section-header h2 {
    font-size: 2.2rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.bird-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2.5rem;
}

/* Bird Card - Performance & Animation */
.bird-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: var(--transition);
    will-change: transform; /* Hint for GPU */
    opacity: 0;
    animation: revealCard 0.6s ease-out forwards;
}

/* Staggered animation without JS */
.bird-card:nth-child(1) { animation-delay: 0.1s; }
.bird-card:nth-child(2) { animation-delay: 0.2s; }
.bird-card:nth-child(3) { animation-delay: 0.3s; }
.bird-card:nth-child(4) { animation-delay: 0.4s; }
.bird-card:nth-child(5) { animation-delay: 0.5s; }
.bird-card:nth-child(6) { animation-delay: 0.6s; }
.bird-card:nth-child(7) { animation-delay: 0.7s; }
.bird-card:nth-child(8) { animation-delay: 0.8s; }
.bird-card:nth-child(9) { animation-delay: 0.9s; }
.bird-card:nth-child(10) { animation-delay: 1.0s; }

.bird-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.bird-image-container {
    height: 240px;
    overflow: hidden;
    position: relative;
    background: #eee;
}

.bird-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    image-rendering: auto;
}

.bird-card:hover .bird-image-container img {
    transform: scale(1.05);
}

.bird-info {
    padding: 1.5rem;
}

.bird-names {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.8rem;
}

.bird-ar {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.bird-en {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 400;
}

.bird-desc {
    color: var(--text-main);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    line-height: 1.7;
    height: 4.5rem; /* Consistent height */
    overflow: hidden;
}

.view-more-btn {
    display: inline-block;
    padding: 0.7rem 1.2rem;
    background: var(--bg-soft);
    color: var(--primary-color);
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.view-more-btn:hover {
    background: var(--primary-color);
    color: white;
}

/* Footer */
footer {
    padding: 4rem 5%;
    background: white;
    border-top: 1px solid #eee;
    text-align: center;
}

.footer-logo {
    font-weight: 700;
    font-size: 1.6rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: block;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Animations */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive */
@media (max-width: 768px) {
    .hero h1 { font-size: 2.2rem; }
    .hero p { font-size: 1rem; }
    .nav-links { display: none; }
    .bird-grid { grid-template-columns: 1fr; }
    .gallery-section { padding: 4rem 5%; }
}
