/* CSS variables for a premium dark mode design */
:root {
    --bg-dark: #0a0a0f;
    --bg-card: rgba(20, 20, 25, 0.7);
    --text-main: #f0f0f5;
    --text-muted: #9ba1a6;
    --accent-red: #ff3b30;
    --accent-blue: #0a84ff;
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(10, 10, 15, 0.75);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Light mode variables */
body.light-mode {
    --bg-dark: #f8fafc;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent-red: #e11d48;
    --accent-blue: #2563eb;
    --glass-border: rgba(0, 0, 0, 0.15);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --shadow-soft: 0 8px 32px 0 rgba(0, 0, 0, 0.05);
}

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

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: var(--font-body);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Typography */
h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.3s ease;
}

/* Glassmorphism Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--glass-border);
    transition: padding 0.3s ease, background 0.3s ease;
    padding: 1.5rem 0;
}

.navbar.scrolled {
    padding: 0.8rem 0;
    background: rgba(10, 10, 15, 0.95);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-display);
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}

.logo span {
    color: var(--accent-red);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.nav-links li a {
    font-weight: 500;
    font-size: 0.95rem;
    position: relative;
    padding-bottom: 0.2rem;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--accent-red);
    transition: width 0.3s ease;
}

.nav-links li a:hover::after, .nav-links li a.active::after {
    width: 100%;
}

.menu-toggle {
    display: none;
    cursor: pointer;
}

.bar {
    display: block;
    width: 25px;
    height: 3px;
    margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--text-main);
}

/* Slider Backgrounds */
.slider-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    z-index: 0;
    animation: slideShow 24s infinite;
}

.slider-bg.bg-1 {
    background-image: url('assets/dev1.png');
    animation-delay: 0s;
}

.slider-bg.bg-2 {
    background-image: url('assets/dev2.png');
    animation-delay: 6s;
}

.slider-bg.bg-3 {
    background-image: url('assets/dev3.png');
    animation-delay: 12s;
}

.slider-bg.bg-4 {
    background-image: url('assets/dev4.png');
    animation-delay: 18s;
}

@keyframes slideShow {
    0% { opacity: 0; transform: scale(1.05); }
    5% { opacity: 1; transform: scale(1); }
    25% { opacity: 1; transform: scale(1); }
    30% { opacity: 0; transform: scale(1.05); }
    100% { opacity: 0; }
}

/* News Ticker */
.news-ticker {
    background-color: var(--accent-red);
    color: white;
    padding: 0.8rem 0;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    z-index: 99; /* Below navbar */
    display: flex;
    align-items: center;
    border-bottom: 2px solid rgba(0,0,0,0.2);
    margin-top: 85px; /* Offset for fixed navbar */
}

.ticker-content {
    display: inline-block;
    white-space: nowrap;
    animation: ticker 200s linear infinite;
}

.ticker-content:hover {
    animation-play-state: paused;
}

.ticker-item {
    display: inline-block;
    padding: 0 2rem;
    font-size: 1.15rem;
    font-weight: bold;
    font-family: var(--font-body);
}

@keyframes ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Hero Section */
.hero {
    min-height: 60vh;
    padding: 150px 0 100px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: radial-gradient(circle at 50% 50%, rgba(204, 0, 0, 0.05) 0%, var(--bg-dark) 100%);
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    padding: 0 2rem;
}

