/* ==========================================================================
   RESET & CONFIGURACIÓN GLOBAL
   ========================================================================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --bg-main: #0d1117;
    /* Fondo noche limpio */
    --panel-bg: #161b22;
    /* Fondo tarjetas/nav */
    --border-color: #30363d;
    /* Bordes finos */
    --accent-red: #ff4d4d;
    /* Rojo UCM */
    --accent-green: #2ea043;
    /* Verde botón/estado */
    --text-primary: #f0f6fc;
    /* Texto principal brillante */
    --text-secondary: #8b949e;
    /* Texto secundario legibles */
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ==========================================================================
   CABECERA (NAVBAR)
   ========================================================================== */
.navbar {
    background-color: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    width: 100%;
}

.navbar .container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 12px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 700;
    text-decoration: none;
}

.logo span {
    color: var(--accent-red);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 18px;
}

nav a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.88rem;
    transition: color 0.2s;
}

nav a:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   CONTENEDOR PRINCIPAL
   ========================================================================== */
main.container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 1px 1px;
    flex: 1;
}

/* Encabezado sin bloque grande ni espacios sobrantes */
.intro-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 24px;
}

.intro-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.intro-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    max-width: 800px;
    margin-bottom: 14px;
}

/* Botón estilo limpio */
.btn {
    display: inline-block;
    background-color: var(--accent-green);
    color: #ffffff;
    padding: 6px 14px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

/* ==========================================================================
   SECCIÓN DE TARJETAS
   ========================================================================== */
.projects-section h2 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 14px;
}

.card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 16px;
}

.card-icon {
    font-size: 1.3rem;
    margin-bottom: 8px;
    display: block;
}

.card h3 {
    font-size: 0.98rem;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--text-primary);
}

.card p {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.page-header.text-center p {
    font-size: 1.5rem;
    color: var(--text-primary);

}

/* ==========================================================================
   DISEÑO HORIZONTAL PARA CARTELES Y EVENTOS
   ========================================================================== */

.events-section {
    margin-bottom: 30px;
}

.events-grid {
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Espacio entre cada tarjeta de evento */
}

/* Tarjeta dispuesta en horizontal */
.event-card {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    /* Imagen a la izquierda, texto a la derecha */
    align-items: stretch;
}

/* Columna de la imagen (Izquierda) */
.event-image {
    width: 220px;
    /* Ancho fijo para el cartel */
    min-width: 220px;
    /* Evita que se aplaste */
    height: auto;
    min-height: 180px;
    /* Altura mínima proporcional */
    background-color: #0d1117;
    /* Fondo oscuro para rellenos */
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-right: 1px solid var(--border-color);
    /* Separador vertical */
}

/* Imagen completa sin recortes */
.event-image img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    /* Cartel entero visible siempre */
    display: block;
    padding: 6px;
    /* Pequeño margen interno de aire */
}

/* Columna de texto (Derecha) */
.event-content {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Centra verticalmente el texto respecto al cartel */
    flex: 1;
}

.event-date {
    font-size: 0.78rem;
    color: #58a6ff;
    font-weight: 600;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.event-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.event-card p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* Adaptabilidad a pantallas de móviles (se apila verticalmente si la pantalla es muy estrecha) */
@media (max-width: 640px) {
    .event-card {
        flex-direction: column;
    }

    .event-image {
        width: 100%;
        min-width: 100%;
        height: 220px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}

/* ==========================================================================
   PIE DE PÁGINA (FOOTER)
   ========================================================================== */
.footer {
    background-color: var(--panel-bg);
    border-top: 1px solid var(--border-color);
    padding: 12px 16px;
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-secondary);
    margin-top: auto;
}

/* Estilos para encabezados de página */
.page-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.page-header.text-center {
    text-align: center;
}

.page-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Tabla de Servidores */
.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.server-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 0.88rem;
}

.server-table th,
.server-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.server-table th {
    background-color: #21262d;
    color: var(--text-primary);
    font-weight: 600;
}

.server-table code {
    background: #0d1117;
    padding: 2px 6px;
    border-radius: 4px;
    color: #58a6ff;
    font-size: 0.82rem;
}

.status {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    display: inline-block;
}

.status.online {
    background-color: rgba(46, 160, 67, 0.15);
    color: #3fb950;
    border: 1px solid rgba(46, 160, 67, 0.4);
}

.status.maintenance {
    background-color: rgba(210, 153, 34, 0.15);
    color: #d29922;
    border: 1px solid rgba(210, 153, 34, 0.4);
}

/* Formulario y Alertas */
.form-section {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.form {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 20px;
    width: 100%;
    max-width: 480px;
}

.form-group {
    margin-bottom: 14px;
}

.form-group label {
    display: block;
    margin-bottom: 4px;
    font-size: 0.85rem;
    color: var(--text-primary);
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 8px 10px;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.88rem;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #58a6ff;
}

.alert {
    width: 100%;
    max-width: 480px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 0.86rem;
    margin-bottom: 16px;
}

.alert.error {
    background-color: rgba(248, 81, 73, 0.15);
    color: #f85149;
    border: 1px solid rgba(248, 81, 73, 0.4);
}

.alert.success {
    background-color: rgba(46, 160, 67, 0.15);
    color: #3fb950;
    border: 1px solid rgba(46, 160, 67, 0.4);
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    /* Espacio entre la imagen y el texto si lo dejas */
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
}

.logo-img {
    height: 32px;
    /* Ajusta la altura según cómo se vea tu logo */
    width: auto;
    /* Mantiene la proporción de la imagen */
    display: block;
    object-fit: contain;
}

.footer p {
    margin: 2px 0;
}