:root {
    --primary-color: #0066cc;
    --secondary-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --dark-color: #343a40;
    --light-color: #f8f9fa;
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-primary);
    background-color: #f5f5f5;
    padding-top: 56px;
}

/* Navbar Styles */
#mainNav {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
}

#mainNav.scrolled {
    background: rgba(102, 126, 234, 0.95);
    backdrop-filter: blur(10px);
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: bold;
}

.brand-text {
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
}

.navbar-nav .nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 30px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

/* Hero Section */
.hero-section {
    height: 35vh;
    min-height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,122.7C672,117,768,139,864,154.7C960,171,1056,181,1152,165.3C1248,149,1344,107,1392,85.3L1440,64L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>') no-repeat bottom;
    background-size: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.3);
}

/* News Cards */
.news-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    cursor: pointer;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.news-card-img {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.news-card-body {
    padding: 1.5rem;
}

.news-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.category-politica { background: #ffebee; color: #c62828; }
.category-economia { background: #e8f5e9; color: #2e7d32; }
.category-social { background: #fff8e1; color: #f57c00; }
.category-ambiental { background: #e0f2f1; color: #00695c; }
.category-deportes { background: #ede7f6; color: #4527a0; }
.category-tecnologia { background: #fce4ec; color: #c2185b; }

.news-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: #666;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.news-meta i {
    color: var(--primary-color);
}

/* Map Styles */
.map-sidebar {
    background: white;
    box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    height: calc(100vh - 120px);
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.legend-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.map-news-list {
    max-height: 300px;
    overflow-y: auto;
}

.map-news-item {
    padding: 0.75rem;
    border-left: 3px solid var(--primary-color);
    background: #f8f9fa;
    margin-bottom: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.map-news-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

/* Timeline Control */
.timeline-control {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 1rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
    width: 90%;
    max-width: 400px;
}

/* Dark Mode */
body.dark-mode {
    background-color: #1a1a1a;
    color: #e0e0e0;
}

body.dark-mode #mainNav {
    background: linear-gradient(135deg, #2d3561 0%, #3f2b56 100%);
}

body.dark-mode .card {
    background-color: #2d2d2d;
    border-color: #3d3d3d;
}

body.dark-mode .news-card {
    background-color: #2d2d2d;
}

body.dark-mode .map-sidebar {
    background-color: #2d2d2d;
    color: #e0e0e0;
}

body.dark-mode .form-control,
body.dark-mode .form-select {
    background-color: #3d3d3d;
    border-color: #4d4d4d;
    color: #e0e0e0;
}

body.dark-mode .dropdown-menu {
    background-color: #2d2d2d;
}

body.dark-mode .dropdown-item {
    color: #e0e0e0;
}

body.dark-mode .dropdown-item:hover {
    background-color: #3d3d3d;
}

/* Loading Animation */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        height: 30vh;
        min-height: 200px;
    }
    
    .hero-section h1 {
        font-size: 1.5rem;
    }
    
    .map-sidebar {
        position: fixed;
        left: -100%;
        width: 80%;
        z-index: 1050;
        transition: left 0.3s ease;
    }
    
    .map-sidebar.active {
        left: 0;
    }
    
    #mapContainer {
        height: calc(100vh - 200px) !important;
    }
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #0056b3;
}

/* Filters Section */
.filters-section {
    background: white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

/* Stats Chart Container */
#statsChart {
    max-height: 250px;
}

/* Weather Widget */
#weatherWidget {
    padding: 1rem;
}

#weatherWidget h2 {
    color: var(--info-color);
    font-size: 2.5rem;
}

/* Pagination */
.pagination .page-link {
    color: var(--primary-color);
    border-radius: 50%;
    margin: 0 0.25rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Modal Customization */
.modal-content {
    border-radius: 15px;
    border: none;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, #2d3561 0%, #3f2b56 100%);
    margin-top: auto;
}

.social-links a {
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
}