:root {
    --primary-color: #3f51b5;
    --primary-light: #757de8;
    --primary-dark: #002984;
    --secondary-color: #f50057;
    --bg-color: #f5f5f5;
    --card-bg: #ffffff;
    --text-primary: #212121;
    --text-secondary: #757575;
    --error-color: #d32f2f;
    --shadow-1: 0 2px 4px rgba(0, 0, 0, 0.14), 0 3px 4px rgba(0, 0, 0, 0.12), 0 1px 5px rgba(0, 0, 0, 0.20);
    --shadow-2: 0 4px 5px 0 rgba(0, 0, 0, 0.14), 0 1px 10px 0 rgba(0, 0, 0, 0.12), 0 2px 4px -1px rgba(0, 0, 0, 0.20);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 20px;
}

.app-container {
    width: 100%;
    max-width: 500px;
}

/* Header & Search */
.app-header {
    margin-bottom: 24px;
}

.search-container {
    display: flex;
    gap: 12px;
    align-items: center;
}

.search-bar {
    flex: 1;
    background: var(--card-bg);
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 28px;
    box-shadow: var(--shadow-1);
    transition: var(--transition);
}

.search-bar:focus-within {
    box-shadow: var(--shadow-2);
}

.search-icon {
    color: var(--text-secondary);
    margin-right: 12px;
}

.search-bar input {
    border: none;
    outline: none;
    width: 100%;
    font-size: 16px;
    background: transparent;
}

.icon-button {
    background: var(--primary-color);
    color: white;
    border: none;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-1);
    transition: var(--transition);
}

.icon-button:hover {
    background: var(--primary-dark);
    box-shadow: var(--shadow-2);
    transform: translateY(-1px);
}

/* Dashboard Cards */
.main-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 32px;
    text-align: center;
    box-shadow: var(--shadow-1);
    margin-bottom: 24px;
    animation: fadeIn 0.5s ease-out;
}

.city-info h1 {
    font-size: 2.5rem;
    font-weight: 500;
}

.city-info p {
    color: var(--text-secondary);
    margin-top: 4px;
}

.temp-section {
    margin-top: 24px;
}

.temp-section img {
    width: 120px;
    height: 120px;
}

.temp-val {
    font-size: 4rem;
    font-weight: 300;
}

.unit {
    font-size: 1.5rem;
    vertical-align: super;
}

#weather-desc {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-transform: capitalize;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.detail-card {
    background: var(--card-bg);
    padding: 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--shadow-1);
    transition: var(--transition);
}

.detail-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-2);
}

.detail-card .material-icons {
    color: var(--primary-color);
    font-size: 28px;
}

.label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.value {
    font-weight: 500;
    font-size: 1.1rem;
}

/* States */
.hidden {
    display: none !important;
}

.loading-container {
    display: flex;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-card {
    background: #ffebee;
    color: var(--error-color);
    padding: 24px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow-1);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 400px) {
    .details-grid {
        grid-template-columns: 1fr;
    }

    .city-info h1 {
        font-size: 2rem;
    }

    .temp-val {
        font-size: 3rem;
    }
}