:root {
    --primary: #007BFF;
    --secondary: #6c757d;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    --light: #f8f9fa;
    --dark: #343a40;
    --transition: all 0.3s ease;
}

[data-theme="dark"] {
    --bg-color: #1a1a1a;
    --text-color: #ffffff;
    --container-bg: #2d2d2d;
    --shadow-color: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] {
    --bg-color: #f0f0f0;
    --text-color: #333333;
    --container-bg: #ffffff;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: var(--transition);
}

body {
    font-family: 'Segoe UI', sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--bg-color);
    color: var(--text-color);
    padding: 20px;
}

.container {
    width: 90%;
    max-width: 600px;
    background: var(--container-bg);
    padding: 2rem;
    border-radius: 20px;
    box-shadow: 0 0 20px var(--shadow-color);
}

.theme-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    cursor: pointer;
    font-size: 1.5rem;
    padding: 10px;
    border-radius: 50%;
    background: var(--container-bg);
    box-shadow: 0 0 10px var(--shadow-color);
}

.input-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;           /* Increased from 1rem */
    margin: 3rem 0;       /* Changed from margin-bottom */
    width: 100%;
    padding: 0 1rem;      /* Added horizontal padding */
}

input {
    padding: 1.2rem;      /* Increased from 1rem */
    border: 2px solid transparent;
    border-radius: 12px;  /* Slightly increased */
    font-size: 1.2rem;    /* Slightly increased */
    background: var(--bg-color);
    color: var(--text-color);
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.calculate-btn {
    padding: 1.2rem;      /* Increased from 1rem */
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;   /* Added */
}

.calculate-btn:hover {
    opacity: 0.9;
}

.aqi-scale {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
    margin-top: 2rem;
}

.scale-item {
    padding: 0.75rem;
    border-radius: 10px;
    font-size: 0.9rem;
    background: var(--bg-color);
    color: var(--text-color);
    text-align: center;
}

.result-container {
    text-align: center;
    margin: 2rem 0;
}

#result {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    padding: 1rem;
    border-radius: 10px;
    background: var(--bg-color);
}

.cigarette-visual {
    margin: 2rem auto;
    font-size: 2rem;
}

@media (max-width: 768px) {
    .container {
        width: 95%;
        padding: 1.5rem;
    }

    h1 {
        margin-bottom: 2rem;
        font-size: 2rem;
    }

    .input-container {
        margin: 2rem 0;
        padding: 0 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    .theme-toggle {
        top: 10px;
        right: 10px;
        font-size: 1.2rem;
    }
}

/* Add these styles */
.scale-item[data-level="Good"] { 
    background: var(--success);
    color: white;
}

.scale-item[data-level="Moderate"] { 
    background: var(--warning);
    color: var(--dark);
}

.scale-item[data-level="Unhealthy"] { 
    background: var(--danger);
    color: white;
}

.scale-item[data-level="Very Unhealthy"] { 
    background: #dc3545; 
    color: white;
}

.scale-item[data-level="Hazardous"] { 
    background: #6f42c1; 
    color: white;
}

/* Add hover effect */
.scale-item {
    transition: transform 0.2s ease;
}

.scale-item:hover {
    transform: translateY(-2px);
}

/* Style for result severity */
#result.good { background-color: var(--success); color: white; }
#result.moderate { background-color: var(--warning); color: var(--dark); }
#result.unhealthy { background-color: var(--danger); color: white; }
#result.very-unhealthy { background-color: #dc3545; color: white; }
#result.hazardous { background-color: #6f42c1; color: white; }

/* Add new severity levels */
.scale-item[data-level="Severe"] { 
    background: #800000; /* Dark red */
    color: white;
}

.scale-item[data-level="Extreme"] { 
    background: #4a0404; /* Very dark red */
    color: white;
    animation: pulse 2s infinite;
}

/* Add pulse animation for extreme cases */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.6; }
    100% { opacity: 1; }
}

/* Add to existing result styles */
#result.severe { 
    background-color: #800000; 
    color: white;
}

#result.extreme { 
    background-color: #4a0404; 
    color: white;
    animation: pulse 2s infinite;
}

h1 {
    margin-bottom: 3rem;  /* Increased from 2rem */
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1.4;  /* Added for better readability */
}

.badge {
    display: inline-block;  /* Added */
    margin-top: 0.5rem;     /* Added */
    background: var(--primary);
    color: white;
    padding: 0.4rem 1rem;   /* Adjusted padding */
    border-radius: 1rem;
    font-size: 1rem;
    vertical-align: middle;
}

/* Add to styles.css */
.search-box {
    display: flex;
    gap: 0.5rem;
    width: 100%;
    position: relative;
}

.search-box input {
    flex: 1;
}

.search-btn {
    padding: 1.2rem;
    border: none;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    cursor: pointer;
}

.divider {
    text-align: center;
    font-weight: 500;
    color: var(--text-color);
    margin: 1rem 0;
}

.loading {
    animation: pulse 1.5s infinite;
}

.location-info {
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--text-color);
}

.pm25-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-color);
    border-radius: 10px;
    font-size: 0.9rem;
}

/* Autocomplete Styles */
#autocomplete-list {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--container-bg);
    border: 1px solid var(--shadow-color);
    width: 100%;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

.autocomplete-item {
    padding: 0.75rem;
    cursor: pointer;
}

.autocomplete-item:hover {
    background-color: var(--primary);
    color: white;
}