/* =====================================================
   custom.css
   Ruta: public/libraries/custom.css
   ===================================================== */

/* ── Utilidades generales ────────────────────────────── */
.hidden {
    display: none;
}

/* ── Tarjeta SENA ────────────────────────────────────── */
.card-sena {
    background: linear-gradient(135deg, #e8e8ec 0%, #dcdce0 100%);
    border: 2px solid #00304D;
    border-radius: 1rem;
}

.card-sena h3, .card-sena p {
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* ── Botón SENA ──────────────────────────────────────── */
.btn-sena {
    background: linear-gradient(135deg, #39A900 0%, #007832 100%);
}

.btn-sena:hover {
    background: linear-gradient(135deg, #2d7a00 0%, #005a24 100%);
}

/* ── SweetAlert estilo card-sena ─────────────────────── */
.swal2-popup {
    background: linear-gradient(135deg, #e8e8ec 0%, #dcdce0 100%) !important;
    border: 2px solid #00304D !important;
    border-radius: 1rem !important;
}

.swal2-title {
    color: #00304D !important;
}

.swal2-content {
    color: #333 !important;
}

.swal2-confirm {
    background: #39A900 !important;
    border: none !important;
}

.swal2-cancel {
    background: #dc2626 !important;
    border: none !important;
}

#logo-sena {
    max-width: 120px;
}

/* =====================================================
   AMBIENTES (ambientes.php)
   ===================================================== */

.ambientes-wrap {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.ambientes-acciones {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.btn-nuevo-ambiente {
    background: linear-gradient(135deg, #39A900 0%, #007832 100%);
    color: white;
    font-weight: bold;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.2s;
}

.btn-nuevo-ambiente:hover { opacity: 0.88; }

.btn-lista-ambientes {
    background: #00304D;
    color: white;
    font-weight: bold;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-size: 1rem;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn-lista-ambientes:hover { background: #1e4d6b; color: white; }

.ambientes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.ambiente-card {
    background: linear-gradient(135deg, #e8e8ec 0%, #dcdce0 100%);
    border: 2px solid #00304D;
    border-radius: 1rem;
    padding: 1.5rem;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.ambiente-card:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.ambiente-card h3 {
    font-size: 1.1rem;
    font-weight: bold;
    color: #00304D;
    margin-bottom: 0.75rem;
}

.ambiente-card p {
    color: #444;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

.ambiente-card .label { color: #39A900; font-weight: bold; }

.ambiente-card .cod-link {
    color: #1d4ed8;
    font-weight: bold;
    text-decoration: none;
}

.ambiente-card .cod-link:hover { text-decoration: underline; }

.btn-editar-card {
    width: 100%;
    padding: 0.5rem 1rem;
    background: #00304D;
    color: white;
    font-weight: bold;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    margin-top: 1rem;
    transition: background 0.2s;
}

.btn-editar-card:hover { background: #1e4d6b; }

.amb-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.amb-modal-overlay.activo { display: flex; }

.amb-modal-body {
    background: linear-gradient(135deg, #e8e8ec 0%, #dcdce0 100%);
    border: 2px solid #00304D;
    border-radius: 1rem;
    padding: 1.5rem;
    width: 640px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.amb-modal-titulo {
    font-size: 1.3rem;
    font-weight: bold;
    text-align: center;
    color: #00304D;
    margin-bottom: 1.25rem;
}

.amb-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.amb-form-grid .span-2 { grid-column: 1 / 3; }

.amb-label {
    display: block;
    font-weight: bold;
    color: #00304D;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
}

.amb-input {
    width: 100%;
    padding: 0.45rem 0.75rem;
    border-radius: 0.5rem;
    border: 2px solid #00304D;
    box-sizing: border-box;
    font-size: 0.9rem;
    background: white;
}

.amb-modal-acciones {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.amb-btn-guardar {
    flex: 1;
    background: #16a34a;
    color: white;
    font-weight: bold;
    padding: 0.65rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.amb-btn-guardar:hover { background: #15803d; }

.amb-btn-eliminar {
    flex: 1;
    background: #dc2626;
    color: white;
    font-weight: bold;
    padding: 0.65rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.amb-btn-eliminar:hover { background: #b91c1c; }

.amb-btn-cancelar {
    flex: 1;
    background: #4b5563;
    color: white;
    font-weight: bold;
    padding: 0.65rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}

.amb-btn-cancelar:hover { background: #374151; }

/* =====================================================
   HORARIO DE AMBIENTES (horario_ambiente.php)
   ===================================================== */

.horario-titulo {
    font-size: 30px;
    font-weight: bold;
    color: #39A900;
    margin-bottom: 20px;
}

.horario-filtros-wrap {
    display: flex;
    justify-content: center;
}

.horario-filtros {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.horario-filtros select {
    padding: 8px;
    border-radius: 6px;
    border: 2px solid #00304D;
}

.horario-filtros input[type="number"] {
    padding: 8px;
    border-radius: 6px;
    border: 2px solid #00304D;
    width: 90px;
}

.btn-filtrar,
.btn-volver {
    background: #00304D;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
}

/* ── Selector de vista del horario ───────────────────── */
#vista-filtro {
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid #39A900;
    background: white;
    color: #166534;
    font-weight: bold;
    cursor: pointer;
    font-size: 0.85rem;
}

#vista-filtro:focus {
    outline: none;
    border-color: #00304D;
}

.horario-tabla-wrap {
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    width: 100%;
    overflow-x: auto;
}

.horario-tabla {
    width: 100%;
    min-width: 95vw;
    border-collapse: collapse;
    font-family: sans-serif;
    font-size: 0.85rem;
}

.th-hora {
    border: 1px solid #39A900;
    padding: 6px;
    background: #dcfce7;
    color: #166534;
    white-space: nowrap;
}

.th-dia-normal {
    border: 1px solid #39A900;
    padding: 4px;
    font-size: 0.8rem;
    background: #dcfce7;
    color: #166534;
}

.th-dia-bloqueado {
    border: 1px solid #dc2626;
    padding: 4px;
    font-size: 0.8rem;
    background: #fecaca;
    color: #991b1b;
}

.td-hora {
    border: 1px solid #39A900;
    padding: 8px;
    background: #f0fdf4;
    font-weight: bold;
    white-space: nowrap;
}

.calendario-celda {
    padding: 4px;
    min-height: 36px;
    position: relative;
    cursor: pointer;
    vertical-align: top;
    transition: background 0.2s;
    border: 1px solid #39A900;
    background: #f0fdf4;
}

.calendario-celda.bloqueada {
    border-color: #f87171;
    background: #fee2e2;
    cursor: not-allowed;
}

.calendario-celda.domingo {
    border-color: #f87171;
    background: #fee2e2;
    cursor: help;
}

.evento-box {
    position: absolute;
    inset: 2px;
    background: linear-gradient(135deg, #10b981, #34d399);
    border-radius: 6px;
    cursor: move;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.evento-box.evento-pendiente {
    background: linear-gradient(135deg, #f59e0b, #fb923c);
}

.evento-box[data-estado="pendiente"] {
    background: linear-gradient(135deg, #f59e0b, #fb923c);
}

.evento-box.evento-aprobado {
    background: linear-gradient(135deg, #10b981, #34d399);
}

.evento-box.evento-cancelado {
    background: linear-gradient(135deg, #ef4444, #f87171);
}

.evento-box[draggable="false"] {
    cursor: pointer;
}

.evento-icon {
    font-size: 1.4rem;
    line-height: 1;
}

.celda-crear {
    position: absolute;
    inset: 0;
    cursor: pointer;
    z-index: 1;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.modal-body {
    background: white;
    padding: 16px 20px;
    border-radius: 10px;
    width: 460px;
    max-width: 460px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.modal-titulo {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #39A900;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.form-grid .full-width { grid-column: 1 / 3; }

.form-input,
.form-textarea {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 0.85rem;
}

.form-textarea {
    height: 40px;
    resize: vertical;
}

.form-input.readonly {
    background: #f3f4f6;
    color: #374151;
    font-weight: bold;
}

.rango-hora {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rango-hora .separador {
    color: #666;
    font-weight: bold;
}

.modal-acciones {
    margin-top: 15px;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.btn-cancelar {
    background: #999;
    color: white;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
}

.btn-eliminar-modal {
    background: #ef4444;
    color: white;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: none;
}

.btn-guardar {
    background: #39A900;
    color: white;
    padding: 8px 14px;
    border: none;
    border-radius: 6px;
    font-weight: bold;
    cursor: pointer;
}

.btn-guardar:disabled {
    cursor: not-allowed;
}

.swal2-container {
    z-index: 99999 !important;
}

/* =====================================================
   LISTA AMBIENTES (lista_ambientes.php)
   ===================================================== */

.lista-wrap {
    width: 80%;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.lista-acciones {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    flex-wrap: wrap;
    gap: 1rem;
}

.lista-tabla-wrap { overflow-x: auto; }

.lista-tabla {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    overflow: hidden;
}

.lista-tabla thead tr {
    background: linear-gradient(to right, #00304D, #1e4d6b);
    color: white;
}

.lista-tabla th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-weight: bold;
    font-size: 0.9rem;
}

.lista-tabla td {
    padding: 0.75rem 1.5rem;
    border-top: 1px solid #f3f4f6;
    font-size: 0.9rem;
    color: #374151;
}

.lista-tabla tbody tr:hover { background: #f9fafb; }

.lista-tabla .cod-link {
    color: #1d4ed8;
    font-weight: bold;
    text-decoration: none;
}

.lista-tabla .cod-link:hover { text-decoration: underline; }

.lista-tabla .capacidad-badge {
    color: #16a34a;
    font-weight: bold;
}

.btn-editar-tabla {
    padding: 0.4rem 1rem;
    background: #00304D;
    color: white;
    font-weight: bold;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-editar-tabla:hover { background: #1e4d6b; }

/* =====================================================
   LOGIN (index.php)
   Estilos adaptados del custom.css de Tecnoparque EP
   ===================================================== */

.letra-sena-2024 {
    font-family: 'Work Sans', sans-serif;
}

body {
    overflow-x: hidden;
    overflow-y: auto;
}

.sep {
    border-top: 1px solid #dee2e6;
    margin: 0.75rem 0;
}

/* ── Carrusel ────────────────────────────────────────── */
.carousel { min-height: 320px; }

.carousel-inner,
.carousel-item {
    height: 100%;
    min-height: 320px;
}

.carousel-item img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    background: #dee2e6;
}

/* ── Card login — fondo blanco limpio ────────────────── */
.card {
    border: none !important;
    border-radius: 0.5rem !important;
    background: #ffffff !important;
    box-shadow: 0 0.15rem 1.75rem rgba(58,59,69,.15) !important;
}

.card .card-body {
    background: #ffffff !important;
    border-radius: 0.5rem !important;
}

.card h3, .card p, .card h4 {
    text-shadow: none !important;
}

/* ── Título de la card — gris suave ──────────────────── */
.card h4.sesion,
.card .h4.sesion {
    color: #6c757d !important;
    font-weight: 400 !important;
    font-size: 1.1rem !important;
}

/* ── Inputs ──────────────────────────────────────────── */
.form-control {
    border: 1px solid #ced4da;
    border-radius: 0.35rem;
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
}

/* ── Botón Iniciar sesión — verde SENA #39A900 ───────── */
.btn-success {
    background-color: #39A900 !important;
    border-color: #39A900 !important;
    padding: 0.5rem 2rem;
    font-size: 0.9rem;
}

.btn-success:hover {
    background-color: #2d8a00 !important;
    border-color: #2d8a00 !important;
}

/* ── Link olvidaste contraseña ───────────────────────── */
.link-olvide {
    text-decoration: underline;
    color: #555eac !important;
    font-size: 0.9rem;
}

.link-olvide:hover { color: #3a3e8f !important; }

/* =====================================================
   AJUSTES BOTONES HORARIO (nuevo botón lista préstamos)
   ===================================================== */

.horario-filtros .btn-volver {
    margin-right: 8px;
}

.horario-filtros a.btn-volver {
    color: white !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
}
/* Cuando hay varios botones juntos */
.horario-filtros .btn-volver + .btn-volver {
    margin-left: 4px;
}

.horario-leyenda-estados {
    margin-top: 8px;
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.leyenda-item {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.leyenda-item.pendiente {
    background: #ffedd5;
    color: #9a3412;
}

.leyenda-item.aprobado {
    background: #dcfce7;
    color: #166534;
}

.leyenda-item.cancelado {
    background: #fee2e2;
    color: #991b1b;
}

/* (Opcional) estilo ligeramente distinto para distinguir */
.btn-ver-prestamos {
    background: #1e4d6b;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-ver-prestamos:hover {
    background: #256083;
}

/*LISTA PRESTAMOS*/

/* TITULO */
.titulo-lista {
    text-align: center;
    margin: 20px 0;
    color: #00304D;
    font-weight: 600;
}

/* BARRA SUPERIOR */
.top-bar {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 15px;
}

/* TABLA */
.tabla-prestamos-wrap {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow-x: auto;
}

.tabla-prestamos {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

/* HEADER */
.tabla-prestamos th {
    background: #39A900;
    color: white;
    padding: 12px;
    text-align: center;
    font-weight: 600;
}

/* CELDAS */
.tabla-prestamos td {
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid #e5e7eb;
}

/* HOVER */
.tabla-prestamos tbody tr:hover {
    background: #f0fdf4;
}

/* EVENTO */
.evento {
    font-weight: 600;
    color: #00304D;
}

/* HORA */
.hora {
    font-size: 0.85rem;
    color: #374151;
}

/* CORREO */
.correo {
    font-size: 0.8rem;
    color: #6b7280;
}

/* ESTADOS */
.estado {
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* COLORES ESTADO */
.estado.activo {
    background: #dcfce7;
    color: #166534;
}

.estado.aprobado {
    background: #dcfce7;
    color: #166534;
}

.estado.pendiente {
    background: #ffedd5 !important;
    color: #9a3412 !important;
    border: 1px solid #fdba74;
}

.estado.Pendiente {
    background: #ffedd5 !important;
    color: #9a3412 !important;
    border: 1px solid #fdba74;
}

.estado.cancelado {
    background: #fee2e2;
    color: #991b1b;
}

/* SIN DATOS */
.sin-datos {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}