/* =========================================================================
   styles.css - Ejemplo de estilos básicos responsivos
   ========================================================================= */

/* =======================
   RESET / BASE
   ======================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    line-height: 1.4;
}

/* Envoltorio principal */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 20px auto;
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
}

/* =======================
   CABECERAS Y TEXTO
   ======================= */
h1, h2, h3 {
    margin-bottom: 15px;
}

p, label {
    margin-bottom: 5px;
}

/* =======================
   ENLACES
   ======================= */
a {
    color: #007BFF;
    text-decoration: none;
    cursor: pointer;
}
a:hover {
    text-decoration: underline;
}

/* =======================
   NAVEGACIÓN
   ======================= */
nav ul {
    list-style: none;
    margin: 10px 0;
    padding: 0;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
nav ul li {
    margin-right: 10px;
}
nav a {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 3px;
    background-color: #007BFF;
    color: #fff;
    font-weight: 500;
}
nav a:hover {
    background-color: #0056b3;
}

/* =======================
   TABLAS
   ======================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
}

table thead tr {
    background-color: #eee;
}

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

/* 
   Estilos responsivos para tablas:
   - Se convierten en bloques en pantallas pequeñas,
     mostrando el título de cada columna con :before
*/
@media (max-width: 768px) {
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead {
        display: none;
    }
    tr {
        margin-bottom: 15px;
        border: 1px solid #ccc;
        border-radius: 5px;
    }
    td {
        border: none;
        display: flex;
        justify-content: space-between;
        padding: 8px;
    }
    td::before {
        content: attr(data-label);
        font-weight: bold;
        margin-right: 10px;
    }
}

/* =======================
   FORMULARIOS
   ======================= */
form {
    margin: 15px 0;
    display: block;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
}

input[type="text"],
input[type="number"],
input[type="date"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    margin-bottom: 15px;
}

input[type="checkbox"],
input[type="radio"] {
    margin-right: 5px;
}

button[type="submit"],
button[type="button"],
input[type="submit"] {
    background-color: #007BFF;
    color: #fff;
    border: none;
    padding: 10px 16px;
    border-radius: 3px;
    cursor: pointer;
    font-weight: 500;
}
button[type="submit"]:hover,
button[type="button"]:hover,
input[type="submit"]:hover {
    background-color: #0056b3;
}

/* =======================
   PEQUEÑOS DETALLES
   ======================= */

/* Clases de ejemplo para alerts o mensajes */
.alert-success {
    background-color: #D4EDDA;
    color: #155724;
    border: 1px solid #C3E6CB;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 3px;
}

.alert-error {
    background-color: #F8D7DA;
    color: #721C24;
    border: 1px solid #F5C6CB;
    padding: 10px;
    margin-bottom: 15px;
    border-radius: 3px;
}

.calendar-wrapper {
    position: relative;
    display: inline-block;
}

.calendar-wrapper input[type="date"] {
    background: url("calendar.png") no-repeat right 0.8rem center;
    background-size: 1.2rem 1.2rem;
    padding-right: 2rem; /* espacio para que no pise el texto */
}

/* =======================
   MODAL OVERLAY
   ======================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    z-index: 9999;
}

.modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    margin: 5% auto;
    padding: 20px;
    border-radius: 5px;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 15px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.modal-close:hover {
    color: #007BFF;
}

/* =======================
   BOTÓN ESTILO
   ======================= */
.btn {
    display: inline-block;
    padding: 10px 20px;
    color: #fff;
    background-color: #007BFF;
    border: none;
    border-radius: 5px;
    text-decoration: none;
    cursor: pointer;
    font-weight: bold;
}

.btn:hover {
    background-color: #0056b3;
}

