/**
 * HWBD Weather Alert - Modern Styling
 * 
 * @package HWBD_Weather_Alert
 * @author Tanvir Rana Rabbi
 */

/* ============================================
   Wrapper & Division Selector
============================================ */
.hwbd-weather-wrapper {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.hwbd-division-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.04);
    border-radius: 20px;
    transition: all 0.2s ease;
}

.hwbd-division-selector:hover {
    background: rgba(0, 0, 0, 0.06);
}

.hwbd-location-icon {
    font-size: 14px;
    line-height: 1;
    opacity: 0.7;
}

.hwbd-district-select {
    padding: 2px 22px 2px 6px;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: inherit;
    background-color: transparent;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='8' viewBox='0 0 8 8'%3E%3Cpath fill='%231a1a1a' d='M4 6L1 2h6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 8px;
    min-width: 90px;
}

.hwbd-district-select:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.hwbd-district-select:focus {
    outline: 1px solid rgba(0, 0, 0, 0.2);
    outline-offset: 1px;
    background-color: rgba(0, 0, 0, 0.04);
}

.hwbd-district-select option {
    padding: 8px;
    background: white;
    color: #1a1a1a;
}

/* ============================================
   Container Base Styles
============================================ */
.hwbd-weather-container {
    position: relative;
    width: 100%;
    background: transparent;
    border-radius: 12px;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    /* Flatten aspect ratio (7:3) */
    aspect-ratio: 7 / 3;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ============================================
   Loading State
============================================ */
.hwbd-weather-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 14px;
    color: #666;
    padding: 20px;
}

.hwbd-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-top-color: #333;
    border-radius: 50%;
    animation: hwbd-spin 0.8s linear infinite;
}

@keyframes hwbd-spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   Weather Content
============================================ */
.hwbd-weather-content {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px 30px;
    transition: background-color 0.4s ease;
}

/* ============================================
   Header Section
============================================ */
.hwbd-weather-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.hwbd-header-title {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.hwbd-district {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.hwbd-status-badge {
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

/* Status Colors */
.hwbd-status-hot {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.hwbd-status-cold {
    background: rgba(59, 130, 246, 0.15);
    color: #2563eb;
}

.hwbd-status-safe {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

/* ============================================
   Body Section
============================================ */
.hwbd-weather-body {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    flex: 1;
}

/* Temperature Display */
.hwbd-temp-display {
    display: flex;
    gap: 30px;
    align-items: center;
}

.hwbd-feels-like,
.hwbd-actual-temp {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hwbd-feels-like .hwbd-label,
.hwbd-actual-temp .hwbd-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.7;
    font-weight: 500;
}

.hwbd-feels-like .hwbd-value {
    font-size: 36px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
}

.hwbd-actual-temp .hwbd-value {
    font-size: 20px;
    font-weight: 600;
    line-height: 1;
}

/* Weather Details */
.hwbd-weather-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.hwbd-detail-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.hwbd-detail-item .hwbd-icon {
    font-size: 16px;
}

.hwbd-detail-item .hwbd-text {
    opacity: 0.85;
}

/* ============================================
   Alert Message
============================================ */
.hwbd-alert-message {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    font-weight: 500;
    transition: all 0.3s ease;
}

/* Container State Colors */
.hwbd-hot .hwbd-alert-message {
    background: rgba(239, 68, 68, 0.1);
    border-left: 4px solid #dc2626;
    color: #991b1b;
}

.hwbd-cold .hwbd-alert-message {
    background: rgba(59, 130, 246, 0.1);
    border-left: 4px solid #2563eb;
    color: #1e40af;
}

.hwbd-safe .hwbd-alert-message {
    background: rgba(34, 197, 94, 0.1);
    border-left: 4px solid #16a34a;
    color: #15803d;
}

/* ============================================
   Error State
============================================ */
.hwbd-weather-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    text-align: center;
    color: #dc2626;
}

.hwbd-error-icon {
    font-size: 32px;
}

.hwbd-weather-error p {
    margin: 0;
    font-size: 14px;
    opacity: 0.8;
}

/* ============================================
   Responsive Design
============================================ */
@media (max-width: 768px) {
    .hwbd-weather-container {
        aspect-ratio: auto;
        min-height: 180px;
    }
    
    .hwbd-weather-content {
        padding: 16px 20px;
    }
    
    .hwbd-weather-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .hwbd-district {
        font-size: 18px;
    }
    
    .hwbd-division-selector {
        padding: 3px 8px;
    }
    
    .hwbd-district-select {
        font-size: 11px;
        min-width: 80px;
    }
    
    .hwbd-temp-display {
        gap: 20px;
    }
    
    .hwbd-feels-like .hwbd-value {
        font-size: 32px;
    }
    
    .hwbd-actual-temp .hwbd-value {
        font-size: 18px;
    }
    
    .hwbd-alert-message {
        font-size: 12px;
        padding: 10px 12px;
    }
}
    
    .hwbd-weather-container {
        aspect-ratio: auto;
        min-height: 180px;
    }
    
    .hwbd-weather-content {
        padding: 16px 20px;
    }
    
    .hwbd-weather-body {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .hwbd-district {
        font-size: 18px;
    }
    
    .hwbd-temp-display {
        gap: 20px;
    }
    
    .hwbd-feels-like .hwbd-value {
        font-size: 32px;
    }
    
    .hwbd-actual-temp .hwbd-value {
        font-size: 18px;
    }
    
    .hwbd-alert-message {
        font-size: 12px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .hwbd-weather-content {
        padding: 12px 16px;
    }
    
    .hwbd-district {
        font-size: 16px;
    }
    
    .hwbd-division-selector {
        padding: 2px 6px;
    }
    
    .hwbd-location-icon {
        font-size: 12px;
    }
    
    .hwbd-district-select {
        font-size: 10px;
        min-width: 70px;
        padding: 2px 18px 2px 4px;
        background-size: 7px;
    }
    
    .hwbd-weather-content {
        padding: 12px 16px;
    }
    
    .hwbd-district {
        font-size: 16px;
    }
    
    .hwbd-status-badge {
        font-size: 10px;
        padding: 3px 10px;
    }
    
    .hwbd-temp-display {
        gap: 15px;
    }
    
    .hwbd-feels-like .hwbd-value {
        font-size: 28px;
    }
    
    .hwbd-actual-temp .hwbd-value {
        font-size: 16px;
    }
}

/* ============================================
   Accessibility
============================================ */
.hwbd-weather-container:focus-within {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .hwbd-weather-container,
    .hwbd-weather-content,
    .hwbd-alert-message,
    .hwbd-status-badge {
        transition: none;
    }
    
    .hwbd-spinner {
        animation: none;
    }
}

/* ============================================
   Print Styles
============================================ */
@media print {
    .hwbd-weather-container {
        border: 1px solid #ddd;
        background: white !important;
    }
    
    .hwbd-spinner {
        display: none;
    }
}
