/* Styles for IQAir website */

body {
    font-family: 'Poppins', sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    text-align: center;
    margin-bottom: 30px;
}

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

/* Current Data Section */
.current-data {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.current-data h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 10px;
}

.current-data h3 {
    font-size: 1.2rem;
    margin-bottom: 15px;
}

.aqi-indicator {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 30px;
    font-weight: bold;
    color: white;
    margin-bottom: 15px;
}

.aqi-emoji {
    font-size: 1.5em;
    margin-left: 10px;
}

.aqi-good {
    background-color: #009966;
}

.aqi-moderate {
    background-color: #ffde33;
    color: #333;
}

.aqi-unhealthy {
    background-color: #ff9933;
}

.aqi-very-unhealthy {
    background-color: #cc0033;
}

.aqi-hazardous {
    background-color: #660099;
}

/* Weather Icon */
.weather-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 20px 0;
}

/* Weather Grid */
.weather-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.weather-item {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    position: relative;
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}

.weather-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.weather-icon-small {
    font-size: 2rem;
    margin-bottom: 8px;
}

.weather-item h4 {
    margin: 8px 0;
    color: #2c3e50;
}

.weather-item p {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 5px 0;
    color: #3498db;
}

.weather-item small {
    display: block;
    color: #7f8c8d;
    font-size: 0.8rem;
    margin-top: 5px;
}

.weather-item small:first-of-type {
    font-weight: 500;
    color: #34495e;
    font-size: 0.9rem;
}

/* Map container */
.map-container {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.map-container h2 {
    margin-top: 0;
    color: #2c3e50;
    border-bottom: 2px solid #f1f1f1;
    padding-bottom: 10px;
}

#map {
    height: 400px;
    border-radius: 8px;
    margin-top: 15px;
}

/* Last updated and pollutant info */
.pollutant-info, .last-updated {
    margin-top: 15px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Map legend */
.map-legend {
    background-color: white;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
}

.legend-color {
    width: 15px;
    height: 15px;
    margin-right: 8px;
    border-radius: 3px;
}

/* Loading animation */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 153, 102, 0.2);
    border-top: 4px solid #009966;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

/* Footer */
.footer {
    text-align: center;
    padding: 15px 0;
    margin-top: 20px;
    font-size: 0.9rem;
    color: #7f8c8d;
}

.footer a {
    color: #3498db;
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

/* Fix for mobile scrolling issues with map */
.leaflet-container {
    -webkit-tap-highlight-color: transparent;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .weather-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }
    
    .weather-item {
        padding: 12px;
    }
    
    .weather-item p {
        font-size: 1.3rem;
    }
    
    #map {
        height: 350px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .header h1 {
        font-size: 1.6rem;
        line-height: 1.3;
    }
    
    .current-data, .map-container {
        padding: 15px;
        border-radius: 8px;
    }
    
    .current-data h2, .map-container h2 {
        font-size: 1.3rem;
    }
    
    .aqi-indicator {
        width: 100%;
        justify-content: center;
        padding: 12px;
        font-size: 1.1rem;
        box-sizing: border-box;
    }
    
    .weather-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .weather-icon-small {
        font-size: 1.8rem;
    }
    
    .weather-item {
        display: flex;
        flex-direction: column;
        align-items: center;
        padding: 15px 10px;
        margin-bottom: 5px;
        min-height: 130px;
    }
    
    .weather-item h4 {
        font-size: 1rem;
        margin: 5px 0;
    }
    
    .weather-item p {
        font-size: 1.4rem;
        margin: 5px 0;
    }
    
    .weather-item small {
        font-size: 0.75rem;
        margin-top: 3px;
    }
    
    .weather-item small:first-of-type {
        font-size: 0.85rem;
        margin-top: 5px;
        margin-bottom: 2px;
    }
    
    #map {
        height: 280px;
    }
    
    .map-legend {
        max-width: 180px;
        font-size: 0.8rem;
    }
    
    /* Improve tap targets on mobile */
    .aqi-indicator {
        padding: 12px;
        font-size: 1.1rem;
    }
    
    /* Better spacing for map on mobile */
    .map-container {
        margin-top: 10px;
    }
    
    /* Make footer more compact */
    .footer {
        padding: 10px 0;
        font-size: 0.8rem;
    }
}

/* Custom styles to complement Bootstrap */

body {
    font-family: 'Poppins', sans-serif;
}

/* Custom title styling */
.display-4 {
    color: #2c3e50;
    font-weight: 600;
}

/* Override Bootstrap card styles */
.card {
    border: none;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1) !important;
}

/* Air Quality Indicator Styles */
.aqi-good {
    background-color: #009966;
    color: white !important;
}

.aqi-moderate {
    background-color: #ffde33;
    color: #333 !important;
}

.aqi-unhealthy {
    background-color: #ff9933;
    color: white !important;
}

