/* Estilo general para toda la página */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f4f9;
    color: #333;
    margin: 0;
    padding: 20px;
}

/* Contenedor principal para centrar el contenido */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Estilo para los títulos principales */
h1 {
    color: #4a4a4a;
    text-align: center;
}

/* Estilo para las tablas */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    background-color: white;
}

th, td {
    padding: 12px 15px;
    border: 1px solid #ddd;
    text-align: left;
}

thead {
    background-color: #007bff;
    color: white;
}

tr:nth-child(even) {
    background-color: #f8f9fa; /* Filas alternas con color */
}

/* Estilo para los botones */
button, input[type="submit"] {
    background-color: #007bff;
    color: white;
    padding: 10px 15px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease; /* Transición suave */
}

button:hover, input[type="submit"]:hover {
    background-color: #0056b3;
}

/* Estilo para los botones de eliminar */
button.delete-btn, .delete-btn {
    background-color: #dc3545;
}
button.delete-btn:hover, .delete-btn:hover {
    background-color: #c82333;
}

/* Estilo para los enlaces */
a {
    color: #007bff;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Estilo para los formularios */
form {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    max-width: 500px;
    margin: 20px auto;
}

input[type="text"], input[type="password"], input[type="number"], input[type="datetime-local"] {
    width: 100%;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Asegura que el padding no afecte el ancho total */
}

/* Estilos para los mensajes flash */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid transparent;
    border-radius: 4px;
    text-align: center;
}
.alert-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}
.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}
.alert-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}


/* --- MAGIA PARA MÓVILES (MEDIA QUERIES) --- */
@media screen and (max-width: 768px) {
    body {
        padding: 10px;
    }
    .container {
        padding: 10px;
    }

    table, thead, tbody, th, td, tr { 
        display: block; 
    }
    
    thead tr { 
        position: absolute;
        top: -9999px;
        left: -9999px;
    }
    
    tr { border: 1px solid #ccc; margin-bottom: 10px; }
    
    td { 
        border: none;
        border-bottom: 1px solid #eee; 
        position: relative;
        padding-left: 50%; 
        text-align: right;
    }
    
    td:before { 
        position: absolute;
        top: 12px;
        left: 10px;
        width: 45%; 
        padding-right: 10px; 
        white-space: nowrap;
        font-weight: bold;
        text-align: left;
    }

    /* Asignamos el título a cada celda (esto es genérico, se puede mejorar) */
    td:nth-of-type(1):before { content: attr(data-label); }
    /* (Se necesitaría javascript para hacerlo dinámico, pero esto es un buen comienzo visual) */
}