/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Container for centering content */
.container {
    max-width: 800px;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    padding: 30px;
    animation: fadeIn 0.5s ease-in;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5rem;
    color: #2d3436;
    margin-bottom: 10px;
}

header p {
    color: #636e72;
    font-size: 1.1rem;
}

/* Search section */
.search-section {
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

#cityInput {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

#cityInput:focus {
    outline: none;
    border-color: #74b9ff;
}

button {
    padding: 12px 20px;
    background: linear-gradient(135deg, #00b894 0%, #00a085 100%);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 184, 148, 0.4);
}

#geoBtn {
    background: linear-gradient(135deg, #fdcb6e 0%, #e17055 100%);
}

#geoBtn:hover {
    box-shadow: 0 5px 15px rgba(253, 203, 110, 0.4);
}

/* Loading and error states */
.loading {
    text-align: center;
    padding: 20px;
    color: #74b9ff;
    font-size: 1.1rem;
    animation: spin 1s linear infinite;
}

.loading.hidden,
.error.hidden,
.weather-section.hidden {
    display: none;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    text-align: center;
    color: #e74c3c;
    font-weight: bold;
    padding: 10px;
    background: rgba(231, 76, 60, 0.1);
    border-radius: 10px;
    margin-top: 10px;
}

/* Weather section */
.weather-section {
    animation: fadeIn 0.5s ease-in;
}

.weather-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.weather-card:hover {
    transform: scale(1.02);
}

.city-name {
    font-size: 2rem;
    font-weight: bold;
    color: #2d3436;
    margin-bottom: 10px;
}

.weather-icon {
    width: 100px;
    height: 100px;
    margin: 20px 0;
}

.temperature {
    font-size: 4rem;
    font-weight: bold;
    color: #00b894;
    margin: 10px 0;
}

.description {
    font-size: 1.5rem;
    color: #636e72;
    text-transform: capitalize;
    margin-bottom: 20px;
}

/* Details grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.detail-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
}

.label {
    display: block;
    font-size: 0.9rem;
    color: #636e72;
    margin-bottom: 5px;
}

.value {
    font-size: 1.2rem;
    font-weight: bold;
    color: #2d3436;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 20px;
        margin: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .input-group {
        flex-direction: column;
        align-items: center;
    }

    #cityInput {
        width: 100%;
        min-width: auto;
    }

    .temperature {
        font-size: 3rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .weather-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.8rem;
    }

    .temperature {
        font-size: 2.5rem;
    }

    button {
        width: 100%;
        margin-top: 10px;
    }
}