:root {
    --primary: #4a7c59;
    --secondary: #f8f9fa;
    --accent: #e67e22;
    --text: #333;
    --background: #ffffff;
    --modal-bg: rgba(255, 255, 255, 0.9);
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--background);
    color: var(--text);
    line-height: 1.6;
    padding: 20px;
    background-image: url('background.jpg');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85);
    z-index: -1;
}

header {
    text-align: center;
    margin-bottom: 40px;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 20px;
    border-radius: 10px;
    box-shadow: var(--card-shadow);
}

header h1 {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 10px;
}

.bird-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.bird-card {
    background: var(--secondary);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: var(--card-shadow);
}

.bird-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 25px rgba(0, 0, 0, 0.15);
}

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

.card-image {
    aspect-ratio: 1/1;
    overflow: hidden;
    position: relative;
}

.card-image {
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
}

.upload-icon {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(128,128,128,0.3);
    color: rgba(255,255,255,0.9);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: all 0.2s ease;
    font-size: 12px;
    opacity: 0.7;
}

.upload-icon:hover {
    background: rgba(128,128,128,0.5);
    opacity: 1;
}

/* Fallback for cards without images */
.bird-card:not([data-bird]) .card-image {
   
}

/* Bird images */
.bird-card[data-bird="kiwi"] .card-image {
    
}

.bird-card[data-bird="kakapo"] .card-image {
    
}

.bird-card[data-bird="tui"] .card-image {
    
}

.bird-card[data-bird="kea"] .card-image {
    
}

.bird-card[data-bird="pukeko"] .card-image {
    
}

.bird-card[data-bird="fantail"] .card-image {
    
}

.bird-card[data-bird="morepork"] .card-image {
    
}

.bird-card[data-bird="kereru"] .card-image {
    
}

.bird-card[data-bird="bellbird"] .card-image {
    
}

.bird-card:hover .card-image {
    opacity: 0.8;
    transform: scale(1.05);
}

.bird-card h3 {
    padding: 15px 20px;
    color: var(--accent);
}

.bird-card p {
    padding: 0 20px 20px;
    color: var(--text);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.5);
    overflow: auto;
    opacity: 0;
    transition: opacity 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 1;
}

.modal-content {
    background-color: var(--background);
    margin: auto;
    padding: 30px;
    border-radius: 10px;
    max-width: 800px;
    width: 90%;
    position: relative;
    animation: modalSlideIn 0.3s ease-out;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

@keyframes modalSlideIn {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close {
    position: absolute;
    right: 25px;
    top: 15px;
    color: var(--accent);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.modal-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-top: 20px;
}

.modal-image {
    aspect-ratio: 1/1;
    background-size: cover;
    background-position: center;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
    max-height: 80vh;
}

.modal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.modal-map {
    min-height: 200px;
    background-color: #f0f0f0;
    border-radius: 5px;
    margin-top: 15px;
    opacity: 0.9;
    padding: 20px;
    overflow: auto;
    max-height: 60vh;
    transition: height 0.3s ease;
}

/* Responsive design */
@media (max-width: 768px) {
    .bird-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .modal-body {
        flex-direction: column;
    }
    
    .modal-image,
    .modal-map {
        height: 200px;
    }
}

@media (max-width: 480px) {
    .modal-content {
        padding: 20px 15px;
    }
}