/* =========================================
   VARIABLES Y COLORES BASE
========================================= */
:root {
    --bg-light: #f0f2f5;
    --bg-dark: #050505;
    --glass-light: rgba(255, 255, 255, 0.85);
    --glass-dark: rgba(20, 20, 20, 0.9);
    --neon-accent: #8A2BE2; /* Violeta EPCTV */
    --neon-glow: 0 0 15px rgba(138, 43, 226, 0.4);
    --text-light: #1a1a1a;
    --text-dark: #ffffff;
    --bento-gap: 25px;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    margin: 0; padding: 0;
    background: var(--bg-light);
    color: var(--text-light);
    background-image: radial-gradient(circle at 10% 20%, rgba(138, 43, 226, 0.05) 0%, transparent 20%);
    transition: background 0.3s, color 0.3s;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* --- MODO OSCURO GLOBAL --- */
.dark-mode, .dark-mode body {
    background: var(--bg-dark);
    color: var(--text-dark);
}

/* =========================================
   COMPONENTES GLOBALES
========================================= */
/* Glassmorphism Card */
.glass-card {
    background: var(--glass-light);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
}
.dark-mode .glass-card {
    background: var(--glass-dark);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

/* Botones */
.btn-neon {
    background: var(--neon-accent); color: white; border: none; padding: 12px 20px; 
    border-radius: 10px; cursor: pointer; font-weight: 600; text-decoration: none;
    display: inline-block; text-align: center; transition: 0.2s;
}
.btn-neon:hover { box-shadow: var(--neon-glow); transform: scale(1.02); }

/* Inputs y Selects */
input, select, textarea {
    width: 100%; padding: 12px; margin: 8px 0 15px 0; border-radius: 8px;
    border: 1px solid #ccc; background: rgba(255,255,255,0.9);
    box-sizing: border-box; font-family: inherit; color: #333;
}
.dark-mode input, .dark-mode select, .dark-mode textarea {
    background: rgba(20,20,20,0.6); border-color: #555; color: white;
}
select option { background-color: #ffffff; color: #000000; }
.dark-mode select option { background-color: #222222; color: #ffffff; }

/* Modales */
.popup-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.8); display:none; justify-content:center; align-items:center; z-index:2000; }

/* =========================================
   NAVEGACIÓN ESCRITORIO (PC)
========================================= */
.main-nav {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 30px; margin: 20px auto 30px auto; width: 90%; max-width: 1200px;
    position: sticky; top: 20px; z-index: 1000;
    background: rgba(255, 255, 255, 0.85); backdrop-filter: blur(20px);
    border-radius: 50px; box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}
.dark-mode .main-nav { background: rgba(20, 20, 20, 0.85); color: white; }

.nav-logo { font-weight: 900; font-size: 1.5rem; text-decoration: none; letter-spacing: 1px; color: inherit; }
.nav-links { display: flex; gap: 25px; list-style: none; margin: 0; padding: 0; align-items: center; }
.nav-links a { text-decoration: none; color: inherit; font-weight: 500; transition: color 0.3s; }
.nav-links a:hover { color: var(--neon-accent); }
.nav-controls-mobile { display: none; } /* Oculto en PC */


/* =========================================
   SISTEMA DE GRILLAS (PC)
========================================= */
.bento-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: var(--bento-gap); padding: 20px 5%; max-width: 1400px; margin: 0 auto;
}
.bento-center { justify-content: center; grid-template-columns: repeat(auto-fit, minmax(280px, 350px)); }
.bento-item { display: flex; flex-direction: column; justify-content: space-between; height: 100%; transition: transform 0.2s; }
.bento-item:hover { transform: translateY(-3px); }

.plans-grid {
    display: flex; flex-wrap: wrap; justify-content: center; gap: 25px;
    padding: 20px 5%; max-width: 1400px; margin: 0 auto; width: 100%; box-sizing: border-box;
}
.plans-grid .plan-card { flex: 1 1 250px; max-width: 400px; }


/* =========================================
   ELEMENTOS ESPECÍFICOS
========================================= */
/* Tienda */
.product-img-container {
    width: 100%; height: 220px; overflow: hidden; border-radius: 12px;
    margin-bottom: 15px; background: rgba(0,0,0,0.05);
    display: flex; align-items: center; justify-content: center;
}
.product-img-container img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }

