/* Estilos generales */
body {
    font-family: 'Press Start 2P', cursive, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #0f0f1a;
    background-image: url('../img/fondoindex.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    font-size: 12px; /* Reducido de ~14px */
    line-height: 1.5; /* Ajustado para mejor legibilidad */
}

header {
    background-color: #1a1a2e;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
    background-color: #333;
    padding: 5px 15px;
    border-radius: 20px;
    cursor: pointer;
    position: relative;
    font-size: 0.7rem; /* Reducido de 0.8rem */
}

.user-info img {
    width: 30px;
    height: 30px;
}

/* Estilos para las secciones */
.section {
    padding: 1.5rem; /* Reducido de 2rem */
    margin: 1rem 0;
    background-color: rgba(22, 33, 62, 0.85);
    border-radius: 10px;
    backdrop-filter: blur(2px);
}

.section h2 {
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 1rem; /* Reducido de 1.5rem */
    font-size: 1.3rem; /* Reducido de ~1.5-2rem */
}

.content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.content img {
    max-width: 100%;
    border-radius: 8px;
}

.news-grid, .events-grid, .content-grid, .blog-grid, .retro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.news-card, .event-card, .content-card, .blog-post, .retro-card {
    background-color: #0f3460;
    padding: 0.8rem; /* Reducido de 1rem */
    border-radius: 8px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.news-card:hover, .event-card:hover, .content-card:hover, 
.blog-post:hover, .retro-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.btn, .btn-more, .btn-read, .btn-watch, .btn-login, 
.btn-register, .btn-recover, .btn-change {
    display: inline-block;
    background-color: #e94560;
    color: white;
    padding: 0.4rem 0.8rem; /* Reducido de 0.5rem 1rem */
    border-radius: 5px;
    text-decoration: none;
    margin-top: 0.5rem;
    border: none;
    cursor: pointer;
    font-family: 'Press Start 2P', cursive, sans-serif;
    font-size: 0.7rem; /* Reducido de 0.8rem */
    transition: background-color 0.3s;
}

.btn:hover, .btn-more:hover, .btn-read:hover, 
.btn-watch:hover, .btn-login:hover, 
.btn-register:hover, .btn-recover:hover, 
.btn-change:hover {
    background-color: #d13354;
}

.news-meta, .post-meta {
    font-size: 0.6rem; /* Reducido de 0.7rem */
    color: #a1a1a1;
    margin-bottom: 0.3rem; /* Reducido de 0.5rem */
}

/* Estilos para el dropdown de usuario */
.user-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: #1a1a2e;
    border: 1px solid #e94560;
    border-radius: 5px;
    padding: 0.5rem 0;
    z-index: 1000;
    min-width: 150px;
}

.user-dropdown a {
    display: block;
    padding: 0.5rem 1rem;
    color: white;
    text-decoration: none;
    font-size: 0.7rem; /* Reducido de 0.8rem */
}

.user-dropdown a:hover {
    background-color: #e94560;
}

/* Estilos para el menú móvil */
#menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem; /* Reducido de 1.5rem */
    cursor: pointer;
    padding: 0.5rem;
}

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.8rem; /* Reducido de 1rem */
}

nav ul li a {
    color: white;
    text-decoration: none;
    font-size: 0.7rem; /* Reducido de 0.8rem */
    transition: color 0.3s;
}

nav ul li a:hover {
    color: #e94560;
}

/* Estilos para notificaciones */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 0.8rem; /* Reducido de 1rem */
    border-radius: 5px;
    color: white;
    opacity: 0;
    transform: translateY(-100%);
    transition: all 0.3s ease;
    z-index: 1001;
    font-size: 0.7rem; /* Reducido de 0.8rem */
}

.notification.success {
    background-color: #51cf66;
}

.notification.error {
    background-color: #ff6b6b;
}

.notification.warning {
    background-color: #fcc419;
}

/* Estilos para imágenes lazy load */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

img.loaded {
    opacity: 1;
}

/* Estilos para sliders */
.slider {
    position: relative;
    overflow: hidden;
    margin: 1rem 0;
}

.slide {
    display: none;
    animation: fade 0.5s ease-in-out;
}

