/* ========================================================
   StellarMinds — Galaxy Animated Background
   ======================================================== */

html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

html {
    position: relative;
    min-height: 100%;
}

body {
    margin-bottom: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background:
        radial-gradient(ellipse at center, #1a0f3a 0%, #0a0820 60%, #050516 100%);
    color: #e8e8f0;
    overflow-x: hidden;
    position: relative;
}

/* Main crece para ocupar toda la pantalla */
main {
    flex: 1 0 auto;
    padding-bottom: 2rem;
}

/* === Nebulosa de fondo (gradientes radiales con animación) === */
body::before {
    content: '';
    position: fixed;
    top: -100%;
    left: -100%;
    width: 300%;
    height: 300%;
    background:
        radial-gradient(ellipse at 20% 30%, rgba(120, 50, 200, 0.30) 0%, transparent 35%),
        radial-gradient(ellipse at 80% 70%, rgba(50, 100, 220, 0.25) 0%, transparent 40%),
        radial-gradient(ellipse at 60% 20%, rgba(220, 80, 180, 0.20) 0%, transparent 30%),
        radial-gradient(ellipse at 30% 80%, rgba(80, 200, 220, 0.18) 0%, transparent 35%),
        radial-gradient(ellipse at 50% 50%, rgba(80, 50, 150, 0.20) 0%, transparent 60%);
    animation: nebula-rotate 90s linear infinite;
    z-index: -3;
}

@keyframes nebula-rotate {
    from { transform: rotate(0deg) scale(1); }
    50%  { transform: rotate(180deg) scale(1.1); }
    to   { transform: rotate(360deg) scale(1); }
}

/* === Capas de estrellas (truco con box-shadow múltiple) === */
body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 2px;
    height: 2px;
    background: transparent;
    box-shadow:
        100px 200px #fff, 300px 500px #fff, 500px 100px #fff, 700px 300px #fff,
        900px 700px #fff, 200px 800px #fff, 400px 250px #fff, 600px 600px #fff,
        800px 150px #fff, 1000px 400px #fff, 1200px 700px #fff, 150px 50px #fff,
        350px 350px #fff, 550px 750px #fff, 750px 500px #fff, 950px 200px #fff,
        1150px 850px #fff, 1350px 100px #fff, 1500px 450px #fff, 250px 650px #fff,
        450px 100px #fff, 650px 850px #fff, 850px 300px #fff, 1050px 600px #fff,
        1250px 250px #fff, 1450px 750px #fff, 50px 400px #fff, 1100px 50px #fff,
        1300px 550px #fff, 1550px 250px #fff, 80px 720px #fff, 280px 120px #fff,
        480px 580px #fff, 680px 220px #fff, 880px 480px #fff, 1080px 820px #fff,
        1280px 380px #fff, 1480px 620px #fff, 120px 280px #fff, 320px 680px #fff,
        520px 380px #fff, 720px 780px #fff, 920px 80px #fff, 1120px 480px #fff,
        1320px 720px #fff, 1520px 80px #fff, 180px 920px #fff, 380px 220px #fff,
        580px 480px #fff, 780px 920px #fff, 980px 320px #fff, 1180px 620px #fff,
        1380px 180px #fff, 1580px 520px #fff;
    animation: twinkle 4s ease-in-out infinite alternate;
    z-index: -2;
}

@keyframes twinkle {
    0%   { opacity: 0.3; }
    50%  { opacity: 1; }
    100% { opacity: 0.5; }
}

/* === Segunda capa de estrellas más grandes y lentas === */
.star-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 3px;
    height: 3px;
    background: transparent;
    box-shadow:
        150px 350px #b9c4ff, 450px 150px #ffd9b9, 750px 650px #fff,
        1050px 250px #b9d9ff, 1350px 550px #ffb9d9, 250px 750px #fff,
        550px 450px #d9b9ff, 850px 850px #fff, 1150px 450px #b9ffd9,
        1450px 250px #fff, 50px 550px #ffd9b9, 350px 850px #fff,
        650px 250px #b9c4ff, 950px 550px #fff, 1250px 850px #ffb9d9,
        1550px 350px #fff, 200px 200px #fff, 500px 700px #d9b9ff,
        800px 400px #fff, 1100px 100px #b9ffd9, 1400px 800px #fff;
    border-radius: 50%;
    animation: twinkle-slow 6s ease-in-out infinite alternate;
    z-index: -1;
    pointer-events: none;
}

