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

/* Basic setup */
body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    /* Light green background for environmental theme */
    background-color: #f7fef7; 
    color: #333;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Header */
header {
    /* Green gradient for the header */
    background: linear-gradient(90deg, #2a9d8f, #264653);
    color: #ffffff;
    text-align: center;
    padding: 2.5rem 1rem;
    border-bottom-left-radius: 20px;
    border-bottom-right-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}
header h1 {
    margin: 0;
    font-size: 2.8rem;
    font-weight: 700;
}
header p {
    font-size: 1.1rem;
    font-weight: 300;
    opacity: 0.9;
}

/* Main Content */
main {
    max-width: 700px;
    margin: 2.5rem auto;
    padding: 1rem;
}

/* Search Box */
.search-container {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
}
#city-input {
    flex-grow: 1;
    font-size: 1.1rem;
    padding: 0.85rem 1.25rem;
    border: 2px solid #ddd;
    border-radius: 50px; /* Rounded pill shape */
    font-family: 'Poppins', sans-serif;
}
#city-input:focus {
    outline: none;
    border-color: #2a9d8f;
    box-shadow: 0 0 10px rgba(42, 157, 143, 0.2);
}

#search-button {
    font-size: 1.1rem;
    font-weight: 600;
    padding: 0.85rem 1.75rem;
    background-color: #2a9d8f;
    color: white;
    border: none;
    border-radius: 50px; /* Rounded pill shape */
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(42, 157, 143, 0.3);
}
#search-button:hover {
    background-color: #264653;
    box-shadow: 0 6px 20px rgba(38, 70, 83, 0.4);
    transform: translateY(-2px);
}
#search-button:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(38, 70, 83, 0.4);
}

/* --- Results Cards --- */
.result-card {
    background-color: #ffffff;
    border-radius: 16px;
    padding: 1.5rem 2rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border: 1px solid #eee;
    
    /* Animation: Fade in */
    opacity: 0;
    transform: translateY(20px);
    animation: fadeIn 0.5s ease-out forwards;
}

/* This is the animation definition */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-card h2 {
    margin-top: 0;
    color: #264653; /* Darker accent */
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.75rem;
    display: flex;
    align-items: center;
}
.result-card h2 .icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

#data-list {
    list-style: none;
    padding-left: 0;
}
#data-list li {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-weight: 400;
}
/* New label style */
#data-list li .data-label {
    font-weight: 600;
    color: #333;
    margin-right: 8px;
}
#data-list li::before {
    content: '🌿'; /* Leaf emoji for theme */
    margin-right: 10px;
}

#summary-text {
    font-size: 1.1rem;
    line-height: 1.7;
}

/* Utility Classes */
.hidden {
    display: none;
}

/* Loading Spinner */
#loading-spinner {
    border: 5px solid #e9ecef;
    border-top: 5px solid #2a9d8f; /* Themed spinner */
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 3rem auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding-bottom: 2rem;
    color: #aaa;
}


/* --- NEW CSS RULE TO CENTER THE GAUGE --- */
#gauge-container {
    text-align: center; /* This centers the h3 and the canvas */
    animation: fadeIn 0.5s ease-out forwards; /* Add the same fade-in */
    margin-bottom: 1.5rem; /* Match spacing */
}

#gauge-container h3 {
    color: #264653; /* Match the style of the other card headers */
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem; /* Space between title and gauge */
}