.aqi-very-unhealthy {
    background-color: #cc0033;
    color: white !important;
}

.aqi-hazardous {
    background-color: #660099;
    color: white !important;
}

/* Weather cards styling */
.card .display-6 {
    font-size: 2.5rem;
}

.card .text-primary {
    color: #3498db !important;
}

.card .fw-medium {
    font-weight: 500;
}

/* Map styling */
#map {
    min-height: 400px;
    border-radius: 8px;
}

/* Leaflet popup styling */
.leaflet-popup-content {
    font-family: 'Poppins', sans-serif;
    min-width: 200px;
}

.leaflet-popup-content h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #2c3e50;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.leaflet-popup-content .fs-1 {
    font-size: 2.5rem !important;
}

/* Map legend styling */
.map-legend {
    background-color: white;
    padding: 10px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 250px;
}

.legend-item {
    display: flex;
    align-items: center;
    margin-bottom: 5px;
    font-size: 0.9rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    margin-right: 8px;
    border-radius: 4px;
}

/* Animation keyframes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

@keyframes scaleUp {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Animations for the AQI indicator */
.aqi-indicator-animation {
    animation: slideUp 0.8s ease-out forwards;
}

/* Animation for weather icon */
.weather-icon-animation {
    animation: fadeIn 1s ease forwards, bounce 2s ease 1s;
}

/* Animation for weather cards */
.weather-card-animation {
    opacity: 0;
    animation: scaleUp 0.6s ease forwards;
}

.weather-card-animation:nth-child(1) { animation-delay: 0.2s; }
.weather-card-animation:nth-child(2) { animation-delay: 0.4s; }
.weather-card-animation:nth-child(3) { animation-delay: 0.6s; }
.weather-card-animation:nth-child(4) { animation-delay: 0.8s; }

/* Animation for weather data values */
.data-value-animation {
    animation: fadeIn 1s ease forwards, pulse 2s ease 1s infinite;
}

/* Animation for map */
.map-animation {
    opacity: 0;
    animation: fadeIn 1.2s ease 1s forwards;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .display-4 {
        font-size: 2rem;
    }
    
    .display-6 {
        font-size: 2rem !important;
    }
    
    .card-title {
        font-size: 1.3rem;
    }
    
    #map {
        min-height: 350px;
    }
}

@media (max-width: 480px) {
    .display-4 {
        font-size: 1.8rem;
    }
    
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .card .display-6 {
        font-size: 1.8rem !important;
    }
    
    #map {
        min-height: 280px;
    }
    
    .map-legend {
        max-width: 180px;
        font-size: 0.8rem;
    }
}

/* Styling baru untuk Data Terkini */
.data-terkini {
    position: relative;
    overflow: hidden;
    border: none !important;
    transition: all 0.3s ease;
}

.data-terkini:before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, #009966, #33ccff);
}

.data-terkini h2 {
    font-weight: 600;
    color: #2c3e50;
}

.lokasi-info {
    font-size: 1.1rem;
    font-weight: 500;
    color: #34495e;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #e0e0e0;
    margin-bottom: 1rem;
}

/* Styling untuk indikator AQI */
.aqi-indicator-animation {
    transform: scale(1);
    transition: transform 0.3s ease;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
}

.aqi-indicator-animation:hover {
    transform: scale(1.05);
}

/* Styling untuk ikon cuaca */
.weather-icon-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, #f0f9ff, #ffffff);
    border-radius: 50%;
    width: 120px;
    height: 120px;
    margin: 0 auto;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.weather-icon-large {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
    animation: weather-float 3s ease-in-out infinite;
}

.weather-description {
    font-weight: 600;
    font-size: 1.2rem;
    color: #2c3e50;
    margin-top: 0.5rem;
}

@keyframes weather-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Styling untuk kartu cuaca */
.weather-card {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.weather-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.weather-card .card-body {
    padding: 1.5rem;
}

.weather-card .display-6 {
    margin-bottom: 0.5rem;
    animation: pulse 2s infinite;
}

.weather-value {
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(45deg, #3498db, #2980b9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

.weather-desc {
    font-size: 0.95rem;
    font-weight: 500;
    color: #34495e;
    margin-bottom: 0.5rem;
}

.weather-range {
    font-size: 0.8rem;
    color: #7f8c8d;
    font-style: italic;
}

/* Rain animation for weather icon */
.rain-animation {
    position: relative;
}

.rain-animation:after {
    content: '';
    position: absolute;
    top: 40px;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to bottom, transparent, transparent 80%, rgba(255, 255, 255, 0.5) 80%, rgba(255, 255, 255, 0.5));
    background-size: 8px 8px;
    animation: rain 1s linear infinite;
}

@keyframes rain {
    0% { background-position: 0 0; }
    100% { background-position: 0 8px; }
} 