.hero-content h1 {
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    margin: 1.5rem 0;
    background: linear-gradient(135deg, #fff, #a0a0a0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-content p {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.badge {
    background: rgba(255, 59, 48, 0.2);
    color: var(--accent-red);
    border: 1px solid rgba(255, 59, 48, 0.4);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-cta {
    background: var(--accent-red);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 30px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.nav-cta:hover {
    background: #e60000;
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.5);
    transform: translateY(-2px);
}

/* Theme Toggle Button */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.theme-toggle:hover {
    background: var(--glass-border);
}

.btn {
    display: inline-block;
    background: var(--accent-red);
    color: #fff;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 59, 48, 0.4);
}



/* Main Content */
.container {
    max-width: 1200px;
    margin: 5rem auto;
    padding: 0 2rem;
}

.section-header {
    margin-bottom: 3rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.section-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.featured {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 0;
}

.news-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    overflow: hidden;
    transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(255, 255, 255, 0.2);
}

.card-img {
    height: 240px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.featured .card-img {
    height: 100%;
    min-height: 400px;
}

.category {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: rgba(10, 10, 15, 0.8);
    backdrop-filter: blur(8px);
    padding: 0.4rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid var(--glass-border);
}

.card-content {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-content h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    transition: color 0.3s ease;
}

.featured .card-content h3 {
    font-size: 2.2rem;
}

.news-card:hover .card-content h3 {
    color: var(--accent-blue);
}

.excerpt {
    color: var(--text-muted);
    margin-bottom: 2rem;
    flex-grow: 1;
}

.card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1.5rem;
    border-top: 1px solid var(--glass-border);
}

.date {
    color: #6c7075;
    font-size: 0.9rem;
}

.read-more {
    color: var(--accent-blue);
    font-weight: 600;
    font-size: 0.95rem;
}

.read-more:hover {
    text-decoration: underline;
}

/* Footer */
footer {
    background: #050508;
    padding: 4rem 2rem 2rem;
    border-top: 1px solid var(--glass-border);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
}

.footer-logo {
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 800;
}

.footer-logo span {
    color: var(--accent-red);
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--accent-red);
    transform: translateY(-3px);
}

.footer-bottom {
    max-width: 1200px;
    margin: 3rem auto 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Animations */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

.delay-1 { animation-delay: 0.2s; }
.delay-2 { animation-delay: 0.4s; }
.delay-3 { animation-delay: 0.6s; }

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

/* Responsive */
@media (max-width: 768px) {
    .featured {
        grid-template-columns: 1fr;
    }
    
    .featured .card-img {
        min-height: 250px;
    }

    .menu-toggle {
        display: block;
    }

    .nav-links {
        position: fixed;
        top: 70px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        transition: left 0.4s ease;
    }

    .nav-links.active {
        left: 0;
    }

    .nav-links li {
        margin: 1.5rem 0;
    }
    
    .hero-content h1 {
        font-size: 2.5rem;
    }
}

/* Theme Toggle Button */
.theme-toggle {
    background: none;
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 1rem;
    transition: all 0.3s ease;
}

.theme-toggle:hover {
    background: var(--bg-card);
    transform: scale(1.1);
}

/* Light Mode Overrides */
body.light-mode {
    --bg-dark: #f0f2f5;
    --bg-card: rgba(255, 255, 255, 0.85);
    --text-main: #1c1e21;
    --text-muted: #606770;
    --glass-border: rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.9);
}

body.light-mode .hero-overlay {
    background: transparent;
}

body.light-mode .hero-content h1 {
    background: linear-gradient(135deg, #000, #444);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode footer {
    background: #e4e6eb;
    border-top: 1px solid var(--glass-border);
}

body.light-mode .navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
}

body.light-mode .category {
    background: rgba(255, 255, 255, 0.9);
    color: #1c1e21;
    border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .theme-toggle {
    color: #1c1e21;
}

@media (max-width: 768px) {
    body.light-mode .nav-links {
        background: rgba(255, 255, 255, 0.95);
    }
}

/* Dashboard Statistics */
.stats-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    border-radius: 15px;
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
}

.stat-card h4 {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-main);
}

.stat-number.danger { color: var(--accent-red); }
.stat-number.warning { color: #f7a800; }
.stat-number.success { color: #28c76f; }

.stat-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

body.light-mode .stat-number {
    color: #000;
}
body.light-mode .stat-number.danger { color: #d00000; }

/* International Aid Graph */
.aid-list {
    list-style: none;
    margin-top: 1rem;
}
.aid-list li {
    margin-bottom: 1.2rem;
}
.aid-label {
    display: flex;
    justify-content: space-between;
    font-size: 0.95rem;
    margin-bottom: 0.4rem;
    font-weight: 600;
}
.aid-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}
body.light-mode .aid-bar {
    background: rgba(0, 0, 0, 0.1);
}
.aid-fill {
    height: 100%;
    border-radius: 10px;
}

/* Modales Interactivos */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 999999;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    padding: 2.5rem;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.6);
    text-align: center;
    animation: fadeInUp 0.3s ease forwards;
}

.close-btn {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: color 0.2s;
}

.close-btn:hover {
    color: var(--text-main);
}

/* Directorio de Ayuda Nuevo */
.btn-tel {
    background: var(--bg-card);
    border: 1px solid var(--accent-red);
    color: var(--text-main);
    padding: 0.8rem 1.5rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.2s ease;
}
.btn-tel:hover {
    background: var(--accent-red);
    color: white;
    box-shadow: 0 0 15px rgba(204,0,0,0.5);
}

.dir-link {
    display: block;
    background: transparent;
    color: var(--text-main);
    text-decoration: none;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}
.dir-link:hover {
    background: var(--glass-border);
    border-color: var(--text-muted);
    transform: translateX(5px);
}

/* Teléfonos y Pantallas Pequeñas */
@media (max-width: 480px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    .stats-dashboard {
        grid-template-columns: 1fr;
    }
    .modal-content {
        padding: 1.5rem;
    }
    .btn-tel {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    .nav-container {
        padding: 0 1rem;
    }
    .news-grid {
        grid-template-columns: 1fr;
    }
}
