* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #d8dbd5;
    color: #212121;
    line-height: 1.6;
    min-height: 100vh;
    padding-top: 80px;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    border-bottom: 1px solid #81C784;
    padding: 0 20px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(46, 125, 50, 0.1);
}

.logo {
    height: 60px;
    width: auto;
    background: #2E7D32;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    padding: 0 16px;
}

.nav {
    display: flex;
    gap: 32px;
}

.nav a {
    text-decoration: none;
    color: #757575;
    font-weight: 500;
    font-size: 20px;
    transition: color 0.2s ease;
    margin-right: 20px;
}

.nav a:hover {
    color: #2E7D32;
}

.nav a.active {
    color: #2E7D32;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.08);
    margin: 20px auto;
    border: 1px solid rgba(129, 199, 132, 0.2);
}

h1 {
    text-align: center;
    color: #2E7D32;
    margin-bottom: 8px;
    font-size: 2.4em;
    font-weight: 700;
}

.tagline {
    text-align: center;
    font-size: 1.2em;
    margin-bottom: 32px;
    color: #757575;
    font-weight: 400;
}

.breath-dashboard {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 32px;
}

.pollution-counter {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    padding: 24px;
    border-radius: 12px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 12px rgba(238, 90, 82, 0.3);
    position: relative;
}

.counter-title {
    font-size: 1.1em;
    margin-bottom: 8px;
    opacity: 0.9;
}

.particle-count {
    font-size: 3em;
    font-weight: 700;
    margin: 8px 0;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.counter-subtitle {
    font-size: 0.9em;
    opacity: 0.8;
}

.location-info {
    background: linear-gradient(135deg, #4CAF50, #2E7D32);
    padding: 24px;
    border-radius: 12px;
    color: white;
    text-align: center;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.3);
}

.info-title {
    font-size: 1.1em;
    margin-bottom: 8px;
    opacity: 0.9;
}

.current-location {
    font-size: 1.8em;
    font-weight: 600;
    margin: 8px 0;
}

.aqi-display {
    font-size: 1.2em;
    margin-top: 8px;
}

/* Location Selection Modal */
.location-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    justify-content: center;
    align-items: center;
}

.location-modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e1e5ff;
}

.modal-header h3 {
    margin: 0;
    color: #2E7D32;
}

.close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.close-btn:hover {
    background: #f0f0f0;
}

.modal-body {
    padding: 24px;
}

.location-methods {
    margin: 16px 0 24px 0;
}

.method {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin: 8px 0;
    border: 1px solid #e1e5ff;
    border-radius: 8px;
    background: #f8f9ff;
}

.method-icon {
    font-size: 1.5em;
    flex-shrink: 0;
}

.quick-cities {
    margin-top: 24px;
}

.quick-cities h4 {
    margin-bottom: 12px;
    color: #2E7D32;
}

.city-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}

.city-btn {
    background: white;
    border: 1px solid #e1e5ff;
    border-radius: 6px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9em;
    text-align: center;
}

.city-btn:hover {
    border-color: #4CAF50;
    background: #f1f8e9;
    transform: translateY(-1px);
}

.shape-builder {
    background: #f8f9ff;
    border: 2px solid #e1e5ff;
    border-radius: 12px;
    padding: 24px;
    margin: 24px 0;
}

.shape-header {
    text-align: center;
    margin-bottom: 20px;
}

.shape-title {
    font-size: 1.4em;
    color: #2E7D32;
    font-weight: 600;
    margin-bottom: 8px;
}

.shape-progress {
    background: #e1e5ff;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin: 12px 0;
}

