:root {
    --primary: #e67e22;
    --primary-dark: #d35400;
    --secondary: #16a085;
    --dark: #2c3e50;
    --light: #ecf0f1;
    --gray: #95a5a6;
    --text: #333;
    --text-light: #fff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

.dark-theme {
    --primary: #f39c12;
    --primary-dark: #e67e22;
    --secondary: #1abc9c;
    --dark: #1a1a1a;
    --light: #2c3e50;
    --gray: #7f8c8d;
    --text: #ecf0f1;
    --text-light: #ecf0f1;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light);
    color: var(--text);
    transition: var(--transition);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
header {
    background-color: var(--dark);
    color: var(--text-light);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo h1 {
    font-size: 1.8rem;
    font-weight: 700;
}

.logo i {
    color: var(--primary);
    font-size: 2rem;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

nav a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: var(--transition);
}

nav a:hover,
nav a.active {
    background-color: var(--primary);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.weather-widget {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 30px;
}

.weather-widget i {
    color: var(--primary);
}

.theme-switch {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.theme-switch:hover {
    transform: rotate(30deg);
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 500px;
    color: white;
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 3rem;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.hero h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.btn {
    display: inline-block;
    background-color: var(--primary);
    color: white;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background-color: var(--secondary);
}

.btn-secondary:hover {
    background-color: #14967a;
}

/* Section Styles */
section {
    padding: 3rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    position: relative;
}

.section-title h2 {
    font-size: 2.5rem;
    color: var(--primary);
    display: inline-block;
    padding-bottom: 10px;
}

.section-title h2:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--primary);
    border-radius: 2px;
}

/* Animal Grid */
.animal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.animal-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.animal-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.animal-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.animal-card-content {
    padding: 1.5rem;
}

.animal-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
    color: var(--dark);
}

.local-names {
    color: var(--secondary);
    font-style: italic;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.animal-card p {
    margin-bottom: 1.5rem;
    color: var(--gray);
    font-size: 0.95rem;
    line-height: 1.5;
}

.animal-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.favorite-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.favorite-btn.active {
    color: var(--primary);
}

.favorite-btn:hover {
    transform: scale(1.2);
}

/* Park Cards */
.park-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.park-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.park-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.park-card-content {
    padding: 1.5rem;
}

.park-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.park-info {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
}

.info-item {
    flex: 1 1 45%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-item i {
    color: var(--primary);
}

/* Distance Calculator */
.planner-section {
    background-color: rgba(22, 160, 133, 0.05);
    padding: 4rem 0;
}

.planner-container {
    max-width: 800px;
    margin: 0 auto;
    background-color: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.input-row {
    display: flex;
    gap: 1rem;
}

.input-field {
    flex: 1;
    display: flex;
    flex-direction: column;
}

label {
    margin-bottom: 0.5rem;
    font-weight: 500;
}

select,
input {
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.map-container {
    height: 300px;
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray);
    font-style: italic;
}

.results {
    background-color: rgba(22, 160, 133, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 1.5rem;
    animation: fadeIn 0.5s ease;
    display: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-item {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-item i {
    color: var(--secondary);
}

/* Footer */
footer {
    background-color: var(--dark);
    color: var(--text-light);
    padding: 3rem 0 1.5rem;
    margin-top: auto;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-column h3 {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-column h3:after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 2px;
    background-color: var(--primary);
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 0.8rem;
}

.footer-links a {
    color: var(--gray);
    text-decoration: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.footer-links a:hover {
    color: var(--primary);
    transform: translateX(5px);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    background-color: var(--primary);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--gray);
    font-size: 0.9rem;
}

/* Animal Detail Page */
.animal-detail {
    padding: 4rem 0;
}

.detail-container {
    max-width: 1000px;
    margin: 0 auto;
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.back-btn:hover {
    text-decoration: underline;
}

.detail-header {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
}

.animal-image {
    flex: 1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow);
    max-height: 400px;
}

.animal-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.animal-info {
    flex: 1;
}

.animal-info h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    color: var(--dark);
}

.animal-info .local-names {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

.description-container {
    position: relative;
    margin-bottom: 2rem;
}

.animal-info .description {
    line-height: 1.8;
    white-space: pre-line;
}

.wiki-loading {
    display: none;
    background-color: rgba(22, 160, 133, 0.1);
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    color: var(--secondary);
    text-align: center;
}

.fun-facts {
    background-color: rgba(231, 126, 34, 0.1);
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 2rem;
}

.fun-facts h3 {
    margin-bottom: 1rem;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.fun-facts ul {
    padding-left: 1.5rem;
}

.fun-facts li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

/* Favorites Section */
.favorites-section {
    padding: 3rem 0;
}

#favorites-message {
    text-align: center;
    margin-bottom: 2rem;
    display: none;
}

/* Map Error Styles */
.map-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2rem;
    height: 100%;
}

.map-error i {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.map-error h4 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark);
}

.map-error p {
    margin-bottom: 1.5rem;
    color: var(--gray);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .detail-header {
        flex-direction: column;
    }

    .animal-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

@media (max-width: 768px) {
    .hero h2 {
        font-size: 2.5rem;
    }

    .mobile-menu-btn {
        display: block;
    }

    nav ul {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background-color: var(--dark);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: var(--shadow);
    }

    nav ul.active {
        display: flex;
    }

    .input-row {
        flex-direction: column;
    }

    .park-cards {
        grid-template-columns: 1fr;
    }

    /* Responsive adjustments for map error */
    .map-error {
        padding: 1rem;
    }

    .map-error i {
        font-size: 2rem;
    }

    .map-error h4 {
        font-size: 1.2rem;
    }
}

@media (max-width: 576px) {
    .hero {
        height: 400px;
    }

    .hero h2 {
        font-size: 2rem;
    }

    .section-title h2 {
        font-size: 2rem;
    }

    .animal-grid {
        grid-template-columns: 1fr;
    }

    .footer-column {
        text-align: center;
    }

    .footer-column h3:after {
        left: 50%;
        transform: translateX(-50%);
    }

    .footer-links a {
        justify-content: center;
    }

    .social-links {
        justify-content: center;
    }
}