/**
 * components.css — Componentes de UI: alertas, toasts, botones, loader y modal Acerca de
 * Biblia Conexiones PWA
 *
 * Incluye alertas flotantes responsivas, animación de conexiones, loader CSS,
 * botones primarios/secundarios/flotantes y la cabecera modal 'Acerca de'.
 */

/* ─── ALERTAS FLOTANTES ─────────────────────────────────────────────────────── */

.alert {
    position: fixed;
    top: 90px;
    right: 0px;
    z-index: 5000;
}

@media (min-width: 576px) {
    .alert {
        right: calc(50vw - 285px);
        width: 70%;
    }
}

@media (min-width: 768px) {
    .alert {
        right: calc(50vw - 375px);
        width: 60%;
    }
}

@media (min-width: 992px) {
    .alert {
        right: calc(50vw - 495px);
        width: 50%;
    }
}

@media (min-width: 1200px) {
    .alert {
        right: calc(50vw - 585px);
        width: 40%;
    }
}

@media (min-width: 1400px) {
    .alert {
        right: calc((50vw - 660px) + 30px);
        width: 30%;
    }
}

/* ─── BOTÓN DE CIERRE DE TARJETAS FLOTANTES ─────────────────────────────────── */

.btn-close-card {
    cursor: pointer;
    font-size: 1.3rem;
    margin-bottom: 3px;
    /* color: var(--primary); */
    transition: var(--transition);
}

.btn-close-card:hover {
    /* color: var(--primary-hover); */
    transform: scale(1.1);
}

/* ─── LOADER ANIMADO CSS ────────────────────────────────────────────────────── */

.loader {
    height: 9px;
    width: 60px;
    --c: no-repeat linear-gradient(#6c747e 0 0);
    background: var(--c), var(--c), var(--c), var(--c);
    background-size: 26% 3px;
    animation: l2 1s infinite;
}

@keyframes l2 {
    0%, 70%, 100% {
        background-position: calc(0*100%/3) 100%, calc(1*100%/3) 100%, calc(2*100%/3) 100%, calc(3*100%/3) 100%
    }
    14% {
        background-position: calc(0*100%/3) 0, calc(1*100%/3) 100%, calc(2*100%/3) 100%, calc(3*100%/3) 100%
    }
    28% {
        background-position: calc(0*100%/3) 100%, calc(1*100%/3) 0, calc(2*100%/3) 100%, calc(3*100%/3) 100%
    }
    42% {
        background-position: calc(0*100%/3) 100%, calc(1*100%/3) 100%, calc(2*100%/3) 0, calc(3*100%/3) 100%
    }
    56% {
        background-position: calc(0*100%/3) 100%, calc(1*100%/3) 100%, calc(2*100%/3) 100%, calc(3*100%/3) 0
    }
}

/* ─── BOTONES Y VARIANTES DE UI ─────────────────────────────────────────────── */

.btn-nav {
    width: 40px;
    height: 40px;
    text-align: center;
    padding: 0;
    font-size: 20px;
    line-height: 0.95;
    border-radius: 20px;
    z-index: 200;
}

.btn-historial {
  max-width: 200px;
  width: auto;
  height: 40px;
  text-align: center;
  border-radius: 20px;
  padding: 0 12px;
  background-color: var(--bs-body-bg) !important;
  color: var(--bs-text-color) !important;
  white-space: nowrap;
}

.btn-historial.dropdown-toggle::after {
  display: none !important;
}

#historialDropdown {
  max-height: 280px;
  overflow-y: auto;
  min-width: 180px;
  font-size: 0.9rem;
  border-radius: 12px;
  margin-bottom: 8px !important;
  z-index: 250;
}

#historialDropdown .dropdown-item {
  cursor: pointer;
  padding: 6px 14px;
}

#historialDropdown .dropdown-item:hover {
  background-color: rgba(var(--bs-primary-rgb), 0.1);
  color: var(--bs-primary);
}

.btn-grey {
    color: var(--grey-60);
    background-color: var(--bs-body-bg);
    border: 0;
}

.btn-grey:hover,
.btn-grey:focus {
    color: var(--grey-80);
    background-color: var(--bs-body-bg);
}

[data-bs-theme="dark"] .btn-grey:hover,
[data-bs-theme="dark"] .btn-grey:focus {
    color: var(--grey-20);
    background-color: var(--bs-body-bg);
}

.btn-verse {
    text-align: left;
    line-height: 1.5rem;
    width: 100%;
    background-color: var(--bs-body-bg);
    padding: 10px;
    border: 0;
}

.btn-verse:hover,
.btn-verse:focus {
    background-color: var(--bs-body-bg);
    border: 0;
}

.btn-verse.active {
    background-color: var(--grey-30);
    border: 1px;
}

[data-bs-theme="dark"] .btn-verse.active {
    background-color: var(--grey-70);
    border: 1px;
}

.btn-verse.active .standard {
    color: var(--text-color);
    border: 0;
}