@keyframes fade {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

/* Estilos para el formulario de contacto */
.contact-form {
    margin-top: 1.5rem; /* Reducido de 2rem */
    padding: 0.8rem; /* Reducido de 1rem */
    background-color: #16213e;
    border-radius: 10px;
}

.contact-form h3 {
    margin-top: 0;
    font-size: 1.1rem; /* Reducido de ~1.3rem */
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    width: 100%;
    padding: 0.6rem; /* Reducido de 0.8rem */
    margin-bottom: 0.8rem; /* Reducido de 1rem */
    border: 2px solid #0f3460;
    border-radius: 5px;
    background-color: #0f0f1a;
    color: white;
    font-family: 'Press Start 2P', cursive, sans-serif;
    font-size: 0.6rem; /* Reducido de 0.7rem */
}

.contact-form textarea {
    min-height: 80px; /* Reducido de 100px */
    resize: vertical;
}

.contact-form button[type="submit"] {
    width: auto;
    padding: 0.6rem 1.2rem; /* Reducido de 0.8rem 1.5rem */
    font-size: 0.7rem; /* Añadido para consistencia */
}

/* Estilos para redes sociales */
.social-media {
    display: flex;
    justify-content: center;
    gap: 0.8rem; /* Reducido de 1rem */
    margin-top: 1.5rem; /* Reducido de 2rem */
    padding: 0.8rem 0; /* Reducido de 1rem 0 */
}

.social-media a {
    color: white;
    font-size: 1.3rem; /* Reducido de 1.5rem */
    transition: color 0.3s;
}

.social-media a:hover {
    color: #e94560;
}

/* Estilos para la línea de tiempo */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline-item {
    display: flex;
    margin-bottom: 1.5rem; /* Reducido de 2rem */
}

.timeline-year {
    flex: 0 0 80px; /* Reducido de 100px */
    font-weight: bold;
    color: #e94560;
    font-size: 0.8rem; /* Añadido para consistencia */
}

.timeline-content {
    flex: 1;
    padding-left: 1.2rem; /* Reducido de 1.5rem */
    position: relative;
}

.timeline-content::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #e94560;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    body {
        font-size: 11px; /* Reducción adicional */
    }
    
    header {
        flex-direction: column;
        gap: 0.8rem; /* Reducido de 1rem */
    }
    
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
        display: none;
    }
    
    nav ul.show {
        display: flex;
    }
    
    #menu-toggle {
        display: block;
    }
    
    .section h2 {
        font-size: 1.1rem; /* Reducción adicional */
    }
    
    .news-grid, .events-grid, .content-grid, 
    .blog-grid, .retro-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-item {
        flex-direction: column;
    }
    
    .timeline-year {
        margin-bottom: 0.3rem; /* Reducido de 0.5rem */
    }
    
    .timeline-content {
        padding-left: 0;
        padding-top: 0.8rem; /* Reducido de 1rem */
    }
    
    .timeline-content::before {
        left: 0;
        top: 0;
        width: 100%;
        height: 2px;
    }
    
    .btn, .btn-more, .btn-read, .btn-watch, 
    .btn-login, .btn-register, .btn-recover, 
    .btn-change {
        font-size: 0.6rem; /* Reducción adicional */
    }
}

@media (max-width: 480px) {
    body {
        font-size: 10px; /* Reducción máxima */
    }
    
    .section {
        padding: 1rem;
    }
    
    .section h2 {
        font-size: 1rem; /* Reducción máxima */
    }
    
    .btn, .btn-more, .btn-read, .btn-watch, 
    .btn-login, .btn-register, .btn-recover, 
    .btn-change {
        width: 100%;
        text-align: center;
        padding: 0.4rem; /* Ajuste final */
    }
    
    .user-info {
        padding: 3px 10px; /* Ajuste final */
        font-size: 0.6rem; /* Reducción máxima */
    }
    
    .contact-form input,
    .contact-form select,
    .contact-form textarea {
        font-size: 0.6rem; /* Mantenido */
    }
}

/* Estilos adicionales para mejor legibilidad con texto pequeño */
p {
    margin-bottom: 0.8rem; /* Espaciado reducido entre párrafos */
    line-height: 1.6; /* Mejor legibilidad */
}

h3 {
    font-size: 0.9rem; /* Establecido para consistencia */
    margin-bottom: 0.5rem;
}