/* --- Base y Reset --- */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
}

html {
    scroll-behavior: smooth; /* Desplazamiento suave al hacer clic en enlaces */
}

body { 
    background-color: #f4f7f6; 
    color: #333; 
    line-height: 1.6;
}

.container { 
    max-width: 1100px; 
    margin: 0 auto; 
    padding: 0 20px; 
}

/* --- Header con Navegación Fija (Sticky) --- */
header { 
    background: #2c3e50; 
    color: #fff; 
    padding: 15px 0; 
    border-bottom: 4px solid #3498db;
    position: sticky; /* La barra baja cuando haces scroll */
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.flex-header { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
}

header h1 span { 
    color: #3498db; 
}

nav ul { 
    display: flex; 
    list-style: none; 
    align-items: center; 
}

nav ul li { 
    margin-left: 20px; 
}

nav ul li a { 
    color: #fff; 
    text-decoration: none; 
    font-weight: bold; 
    transition: 0.3s;
}

nav ul li a:hover, nav ul li a.active { 
    color: #3498db; 
}

/* --- Botones --- */
.btn-login {
    background: #3498db;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    transition: 0.3s;
}

.btn-login:hover { 
    background: #2980b9; 
}

.btn-submit { 
    width: 100%; 
    padding: 12px; 
    background: #2c3e50; 
    color: white; 
    border: none; 
    border-radius: 5px; 
    cursor: pointer; 
    font-size: 1rem; 
    font-weight: bold;
    transition: 0.3s;
}

.btn-submit:hover { 
    background: #34495e; 
    transform: translateY(-1px);
}

/* --- Sección Hero --- */
.hero {
    background: linear-gradient(rgba(44, 62, 80, 0.8), rgba(44, 62, 80, 0.8)), 
                url('https://images.unsplash.com/photo-1518770660439-4636190af475?auto=format&fit=crop&w=1200');
    background-size: cover;
    background-position: center;
    height: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
}

/* --- Grid de Noticias (Cards) --- */
.section-title { 
    margin: 40px 0 20px; 
    text-align: left; 
    border-left: 5px solid #3498db; 
    padding-left: 15px; 
    font-size: 1.8rem;
}

.news-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); 
    gap: 25px; 
    margin-bottom: 50px;
}

.card { 
    background: #fff; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); 
    transition: transform 0.3s;
}

.card:hover { 
    transform: translateY(-5px); 
}

.card-image { 
    height: 180px; 
    background-size: cover; 
    background-position: center; 
}

.card-content { 
    padding: 20px; 
}

.category { 
    color: #3498db; 
    font-size: 0.8rem; 
    text-transform: uppercase; 
    font-weight: bold; 
}

.btn { 
    display: inline-block; 
    margin-top: 15px; 
    padding: 10px 20px; 
    background: #2c3e50; 
    color: #fff; 
    text-decoration: none; 
    border-radius: 5px; 
    transition: 0.3s;
}

.btn:hover { 
    background: #34495e; 
}

/* --- Estilos para Formularios de Acceso (Login/Registro) --- */
.input-group { 
    margin-bottom: 15px; 
    text-align: left;
}

.input-group label { 
    display: block; 
    margin-bottom: 5px; 
    font-weight: bold; 
    color: #2c3e50;
}

.input-group input { 
    width: 100%; 
    padding: 10px; 
    border: 2px solid #ccc; 
    border-radius: 5px; 
    outline: none;
    transition: 0.3s;
}

/* Estados de Validación en Tiempo Real */
.input-group input:focus { 
    border-color: #3498db; 
}

.input-group input.invalid { 
    border-color: #e74c3c; 
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.2); 
}

.input-group input.valid { 
    border-color: #2ecc71; 
    box-shadow: 0 0 5px rgba(46, 204, 113, 0.2); 
}

.form-footer { 
    margin-top: 15px; 
    font-size: 0.9rem; 
    text-align: center; 
    color: #666;
}

/* --- Menú Desplegable de Usuario Logueado --- */
.user-menu {
    position: relative;
}

.user-btn {
    background: #34495e;
    color: white;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    border: none;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    background: white;
    min-width: 160px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.2);
    border-radius: 4px;
    z-index: 1100;
}

.dropdown-menu a {
    color: #333 !important;
    padding: 12px 16px;
    display: block;
}

.dropdown-menu a:hover {
    background: #f1f1f1;
}

.show { 
    display: block; 
}

/* --- Footer --- */
footer {
    background: #2c3e50;
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: 50px;
}