* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background-color: #f5f5f5;
    color: #333;
    padding: 20px;
}

.container1 {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
    font-size: 2.5em;
}

.settings-panel {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.settings-panel h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.settings-group {
    margin-bottom: 15px;
}

.settings-group label {
    display: block;
    margin-bottom: 5px;
    color: #555;
    font-weight: bold;
}

.settings-group input,
.settings-group select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    background: white;
}

.settings-group input:focus,
.settings-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

.generate-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

.generate-btn:hover {
    background-color: #2980b9;
}

.generate-btn:active {
    transform: translateY(0);
}

.results-container {
    position: relative;
    min-height: 200px;
}

.loading {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    z-index: 10;
    font-weight: bold;
    color: #2c3e50;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

.animal-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
    position: relative;
}

.animal-image-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    background-color: #f0f0f0; /* Light grey placeholder */
}

.animal-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    will-change: transform; /* Optimize for animations */
    transform: translateZ(0); /* Force GPU acceleration */
    backface-visibility: hidden; /* Reduce paint during animations */
}

.animal-info {
    padding: 15px;
    text-align: center;
    background: white;
}

.animal-info h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.2em;
}

.photographer-credit,
.unsplash-link {
    color: #666;
    font-size: 0.8em;
    text-decoration: none;
    transition: color 0.3s ease;
}

.photographer-credit:hover,
.unsplash-link:hover {
    color: #3498db;
}

.error-message {
    text-align: center;
    padding: 20px;
    background: #fee;
    color: #c33;
    border-radius: 4px;
    margin: 20px 0;
    border: 1px solid #fcc;
}

.load-more-container {
    text-align: center;
    margin-top: 30px;
    margin-bottom: 30px;
}

.load-more-btn {
    padding: 15px 40px;
    background-color: #2ecc71;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.load-more-btn:hover {
    background-color: #27ae60;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.load-more-btn:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .container {
        padding: 15px;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 15px;
    }

    .generate-btn {
        padding: 12px;
        font-size: 16px;
    }

    h1 {
        font-size: 2em;
    }
