/* ============================================
   CampusConecta - Universidad Aztlán
   Colores institucionales: Azul y Rojo
============================================ */

:root {
    --azul: #10386b;
    --azul-claro: #1e5aa8;
    --rojo: #c8102e;
    --rojo-oscuro: #9c0c22;
    --gris-fondo: #f2f4f7;
    --blanco: #ffffff;
    --texto: #222831;
}

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

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    background: var(--gris-fondo);
    color: var(--texto);
    line-height: 1.5;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

/* ===== NAVBAR ===== */
.navbar {
    background: var(--azul);
    color: var(--blanco);
    padding: 0.9rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.navbar .marca {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.3rem;
    font-weight: 700;
}

.navbar .marca img {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 2px solid var(--blanco);
    object-fit: cover;
}

.navbar nav ul {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.navbar nav a {
    font-weight: 500;
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    transition: background 0.2s;
}

.navbar nav a:hover {
    background: rgba(255,255,255,0.15);
}

.navbar nav a.btn-salir {
    background: var(--rojo);
}

.navbar nav a.btn-salir:hover {
    background: var(--rojo-oscuro);
}

/* ===== CONTENEDORES GENERALES ===== */
.contenedor {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

.tarjeta {
    background: var(--blanco);
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

/* ===== HERO / PORTADA ===== */
.hero {
    position: relative;
    background: linear-gradient(rgba(16,56,107,0.85), rgba(200,16,46,0.75)),
                url('https://upload.wikimedia.org/wikipedia/commons/7/73/Representantes_de_Vital_Strategies_en_la_Escuela_de_Nutricion_-_dsc1727.jpg?utm_source=es.wikipedia.org&utm_campaign=index&utm_content=original') center/cover no-repeat;
    color: var(--blanco);
    text-align: center;
    padding: 5rem 1.5rem;
}

.hero h1 {
    font-size: 2.6rem;
    margin-bottom: 0.8rem;
}

.hero p {
    font-size: 1.15rem;
    max-width: 650px;
    margin: 0 auto 1.5rem;
    opacity: 0.95;
}

.hero .botones {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* ===== BOTONES ===== */
.btn {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-azul { background: var(--azul); color: var(--blanco); }
.btn-rojo { background: var(--rojo); color: var(--blanco); }
.btn-outline { background: transparent; border: 2px solid var(--blanco); color: var(--blanco); }
.btn-pequeno { padding: 0.4rem 1rem; font-size: 0.85rem; border-radius: 20px; }

/* ===== FORMULARIOS ===== */
.form-caja {
    max-width: 420px;
    margin: 2rem auto;
    background: var(--blanco);
    padding: 2.2rem;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    border-top: 5px solid var(--rojo);
}

.form-caja h2 {
    color: var(--azul);
    margin-bottom: 1.2rem;
    text-align: center;
}

.campo {
    margin-bottom: 1.1rem;
}

.campo label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
    color: var(--azul);
    font-size: 0.9rem;
}

.campo input,
.campo textarea,
.campo select {
    width: 100%;
    padding: 0.65rem 0.8rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 0.95rem;
}

.campo input:focus,
.campo textarea:focus,
.campo select:focus {
    outline: none;
    border-color: var(--azul-claro);
}

.form-caja .btn {
    width: 100%;
    margin-top: 0.5rem;
}

.enlace-alterno {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.9rem;
}

.enlace-alterno a {
    color: var(--rojo);
    font-weight: 600;
}

/* ===== MENSAJES ===== */
.mensaje {
    padding: 0.8rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.mensaje.error { background: #fdecea; color: var(--rojo-oscuro); border: 1px solid var(--rojo); }
.mensaje.exito { background: #e8f4ea; color: #256029; border: 1px solid #2e7d32; }

/* ===== TÍTULOS DE SECCIÓN ===== */
.titulo-seccion {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.titulo-seccion h2 {
    color: var(--azul);
    border-left: 5px solid var(--rojo);
    padding-left: 0.7rem;
}

/* ===== GRID DE PROPUESTAS ===== */
.grid-propuestas {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.4rem;
}

.propuesta-card {
    background: var(--blanco);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    transition: transform 0.15s;
}

.propuesta-card:hover {
    transform: translateY(-4px);
}

.propuesta-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
}

.propuesta-card .contenido {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.categoria-tag {
    display: inline-block;
    background: var(--azul);
    color: var(--blanco);
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    width: fit-content;
}

.propuesta-card h3 {
    color: var(--azul);
    margin-bottom: 0.4rem;
    font-size: 1.05rem;
}

.propuesta-card p.desc {
    font-size: 0.88rem;
    color: #555;
    flex: 1;
    margin-bottom: 0.8rem;
}

.propuesta-card .pie {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #777;
    border-top: 1px solid #eee;
    padding-top: 0.6rem;
}

.voto-btn {
    background: var(--rojo);
    color: var(--blanco);
    border: none;
    padding: 0.4rem 0.9rem;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    transition: background 0.15s;
}

.voto-btn:hover { background: var(--rojo-oscuro); }
.voto-btn:disabled { background: #aaa; cursor: not-allowed; }

/* ===== DASHBOARD ADMIN ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--blanco);
    border-radius: 10px;
    padding: 1.3rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border-bottom: 4px solid var(--azul);
}

.stat-card:nth-child(2) { border-bottom-color: var(--rojo); }
.stat-card:nth-child(3) { border-bottom-color: var(--azul); }
.stat-card:nth-child(4) { border-bottom-color: var(--rojo); }

.stat-card .numero {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--azul);
}

.stat-card .etiqueta {
    color: #777;
    font-size: 0.85rem;
    margin-top: 0.3rem;
}

table.tabla-admin {
    width: 100%;
    border-collapse: collapse;
    background: var(--blanco);
    border-radius: 8px;
    overflow: hidden;
}

table.tabla-admin th {
    background: var(--azul);
    color: var(--blanco);
    text-align: left;
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
}

table.tabla-admin td {
    padding: 0.7rem 1rem;
    border-bottom: 1px solid #eee;
    font-size: 0.87rem;
}

table.tabla-admin tr:hover { background: #f7f9fc; }

.badge-admin {
    background: var(--rojo);
    color: var(--blanco);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
}

.badge-usuario {
    background: var(--azul);
    color: var(--blanco);
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    font-size: 0.7rem;
}

/* ===== COMENTARIOS ===== */
.comentario {
    padding: 0.8rem;
    border-bottom: 1px solid #eee;
}

.comentario:last-child { border-bottom: none; }

.comentario .autor {
    font-weight: 700;
    color: var(--azul);
    font-size: 0.88rem;
}

.comentario .fecha {
    font-size: 0.75rem;
    color: #999;
}

.comentario p {
    margin-top: 0.3rem;
    font-size: 0.9rem;
}

.lista-comentarios {
    max-height: 320px;
    overflow-y: auto;
}

/* ===== FOOTER ===== */
footer {
    text-align: center;
    padding: 1.5rem;
    color: #888;
    font-size: 0.85rem;
    border-top: 1px solid #ddd;
    margin-top: 2rem;
}

/* ===== TABS (admin) ===== */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #ddd;
}

.tabs a {
    padding: 0.7rem 1.2rem;
    font-weight: 600;
    color: #666;
    border-bottom: 3px solid transparent;
}

.tabs a.activo {
    color: var(--rojo);
    border-bottom-color: var(--rojo);
}

@media (max-width: 700px) {
    .navbar { flex-direction: column; gap: 0.7rem; }
    .navbar nav ul { flex-wrap: wrap; justify-content: center; gap: 0.7rem; }
    .hero h1 { font-size: 1.9rem; }
}
