body.with-navbar {
    padding-top: 80px; /* Ajusta según altura real del navbar */
}
html {
    scroll-behavior: smooth;
}
/*Texto formateado para el form.show*/
.formatted-text {
    white-space: pre-line;
    margin-top: 0.5rem;
    line-height: 1.6;
}
[data-bs-theme="dark"] .formatted-text {
    color: #ddd;
}
[data-bs-theme="dark"] .list-group-item {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #333;
}

/*Corrige el espacio que cubre el nav fijo que no se puede visualizar bien*/
#tipo-memoria,
section[id^="hist-"] {
    scroll-margin-top: 90px; /* Ajusta a la altura exacta de tu navbar */
}

/*CSS para el boton de elección de tema*/
.theme-switch {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    user-select: none;
}
.theme-switch .switch {
    position: relative;
    width: 50px;
    height: 24px;
    background-color: #ccc;
    border-radius: 12px;
    transition: background-color 0.3s ease;
}
.theme-switch .ball {
    position: absolute;
    width: 20px;
    height: 20px;
    top: 2px;
    left: 2px;
    border-radius: 50%;
    background-color: white;
    transition: transform 0.3s ease;
}
.theme-switch .switch:hover {
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
}
[data-bs-theme="dark"] body {
    background-color: #121212;
    color: #e0e0e0;
}

[data-bs-theme="dark"] .card {
    background-color: #1e1e1e;
    color: #fff;
    border: 1px solid #333;
}

[data-bs-theme="dark"] .navbar,
[data-bs-theme="dark"] .card-footer {
    background-color: #1a1a1a !important;
    border-color: #333 !important;
}

[data-bs-theme="dark"] .form-control {
    background-color: #2c2c2c;
    color: #f0f0f0;
    border-color: #555;
}

[data-bs-theme="dark"] .btn-primary {
    background-color: #375a7f;
    border-color: #375a7f;
}

[data-bs-theme="dark"] .btn-secondary {
    background-color: #6c757d;
    border-color: #6c757d;
}

[data-bs-theme="dark"] a {
    color: #cfcfcf;
}

/* Cuando es oscuro, mueve la bola a la derecha */
[data-bs-theme="dark"] .theme-switch .switch {
    background-color: #555;
}

[data-bs-theme="dark"] .theme-switch .ball {
    transform: translateX(26px);
}

/* En tema oscuro el desplegable se pone en oscuro */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: #2c2c2c;
}

[data-bs-theme="dark"] .dropdown-menu .dropdown-item {
    color: #ffffff;
}

[data-bs-theme="dark"] .dropdown-menu .dropdown-item:hover {
    background-color: #444444;
    color: #ffffff;
}

[data-bs-theme="dark"] .dropdown-divider {
    border-color: #666;
}

/* Efecto hover de las card del form.create y form.edit*/
.memory-card {
    transition: transform 0.28s ease, box-shadow 0.3s ease;
    opacity: 0; /*Las cards se ocultan al principio y que luego se vea la animación correctamente*/
    min-height: 300px;
    max-width: 680px;
    width: 120%;
    margin-bottom: 20px;
}
.memory-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(221, 15, 15, 0.452);
}

/* Mostrar dropdown en hover */
.nav-item.dropdown:hover .dropdown-menu {
    display: block;
    margin-top: 0; /* Alineación exacta con el enlace */
}

/* Evitar que se cierre de inmediato al pasar de enlace a menú */
.nav-item.dropdown:hover .dropdown-toggle {
    color: #000000; /* O el color que uses para el texto activo */
    background-color: #dc3545; /* Opcional: color de fondo en hover */

}

/* El formulario de PCI Manager se ajusta al tema oscuro*/
[data-bs-theme="dark"] select.form-select {
    background-color: #2c2c2c;
    color: #f0f0f0;
    border-color: #555;
}

[data-bs-theme="dark"] select.form-select option {
    background-color: #2c2c2c;
    color: #f0f0f0;
}

[data-bs-theme="dark"] input.form-control {
    background-color: #2c2c2c;
    color: #f0f0f0;
    border-color: #555;
}