.progress-fill {
    background: linear-gradient(90deg, #4CAF50, #2E7D32);
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.shape-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.shape-option {
    background: white;
    border: 2px solid #e1e5ff;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.shape-option:hover {
    border-color: #4CAF50;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.2);
}

.shape-option.selected {
    border-color: #2E7D32;
    background: #f1f8e9;
}

.shape-option.completed {
    border-color: #4CAF50;
    background: #e8f5e8;
}

.shape-icon {
    font-size: 2em;
    margin-bottom: 8px;
    display: block;
}

.shape-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.shape-cost {
    font-size: 0.8em;
    color: #666;
}

.completed-badge {
    position: absolute;
    top: 4px;
    right: 4px;
    background: #4CAF50;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7em;
}

.shape-canvas {
    background: white;
    border: 2px dashed #e1e5ff;
    border-radius: 8px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.shape-preview {
    font-size: 4em;
    opacity: 0.3;
    transition: all 0.3s ease;
}

.shape-preview.building {
    opacity: 0.7;
    animation: pulse 2s infinite;
}

.shape-preview.completed {
    opacity: 1;
    animation: celebrate 0.6s ease;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes celebrate {
    0% { transform: scale(1); }
    50% { transform: scale(1.2) rotate(5deg); }
    100% { transform: scale(1) rotate(0deg); }
}

.controls {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
    flex-wrap: wrap;
}

.btn {
    padding: 10px 20px;
    border: 1px solid #81C784;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
    background: white;
    color: #2E7D32;
    font-size: 14px;
}

.btn:hover {
    background: #81C784;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(46, 125, 50, 0.2);
}

.btn-primary {
    background: #2E7D32;
    color: white;
    border-color: #2E7D32;
}

.btn-primary:hover {
    background: #1B5E20;
    border-color: #1B5E20;
    color: white;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-small {
    padding: 6px 12px;
    font-size: 12px;
    flex-shrink: 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.stat-card {
    background: white;
    border: 1px solid #e1e5ff;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
}

.stat-value {
    font-size: 1.8em;
    font-weight: 700;
    color: #2E7D32;
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.9em;
    color: #666;
}

.map-section {
    margin: 24px 0;
}

.map-section h3 {
    color: #2E7D32;
    margin-bottom: 12px;
    text-align: center;
}

#map {
    height: 400px;
    width: 100%;
    border-radius: 6px;
    border: 2px solid #81C784;
    overflow: hidden;
    margin: 12px 0;
}

.map-help {
    text-align: center;
    font-size: 0.9em;
    color: #666;
    font-style: italic;
    margin-top: 8px;
}

.breathing-animation {
    display: inline-block;
    animation: breathe 3s ease-in-out infinite;
}

@keyframes breathe {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.disclaimer {
    text-align: center;
    margin-top: 32px;
    color: #666;
    font-style: italic;
    font-size: 0.9em;
    border-top: 1px solid #e9ecef;
    padding-top: 20px;
}

/* Confetti Animation */
.confetti {
    position: fixed;
    top: -10px;
    pointer-events: none;
    z-index: 10000;
    animation: confetti-fall 3s linear forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100vh) rotate(0deg);
        opacity: 1;
    }
    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Floating particles */
.floating-particle {
    position: absolute;
    pointer-events: none;
    animation: float-up 4s linear forwards;
    font-size: 12px;
}

@keyframes float-up {
    0% {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translateY(-100px) scale(0.5);
        opacity: 0;
    }
}

/* Leaflet popup customization */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(46, 125, 50, 0.15);
}

.popup-title {
    font-weight: 600;
    color: #2E7D32;
    margin-bottom: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .breath-dashboard {
        grid-template-columns: 1fr;
    }
    
    .shape-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .container {
        padding: 24px 20px;
        margin: 16px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .particle-count {
        font-size: 2.5em;
    }
    
    .current-location {
        font-size: 1.5em;
    }
    
    .nav {
        gap: 16px;
    }
    
    .nav a {
        font-size: 16px;
        margin-right: 0;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .city-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .method {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    #map {
        height: 300px;
    }
}

@media (max-width: 480px) {
    .controls {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
        text-align: center;
    }
    
    .shape-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    body {
        padding-top: 70px;
    }
    
    .header {
        height: 70px;
        padding: 0 16px;
    }
    
    .logo {
        height: 50px;
        font-size: 14px;
        padding: 0 12px;
    }
}