/* ============================================================================
   IgniWise - Estilos CSS
   Diseño responsive y profesional
   ============================================================================ */

/* Reset y variables */
:root {
    --color-primary: #667eea;
    --color-secondary: #764ba2;
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-danger: #ef4444;
    --color-gray-100: #f7fafc;
    --color-gray-200: #edf2f7;
    --color-gray-700: #4a5568;
    --color-gray-900: #1a202c;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    min-height: 100vh;
    color: var(--color-gray-900);
    line-height: 1.6;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
    animation: fadeInDown 0.6s ease;
}

.header-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.header-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    opacity: 0.95;
    font-weight: 300;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    animation: fadeInUp 0.8s ease;
}

@media (min-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr 400px;
    }
}

/* Map Section */
.map-section {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    height: 600px;
}

.map-container {
    width: 100%;
    height: 100%;
}

/* Info Panel */
.info-panel {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: var(--shadow-xl);
    max-height: 600px;
    overflow-y: auto;
}

.panel-header {
    margin-bottom: 24px;
}

.panel-header h2 {
    font-size: 1.5rem;
    color: var(--color-gray-900);
    margin-bottom: 8px;
}

.last-update {
    font-size: 0.875rem;
    color: var(--color-gray-700);
}

/* Legend */
.legend {
    background: var(--color-gray-100);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.legend h3 {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--color-gray-900);
}

.legend-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}

.legend-item:last-child {
    margin-bottom: 0;
}

.legend-color {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    box-shadow: var(--shadow-sm);
    margin-top: 2px;
}

.legend-text {
    flex: 1;
}

.legend-text strong {
    display: block;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.legend-text p {
    font-size: 0.85rem;
    color: var(--color-gray-700);
    margin: 0;
}

/* Province Detail */
.province-detail {
    background: var(--color-gray-100);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.province-detail .instruction {
    text-align: center;
    color: var(--color-gray-700);
    font-size: 0.9rem;
}

.province-detail.active {
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
}

.province-detail h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
}

.detail-section {
    margin-bottom: 16px;
}

.detail-section h4 {
    font-size: 1rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.detail-item {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
}

.prediction-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 1rem;
    margin-bottom: 12px;
}

.recommendation {
    background: rgba(255, 255, 255, 0.15);
    padding: 12px;
    border-radius: 8px;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Disclaimer */
.disclaimer {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 16px;
    border-radius: 8px;
    font-size: 0.85rem;
}

.disclaimer h4 {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: #856404;
}

.disclaimer p {
    margin-bottom: 8px;
    color: #856404;
}

.disclaimer a {
    color: #0056b3;
    text-decoration: underline;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    margin-top: 40px;
    padding: 24px 0;
    animation: fadeIn 1s ease;
}

.footer-content {
    opacity: 0.95;
}

.footer-content p {
    margin-bottom: 12px;
    font-size: 0.9rem;
}

.footer-links {
    margin: 16px 0;
}

.footer-links a {
    color: white;
    text-decoration: none;
    margin: 0 8px;
    transition: opacity 0.2s;
}

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

.footer-credits {
    font-size: 0.85rem;
    opacity: 0.8;
}

.footer-credits a {
    color: white;
    text-decoration: underline;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
}

.leaflet-popup-content {
    min-width: 220px;
    font-family: inherit;
}

.popup-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--color-gray-900);
}

.popup-status {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 16px;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
    margin-bottom: 8px;
}

.popup-info {
    font-size: 0.9rem;
    color: var(--color-gray-700);
    line-height: 1.5;
}

.popup-info strong {
    color: var(--color-gray-900);
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

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

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: var(--color-gray-700);
}

.spinner {
    border: 3px solid var(--color-gray-200);
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    .map-section {
        height: 400px;
    }
    
    .info-panel {
        max-height: none;
    }
}