@keyframes twinkle-slow {
    0%   { opacity: 0.4; transform: scale(1); }
    50%  { opacity: 1;   transform: scale(1.3); }
    100% { opacity: 0.6; transform: scale(1); }
}

/* === Galaxia central rotando === */
.galaxy-core {
    position: fixed;
    top: 50%;
    left: 50%;
    width: 800px;
    height: 800px;
    margin-top: -400px;
    margin-left: -400px;
    background: radial-gradient(ellipse closest-side,
        rgba(255, 220, 180, 0.15) 0%,
        rgba(180, 120, 220, 0.12) 25%,
        rgba(80, 100, 200, 0.08) 50%,
        transparent 75%);
    border-radius: 50%;
    animation: galaxy-spin 60s linear infinite;
    z-index: -2;
    pointer-events: none;
    filter: blur(20px);
}

@keyframes galaxy-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* === Navbar translúcido para que se vea la galaxia === */
.navbar {
    background: rgba(10, 10, 30, 0.75) !important;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(120, 100, 200, 0.3) !important;
}

.navbar-brand,
.nav-link {
    color: #e8e8f0 !important;
}

/* === Footer pegado al fondo === */
.footer {
    flex-shrink: 0;
    margin-top: auto;
    padding: 0.75rem 0;
    background: rgba(10, 10, 30, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(120, 100, 200, 0.3) !important;
    color: #b8b8c8 !important;
    position: relative;
    z-index: 10;
}

/* === Cards y tablas con fondo translúcido === */
.card {
    background: rgba(20, 20, 40, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(120, 100, 200, 0.3);
    color: #e8e8f0;
}

.card-header {
    background: rgba(60, 40, 120, 0.5);
    border-bottom: 1px solid rgba(120, 100, 200, 0.3);
    color: #fff;
}

.table {
    color: #e8e8f0;
    background: rgba(20, 20, 40, 0.6);
    backdrop-filter: blur(8px);
    border-radius: 8px;
    overflow: hidden;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background: rgba(40, 40, 70, 0.5);
    color: #e8e8f0;
}

.table > thead {
    background: rgba(60, 40, 120, 0.6);
    color: #fff;
}

/* === Inputs y selects con fondo oscuro === */
.form-control,
.form-select {
    background: rgba(30, 30, 50, 0.7);
    border: 1px solid rgba(120, 100, 200, 0.4);
    color: #e8e8f0;
}

.form-control:focus,
.form-select:focus {
    background: rgba(40, 40, 70, 0.9);
    border-color: #8b7fd9;
    color: #fff;
    box-shadow: 0 0 0 0.2rem rgba(120, 100, 200, 0.3);
}

.form-label {
    color: #d8d8e8;
}

/* === Botones con efecto glow === */
.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(120, 100, 200, 0.4);
}

.btn:focus, .btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus,
.form-check-input:focus {
    box-shadow: 0 0 0 0.1rem rgba(120, 100, 200, 0.3),
                0 0 0 0.25rem rgba(120, 100, 200, 0.5);
}

/* === Títulos con glow sutil === */
h1, h2, h3, h4 {
    color: #fff;
    text-shadow: 0 0 20px rgba(120, 100, 200, 0.5);
}

/* === Alerts translúcidos === */
.alert {
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.alert-info {
    background: rgba(50, 100, 200, 0.3);
    color: #d8e8ff;
}

.alert-success {
    background: rgba(50, 180, 100, 0.3);
    color: #d8ffe8;
}

.alert-danger {
    background: rgba(220, 80, 100, 0.3);
    color: #ffd8d8;
}

.form-floating > .form-control-plaintext::placeholder,
.form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder,
.form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* ======================================================
   LEGIBILIDAD GENERAL — todo se lee sobre el fondo oscuro
   ====================================================== */

/* Textos secundarios — antes grises ilegibles, ahora claros */
.text-muted,
.text-secondary,
.form-text,
.form-text *,
small,
.small,
.help-block,
.invalid-feedback,
.valid-feedback {
    color: #d8d8ec !important;
    opacity: 1 !important;
}

/* Párrafos y texto general */
p, span, label, dd, dt, li {
    color: #e8e8f0;
}

/* Subtítulos / leads */
.lead {
    color: #d8d8ec !important;
}

/* Texto de Bootstrap "body" */
.text-body, .text-body-secondary, .text-body-tertiary {
    color: #e8e8f0 !important;
}

/* Strong en negritas blanco puro */
strong, b {
    color: #ffffff;
}

/* Detalle (placeholder Bootstrap text) en el card translúcido */
.card .text-muted,
.card-body .text-muted {
    color: #d8d8ec !important;
}

/* Links */
a {
    color: #b9c4ff;
    text-decoration: none;
}

a:hover {
    color: #ffffff;
    text-decoration: underline;
}

/* Botones que son anchors: NO subrayar al hover */
a.btn,
a.btn:hover,
a.btn:focus,
a.btn:active,
.btn,
.btn:hover {
    text-decoration: none !important;
}

/* Tampoco subrayar links del navbar */
.navbar a,
.navbar a:hover,
.nav-link,
.nav-link:hover {
    text-decoration: none !important;
}

/* Placeholders de inputs */
::placeholder {
    color: #9a9ab0 !important;
    opacity: 1;
}

/* Botones — paleta completa visible */
.btn-primary {
    background: linear-gradient(135deg, #6a4caf, #4a7fd9);
    border: 1px solid rgba(150, 130, 220, 0.6);
    color: #fff !important;
    font-weight: 500;
}
.btn-primary:hover {
    background: linear-gradient(135deg, #7d5fc9, #5a8fe9);
    color: #fff !important;
}

.btn-outline-primary {
    color: #c8d2ff !important;
    border-color: rgba(150, 130, 220, 0.7);
    background: rgba(60, 40, 120, 0.25);
}
.btn-outline-primary:hover {
    background: rgba(90, 70, 170, 0.6);
    color: #fff !important;
    border-color: #c8d2ff;
}

.btn-outline-success {
    color: #c8ffdc !important;
    border-color: rgba(80, 200, 130, 0.7);
    background: rgba(40, 100, 60, 0.25);
}
.btn-outline-success:hover {
    background: rgba(60, 150, 90, 0.6);
    color: #fff !important;
}

.btn-outline-info {
    color: #c8eaff !important;
    border-color: rgba(80, 180, 220, 0.7);
    background: rgba(40, 90, 130, 0.25);
}
.btn-outline-info:hover {
    background: rgba(60, 130, 190, 0.6);
    color: #fff !important;
}

.btn-outline-danger {
    color: #ffc8d0 !important;
    border-color: rgba(220, 80, 100, 0.7);
    background: rgba(130, 40, 60, 0.25);
}
.btn-outline-danger:hover {
    background: rgba(190, 60, 80, 0.6);
    color: #fff !important;
}

.btn-outline-secondary {
    color: #e0e0ec !important;
    border-color: rgba(160, 160, 190, 0.6);
    background: rgba(60, 60, 80, 0.25);
}
.btn-outline-secondary:hover {
    background: rgba(110, 110, 140, 0.6);
    color: #fff !important;
}

/* Badges legibles */
.badge {
    color: #ffffff;
    font-weight: 500;
    padding: 0.4em 0.7em;
}

/* Inputs tipo date — el calendario por defecto es claro */
input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
    cursor: pointer;
}

/* Select options se ven oscuros */
.form-select option {
    background: #1a1a2e;
    color: #e8e8f0;
}

/* Bordes de tabla más visibles */
.table {
    border-color: rgba(120, 100, 200, 0.2);
}
.table > :not(caption) > * > * {
    border-bottom-color: rgba(120, 100, 200, 0.15);
}

/* Detalle del card del Resultado de Evaluación (RF07) */
#pDetalle, #lblDetalle {
    color: #d8d8ec !important;
}

/* Texto del header del card (más blanco) */
.card-header.fw-bold {
    color: #fff;
}

/* ======================================================
   NAV TABS — pestañas del CRUD de equipos
   ====================================================== */

.nav-tabs {
    border-bottom: 2px solid rgba(120, 100, 200, 0.4);
}

/* Pestañas inactivas */
.nav-tabs .nav-link {
    color: #c8c8e0 !important;
    background: rgba(30, 30, 60, 0.4);
    border: 1px solid rgba(120, 100, 200, 0.3);
    border-bottom: none;
    margin-right: 4px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    background: rgba(60, 40, 120, 0.5);
    color: #ffffff !important;
    border-color: rgba(150, 130, 220, 0.5);
}

/* Pestaña ACTIVA — fondo púrpura, no blanco */
.nav-tabs .nav-link.active,
.nav-tabs .nav-item.show .nav-link {
    background: linear-gradient(135deg, rgba(90, 60, 170, 0.85), rgba(60, 80, 180, 0.85)) !important;
    color: #ffffff !important;
    border-color: rgba(150, 130, 220, 0.7) !important;
    border-bottom-color: transparent !important;
    font-weight: 600;
    text-shadow: 0 0 8px rgba(150, 130, 220, 0.6);
}

/* Badge dentro de las pestañas — visible */
.nav-tabs .nav-link .badge {
    background: rgba(20, 20, 40, 0.7) !important;
    color: #ffffff !important;
    border: 1px solid rgba(150, 130, 220, 0.4);
}

.nav-tabs .nav-link.active .badge {
    background: rgba(255, 255, 255, 0.25) !important;
    color: #ffffff !important;
    border-color: rgba(255, 255, 255, 0.4);
}

/* Tab content (contenedor de las tablas) */
.tab-content {
    padding-top: 1rem;
}

/* ======================================================
   TABLAS — header oscuro, cuerpo uniforme legible
   ====================================================== */

/* Tabla base — fondo uniforme, sin alternancia */
.table {
    --bs-table-bg: transparent;
    --bs-table-color: #e8e8f0;
    --bs-table-striped-bg: transparent;
    --bs-table-striped-color: #e8e8f0;
    --bs-table-hover-bg: rgba(120, 100, 200, 0.15);
    --bs-table-hover-color: #ffffff;
    --bs-table-border-color: rgba(120, 100, 200, 0.25);
    background: rgba(20, 20, 40, 0.55) !important;
    color: #e8e8f0 !important;
    backdrop-filter: blur(8px);
    border-radius: 8px;
    overflow: hidden;
}

/* Todas las celdas: mismo fondo y texto legible */
.table > tbody > tr > td,
.table > tbody > tr > th {
    background: rgba(25, 25, 50, 0.4) !important;
    color: #e8e8f0 !important;
    border-color: rgba(120, 100, 200, 0.2);
    vertical-align: middle;
}

/* SPANS/links/strong dentro de celdas — visibles */
.table td span,
.table td a,
.table td strong,
.table td small {
    color: #e8e8f0 !important;
}

/* Hover: resalta la fila */
.table > tbody > tr:hover > * {
    background: rgba(90, 70, 170, 0.25) !important;
    color: #ffffff !important;
}

/* Header oscuro azul/púrpura unificado */
.table > thead,
.table > thead > tr,
.table > thead > tr > th,
.table-dark,
thead.table-dark > tr > th {
    background: linear-gradient(135deg, rgba(50, 30, 110, 0.95), rgba(40, 60, 130, 0.95)) !important;
    color: #ffffff !important;
    border-color: rgba(120, 100, 200, 0.4) !important;
    font-weight: 600;
}

/* Filas "atrasadas" en rojo (las que tienen table-danger) */
.table > tbody > tr.table-danger > * {
    background: rgba(180, 50, 70, 0.45) !important;
    color: #ffe8e8 !important;
}

.table > tbody > tr.table-danger:hover > * {
    background: rgba(200, 70, 90, 0.6) !important;
}

/* Anular cualquier raya alternada residual */
.table-striped > tbody > tr:nth-of-type(odd) > *,
.table-striped > tbody > tr:nth-of-type(even) > * {
    background: rgba(25, 25, 50, 0.4) !important;
    color: #e8e8f0 !important;
}