[data-bs-theme="dark"] .btn-verse.active .standard {
    color: var(--grey-10);
    border: 0;
}

.btn-verse.active .resalted {
    color: var(--grey-90);
    border: 0;
}

[data-bs-theme="dark"] .btn-verse.active .resalted {
    color: var(--grey-10);
    border: 0;
}

/* Botones de planes de lectura */
.btn-verse-badge {
    text-align: center;
    padding: 0.375rem 0.75rem;
    color: var(--primary);
    transition: var(--transition);
}

.btn-verse-badge:hover {
    background-color: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
}

[data-bs-theme="dark"] .btn-verse-badge {
    color: var(--primary-dark);
}

[data-bs-theme="dark"] .btn-verse-badge:hover {
    background-color: var(--primary-dark);
    color: #ffffff;
    border-color: var(--primary-dark);
}

/* Íconos de navegación inferior en móviles */
.nav-bottom-item {
  background: transparent;
  border: none;
  color: #ffffff;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px 0;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.2;
  gap: 2px;
  width: 100%;
  height: 100%;
  cursor: pointer;
  transition: color 0.2s ease-in-out, opacity 0.2s ease-in-out;
}

.nav-bottom-item:hover,
.nav-bottom-item:focus {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
}

.nav-bottom-item.disabled,
.nav-bottom-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.nav-bottom-item i {
  font-size: 1.4rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav-bottom-item span {
  display: block;
  white-space: nowrap;
}

/* Dropdowns para la barra de navegación inferior en móviles */
.dropdown-menu-icon,
.dropdown-menu-bottom-nav {
    min-width: 68px;
    padding: 8px 5px;
    background-color: var(--bs-body-bg);
    border-radius: 18px !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--grey-40);
}

[data-bs-theme="dark"] .dropdown-menu-icon,
[data-bs-theme="dark"] .dropdown-menu-bottom-nav {
    border-color: var(--grey-70);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
}

.dropdown-menu-icon .btn-link {
    padding-left: 0;
    padding-right: 0;
    width: 100%;
    text-decoration: none !important;
}

.dropdown-bottom-item {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--grey-70);
    transition: all 0.2s ease;
    user-select: none;
    text-align: center;
    width: 100%;
    padding: 6px 4px;
    border-radius: 12px;
    text-decoration: none !important;
    gap: 2px;
}

.dropdown-bottom-item i {
    font-size: 1.35rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dropdown-bottom-item span {
    display: block;
    font-size: 0.7rem;
    font-weight: 500;
    line-height: 1.15;
    white-space: nowrap;
}

.dropdown-bottom-item:hover,
.dropdown-bottom-item:focus {
    color: var(--primary);
    background-color: rgba(var(--bs-primary-rgb, 13, 110, 253), 0.08);
    transform: scale(1.04);
}

[data-bs-theme="dark"] .dropdown-bottom-item {
    color: var(--grey-40);
}

[data-bs-theme="dark"] .dropdown-bottom-item:hover,
[data-bs-theme="dark"] .dropdown-bottom-item:focus {
    color: var(--grey-10);
    background-color: rgba(255, 255, 255, 0.08);
}

.bg-panels {
    background-color: var(--bs-body-bg);
}

/* ─── MODALES ─────────────────────────────────────────────────────────────── */

.floating-header {
  height: 36px !important;
  background-color: var(--bs-secondary-bg) !important;
  color: var(--text-color) !important;
}

[data-bs-theme="dark"] .floating-header {
  color: var(--grey-20) !important;
}

.floating-header .btn-close {
  color: var(--text-color) !important;
}

#edlp_logo {
  filter: none;
}

[data-bs-theme="dark"] #edlp_logo {
  filter: invert(1);
}

/* ─── PHOSPHOR ICONS Y ENVOLTORIOS ────────────────────────────────────────── */

.ph,
.ph-bold,
.ph-fill,
.ph-light,
.ph-thin,
.ph-duotone,
[class^="ph-"],
[class*=" ph-"] {
  display: inline-block;
  text-decoration: none !important;
  vertical-align: text-bottom !important;
}

/* Evitar subrayado en enlaces, botones o contenedores que envuelven iconos Phosphor */
a:has([class*="ph"]),
a:has([class^="ph"]),
button:has([class*="ph"]),
button:has([class^="ph"]),
label:has([class*="ph"]),
label:has([class^="ph"]),
.btn-link:has([class*="ph"]),
.btn-link:has([class^="ph"]),
.menu-lat-link {
  text-decoration: none !important;
}

a:has([class*="ph"]):hover,
a:has([class*="ph"]):focus,
button:has([class*="ph"]):hover,
button:has([class*="ph"]):focus,
label:has([class*="ph"]):hover,
label:has([class*="ph"]):focus,
.btn-link:has([class*="ph"]):hover,
.btn-link:has([class*="ph"]):focus,
.menu-lat-link:hover,
.menu-lat-link:focus {
  text-decoration: none !important;
}

tiny,
.tiny {
  font-size: 0.7em;
}