/* Objetivos (Progress Bar) */
.progress-container {
    background: rgba(0,0,0,0.1); height: 24px; border-radius: 12px; 
    overflow: hidden; margin: 15px 0; position: relative; border: 1px solid rgba(0,0,0,0.05);
}
.dark-mode .progress-container { background: rgba(255,255,255,0.1); }
.progress-bar {
    height: 100%; background: linear-gradient(90deg, var(--neon-accent), #bd60ff);
    box-shadow: 0 0 15px var(--neon-glow); border-radius: 10px; transition: width 1s ease-in-out;
}

/* Acordeón de Logros */
details.acordeon-logros {
    background: var(--glass-light); backdrop-filter: blur(12px); border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 15px; margin-bottom: 15px; padding: 15px 25px; transition: all 0.3s ease;
}
.dark-mode details.acordeon-logros { background: var(--glass-dark); border-color: rgba(255, 255, 255, 0.1); }
summary.acordeon-titulo {
    font-size: 1.3rem; font-weight: 700; cursor: pointer; color: var(--neon-accent);
    list-style: none; display: flex; justify-content: space-between; align-items: center;
}
summary.acordeon-titulo::-webkit-details-marker { display: none; }
summary.acordeon-titulo::after { content: '▼'; font-size: 0.9rem; transition: transform 0.3s ease; }
details[open] summary.acordeon-titulo::after { transform: rotate(180deg); }

/* Menú del Administrador */
.admin-menu { display: flex; gap: 10px; margin-bottom: 30px; padding: 10px; margin-left: -10px; margin-right: -10px; flex-wrap: wrap; }
.admin-tab { 
    flex: 1; min-width: 140px; display: flex; align-items: center; justify-content: center; gap: 8px;
    white-space: nowrap; padding: 15px 10px; border-radius: 15px; text-decoration: none; 
    font-weight: bold; color: white; opacity: 0.7; transition: 0.3s; 
}
.admin-tab:hover, .admin-tab.active { opacity: 1; transform: scale(1.0); z-index: 10; }
.tab-noticias { background: linear-gradient(135deg, #333, #555); }
.tab-tienda { background: linear-gradient(135deg, #8A2BE2, #DA70D6); }
.tab-planes { background: linear-gradient(135deg, #FF8C00, #FFD700); }
.tab-objetivos { background: linear-gradient(135deg, #FF416C, #FF4B2B); }
.tab-config { background: linear-gradient(135deg, #11998e, #38ef7d); }
.tab-informes { background: linear-gradient(135deg, #00c6ff, #0072ff); }


/* =========================================
   📱 MODO MÓVIL (SÓLO PARA CELULARES)
========================================= */
@media (max-width: 768px) {
    body { padding: 10px; overflow-x: hidden; }

    /* --- NAVEGACIÓN HAMBURGUESA --- */
    .main-nav {
        flex-direction: column !important;
        padding: 15px 20px !important;
        border-radius: 15px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        margin: 0 auto 20px auto !important;
    }
    .nav-header { display: flex; justify-content: space-between; align-items: center; width: 100%; }
    .nav-controls-mobile { display: flex; align-items: center; gap: 15px; }
    .hamburger {
        background: transparent; border: none; color: var(--neon-accent);
        font-size: 2.2rem; cursor: pointer; padding: 0; line-height: 1;
    }
    
    .nav-links {
        display: none; /* Oculto por defecto */
        flex-direction: column; width: 100%; margin-top: 20px; gap: 10px;
    }
    .nav-links.active {
        display: flex !important; /* Muestra al hacer toggle */
        animation: fadeIn 0.3s ease-out;
    }
    .nav-links li { width: 100%; text-align: center; }
    .nav-links a {
        display: block; padding: 14px; background: rgba(138, 43, 226, 0.1); border-radius: 12px; font-weight: bold;
    }
    .theme-desktop { display: none; }

    /* --- GRILLAS AL 100% Y SEPARADAS --- */
    .bento-grid, .plans-grid, #productGrid {
        display: flex !important; flex-direction: column !important; gap: 30px !important; padding: 0 5px !important;
    }

    /* --- TARJETAS FLEXIBLES --- */
    .glass-card, .bento-item, .product-card, .plan-card {
        width: 100% !important; height: auto !important; min-height: min-content !important;
        margin-bottom: 0 !important; padding: 20px !important; box-sizing: border-box !important;
    }

    /* --- TEXTOS E IMÁGENES --- */
    h1 { font-size: 2rem !important; line-height: 1.2; }
    h2 { font-size: 1.5rem !important; }
    .prod-title { font-size: 1.3rem !important; }
    .plan-price { font-size: 2.5rem !important; }

    .product-img-container { height: auto !important; max-height: 300px !important; }
    .product-img-container img { height: 100% !important; max-height: 300px !important; object-fit: cover !important; }

    /* --- FORMULARIOS Y MODALES --- */
    .filtros-mobile { flex-direction: column !important; gap: 10px !important; }
    .filtros-mobile input, .filtros-mobile select { width: 100% !important; margin: 0 !important; }
    .product-card input[type="number"] { width: 60px !important; }
    .donation-input { width: 100% !important; box-sizing: border-box !important; }
    
    .popup-overlay .glass-card { width: 95% !important; padding: 20px 15px !important; margin: auto !important; }
}