﻿body {
    font-family: "Grandstander", cursive;
    display: flex;
    background: linear-gradient(135deg, #e6f0ff, #cce0ff); /* Gradiente azul claro */
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    width: 220px;
    background: linear-gradient(180deg, #1c2e4a, #3a7bd5); /* Gradiente azul oscuro a azul medio */
    padding: 20px 0;
    transition: background-color 0.3s ease;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
}

.nav-menu {
    list-style: none;
    padding: 0;
    height: calc(100% - 150px);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.nav-item {
    padding: 15px 25px;
    transition: background 0.3s ease, padding-left 0.3s ease;
}

    .nav-item a {
        text-decoration: none;
        color: #ecf0f1;
        display: flex;
        align-items: center;
        gap: 10px;
        transition: color 0.3s ease;
    }

    .nav-item i {
        font-size: 18px;
    }

    .nav-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
        padding-left: 30px;
    }

    .nav-item.active {
        background-color: #3a7bd5; /* Azul medio */
        box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
    }

        .nav-item.active a {
            color: #fff;
        }

/* Separador visual en el menú */
.nav-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 10px 15px;
    list-style: none;
}

.content {
    margin-left: 220px;
    padding: 20px;
    width: calc(100% - 220px);
    background: linear-gradient(90deg, #ffffff, #f0f7ff); /* Gradiente blanco a azul muy claro */
    transition: margin-left 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}

/* Estilos para el modo oscuro */
body.dark-mode {
    background: linear-gradient(135deg, #0a1f3d, #1c2e4a); /* Gradiente azul oscuro */
    color: #f1f1f1;
}

    body.dark-mode .side-nav {
        background: linear-gradient(180deg, #1c2e4a, #3a7bd5); /* Gradiente azul oscuro a azul medio */
    }

    body.dark-mode .nav-item a {
        color: #dcdde1;
    }

    body.dark-mode .nav-item:hover {
        background-color: rgba(255, 255, 255, 0.1);
    }

    body.dark-mode .content {
        background: linear-gradient(90deg, #1c2e4a, #2a4a6e); /* Gradiente azul oscuro */
        color: #ecf0f1;
    }

    body.dark-mode footer {
        background-color: #1c2e4a; /* Azul oscuro */
        color: #dcdde1;
    }

        body.dark-mode footer a {
            color: #3a7bd5; /* Azul medio */
        }

/* Estilos para el botón deslizable */
.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

    .switch input {
        opacity: 0;
        width: 0;
        height: 0;
    }

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: 0.4s;
    border-radius: 34px;
}

    .slider:before {
        position: absolute;
        content: "";
        height: 26px;
        width: 26px;
        border-radius: 50%;
        left: 4px;
        bottom: 4px;
        background-color: white;
        transition: 0.4s;
    }

input:checked + .slider {
    background-color: #3a7bd5; /* Azul medio */
}

    input:checked + .slider:before {
        transform: translateX(26px);
    }

.mode-icon {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    color: white;
}

.fa-sun {
    left: 8px;
}

.fa-moon {
    right: 8px;
}

/* Estilos para el botón de Login/Logout en la parte superior */
.nav-login-top {
    padding: 15px 25px;
    background: linear-gradient(135deg, #60a5fa 0%, #3a7bd5 100%);
    border-radius: 8px;
    margin: 10px 15px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
}

    .nav-login-top a, .nav-login-top button {
        color: #fff;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 10px;
        font-weight: 600;
    }

    .nav-login-top button {
        background: none;
        border: none;
        cursor: pointer;
        width: 100%;
        padding: 0;
    }

    .nav-login-top:hover {
        background: linear-gradient(135deg, #3a7bd5 0%, #1c6fb5 100%);
        transform: translateY(-2px);
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
    }

.footer {
    background-color: white;
    color: black;
    padding: 20px 0;
    margin-top: auto;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

    .footer a {
        color: black;
        transition: color 0.3s ease;
    }

        .footer a:hover {
            color: #3a7bd5; /* Azul medio */
        }

    .footer .footer-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        color: #3a7bd5; /* Azul medio */
    }

    .footer .list-unstyled li {
        margin-bottom: 0.5rem;
    }

    .footer .list-inline-item {
        margin: 0 10px;
    }

    .footer .fab {
        font-size: 20px;
    }

    .footer .footer-divider {
        border-color: rgba(255, 255, 255, 0.1);
        margin: 1.5rem 0;
    }

body.dark-mode .footer {
    background-color: #1c2e4a; /* Azul oscuro */
    color: #dcdde1;
}

    body.dark-mode .footer a {
        color: #dcdde1;
    }

        body.dark-mode .footer a:hover {
            color: #3a7bd5; /* Azul medio */
        }

    body.dark-mode .footer .footer-title {
        color: #3a7bd5; /* Azul medio */
    }

/* Estilos para el modal en modo oscuro */
body.dark-mode .modal-content {
    background-color: #1c2e4a; /* Fondo oscuro */
    color: #ecf0f1; /* Texto claro */
}

body.dark-mode .modal-header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Borde inferior claro */
}

body.dark-mode .modal-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1); /* Borde superior claro */
}

body.dark-mode .modal-title {
    color: #ecf0f1; /* Texto claro para el título */
}

body.dark-mode .btn-close {
    filter: invert(1); /* Invertir el color del ícono de cierre para que sea visible en fondo oscuro */
}

body.dark-mode .form-control {
    background-color: #2a4a6e; /* Fondo oscuro para los inputs */
    color: #ecf0f1; /* Texto claro para los inputs */
    border-color: rgba(255, 255, 255, 0.1); /* Borde claro para los inputs */
}

    body.dark-mode .form-control:focus {
        background-color: #2a4a6e; /* Fondo oscuro para los inputs enfocados */
        color: #ecf0f1; /* Texto claro para los inputs enfocados */
        border-color: #3a7bd5; /* Borde azul medio para los inputs enfocados */
        box-shadow: 0 0 0 0.25rem rgba(58, 123, 213, 0.25); /* Sombra azul medio para los inputs enfocados */
    }

body.dark-mode .invalid-feedback {
    color: #ff6b6b; /* Color rojo claro para los mensajes de error */
}

body.dark-mode .btn-success {
    background-color: #28a745; /* Verde para el botón de guardar */
    border-color: #28a745;
}

body.dark-mode .btn-secondary {
    background-color: #6c757d; /* Gris para el botón de limpiar */
    border-color: #6c757d;
}

/* ============================================
   ESTILOS MODERNOS PARA DATATABLES
   ============================================ */

/* Contenedor de tabla con mejor diseño */
#divContenedorTabla {
    overflow-x: auto;
    border-radius: 8px;
}

/* Estilos generales para la tabla */
table.dataTable {
    width: 100% !important;
    border-collapse: separate;
    border-spacing: 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Encabezados de tabla mejorados */
table.dataTable thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    padding: 16px 12px;
    border: none;
    position: sticky;
    top: 0;
    z-index: 10;
}

table.dataTable thead th:first-child {
    border-top-left-radius: 8px;
}

table.dataTable thead th:last-child {
    border-top-right-radius: 8px;
}

/* Filas de tabla con hover mejorado */
table.dataTable tbody tr {
    transition: all 0.3s ease;
    border-bottom: 1px solid #e9ecef;
}

table.dataTable tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.01);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

table.dataTable tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

table.dataTable tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

/* Celdas de tabla */
table.dataTable tbody td {
    padding: 14px 12px;
    vertical-align: middle;
    color: #495057;
    font-size: 0.9rem;
}

/* Botones de acción en tablas */
table.dataTable tbody td button,
table.dataTable tbody td a.btn {
    margin: 0 3px;
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 6px;
    transition: all 0.3s ease;
}

table.dataTable tbody td button:hover,
table.dataTable tbody td a.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Controles de paginación mejorados */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 8px 14px;
    margin: 0 4px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    background: #ffffff;
    color: #495057;
    transition: all 0.3s ease;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: #667eea;
    transform: translateY(-2px);
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-color: #667eea;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Info y length mejorados */
.dataTables_wrapper .dataTables_info {
    padding: 12px 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.dataTables_wrapper .dataTables_length select {
    padding: 6px 30px 6px 10px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
}

.dataTables_wrapper .dataTables_length select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Búsqueda mejorada */
.dataTables_wrapper .dataTables_filter input {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    margin-left: 8px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    outline: none;
}

/* ============================================
   ESTILOS PARA MODO OSCURO - DATATABLES
   ============================================ */

body.dark-mode table.dataTable {
    background-color: #2a4a6e;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

body.dark-mode table.dataTable thead th {
    background: linear-gradient(135deg, #4a5a8a 0%, #5a4a82 100%);
    color: #ecf0f1;
}

body.dark-mode table.dataTable tbody tr {
    border-bottom: 1px solid #3a5a7e;
}

body.dark-mode table.dataTable tbody tr:hover {
    background-color: #3a5a8e;
}

body.dark-mode table.dataTable tbody tr:nth-child(even) {
    background-color: #2a4a6e;
}

body.dark-mode table.dataTable tbody tr:nth-child(odd) {
    background-color: #2d5078;
}

body.dark-mode table.dataTable tbody td {
    color: #ecf0f1;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button {
    background: #2a4a6e;
    color: #ecf0f1;
    border-color: #3a5a7e;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: linear-gradient(135deg, #5a6a9a 0%, #6a5a92 100%);
    color: #ffffff;
    border-color: #5a6a9a;
}

body.dark-mode .dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: linear-gradient(135deg, #5a6a9a 0%, #6a5a92 100%);
    color: #ffffff;
}

body.dark-mode .dataTables_wrapper .dataTables_info {
    color: #adb5bd;
}

body.dark-mode .dataTables_wrapper .dataTables_length select,
body.dark-mode .dataTables_wrapper .dataTables_filter input {
    background-color: #2a4a6e;
    color: #ecf0f1;
    border-color: #3a5a7e;
}

body.dark-mode .dataTables_wrapper .dataTables_length select:focus,
body.dark-mode .dataTables_wrapper .dataTables_filter input:focus {
    border-color: #5a6a9a;
    box-shadow: 0 0 0 0.2rem rgba(90, 106, 154, 0.25);
}

/* Estilos para las cards que contienen las tablas */
.card {
    border-radius: 12px;
    overflow: hidden;
    border: none;
}

.card-header {
    border-radius: 12px 12px 0 0 !important;
    padding: 16px 20px;
    font-weight: 600;
}

.card-body {
    padding: 20px;
}

body.dark-mode .card {
    background-color: #1c2e4a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .card-header {
    background-color: #2a4a6e !important;
    color: #ecf0f1;
}

body.dark-mode .btn-success:hover {
    background-color: #218838; /* Verde más oscuro al pasar el mouse */
    border-color: #1e7e34;
}

body.dark-mode .btn-secondary:hover {
    background-color: #5a6268; /* Gris más oscuro al pasar el mouse */
    border-color: #545b62;
}
