/* Modo oscuro para Instant Entry - Usando el sistema del framework (body.dark-mode) */
/* Fondo azul oscuro de Pukiebook: #1c1f2f */
/* Texto blanco: #ffffff */
/* Bordes grises: #808080 */

body.dark-mode #container {
    background-color: #1c1f2f !important;
    color: #ffffff !important;
    min-height: 100vh;
}

body.dark-mode .content-wrapper {
    background-color: #1c1f2f !important;
}

body.dark-mode .content {
    background-color: #1c1f2f !important;
}

/* Todos los textos en blanco - sobrescribir estilos inline */
body.dark-mode #container h2,
body.dark-mode #container h2[style*="color"],
body.dark-mode #container h4,
body.dark-mode #container h4[style*="color"],
body.dark-mode #container label,
body.dark-mode #container label[style*="color"],
body.dark-mode #container div[style*="color"],
body.dark-mode #container div[style*="color: #000000"],
body.dark-mode #container div[style*="color: #666"],
body.dark-mode #container span,
body.dark-mode #container span[style*="color"],
body.dark-mode #container p,
body.dark-mode #container p[style*="color"],
body.dark-mode #container small,
body.dark-mode #container small[style*="color"] {
    color: #ffffff !important;
}

/* Sobrescribir colores específicos en list-group-item */
body.dark-mode #container .list-group-item div[style*="color: #000000"],
body.dark-mode #container .list-group-item div[style*="color: #666"],
body.dark-mode #container .list-group-item span[style*="color: #999"] {
    color: #ffffff !important;
}

body.dark-mode #container .list-group-item small[style*="color: #999"] {
    color: #cccccc !important;
}

/* Excepciones para mantener algunos colores específicos */
body.dark-mode #container .btn-primary,
body.dark-mode #container .btn-success,
body.dark-mode #container .btn-danger,
body.dark-mode #container .btn-warning,
body.dark-mode #container .btn-info {
    color: #ffffff !important;
}

/* Labels y títulos */
body.dark-mode #container label,
body.dark-mode #container h1,
body.dark-mode #container h2,
body.dark-mode #container h3,
body.dark-mode #container h4,
body.dark-mode #container h5,
body.dark-mode #container h6 {
    color: #ffffff !important;
}

/* Párrafos y spans */
body.dark-mode #container p,
body.dark-mode #container span {
    color: #ffffff !important;
}

/* Small text */
body.dark-mode #container small {
    color: #cccccc !important;
}

/* Inputs y selects - fondo oscuro, texto blanco, borde gris */
body.dark-mode #container .form-control,
body.dark-mode #container input[type="text"],
body.dark-mode #container input[type="number"],
body.dark-mode #container input[type="time"],
body.dark-mode #container input[type="datetime-local"],
body.dark-mode #container select {
    background-color: #2a2d3f !important;
    color: #ffffff !important;
    border-color: #808080 !important;
}

body.dark-mode #container .form-control::placeholder {
    color: #a0a0a0 !important;
}

body.dark-mode #container .form-control:focus {
    border-color: #808080 !important;
    box-shadow: 0 0 0 0.2rem rgba(128, 128, 128, 0.25) !important;
}

/* List group items - fondo oscuro, borde gris, texto blanco */
body.dark-mode #container .list-group-item,
body.dark-mode #container .list-group-item[style*="border"] {
    background-color: #2a2d3f !important;
    border-color: #808080 !important;
    border: 1px solid #808080 !important;
    color: #ffffff !important;
}

body.dark-mode #container .list-group-item div,
body.dark-mode #container .list-group-item span {
    color: #ffffff !important;
}

body.dark-mode #container .list-group-item small {
    color: #cccccc !important;
}

/* Cards y paneles */
body.dark-mode #container .card,
body.dark-mode #container .panel,
body.dark-mode #container .well {
    background-color: #2a2d3f !important;
    border-color: #808080 !important;
    color: #ffffff !important;
}

body.dark-mode #container .card-header,
body.dark-mode #container .panel-heading {
    background-color: #1c1f2f !important;
    border-bottom-color: #808080 !important;
    color: #ffffff !important;
}

body.dark-mode #container .card-body,
body.dark-mode #container .panel-body {
    background-color: #2a2d3f !important;
    color: #ffffff !important;
}

/* Modal en modo oscuro */
body.dark-mode #finishTimeModal .modal-content {
    background-color: #2a2d3f !important;
    border-color: #808080 !important;
    color: #ffffff !important;
}

body.dark-mode #finishTimeModal .modal-header {
    background-color: #1c1f2f !important;
    border-bottom-color: #808080 !important;
    color: #ffffff !important;
}

body.dark-mode #finishTimeModal .modal-header .close {
    color: #ffffff !important;
    opacity: 0.8;
}

body.dark-mode #finishTimeModal .modal-header .close:hover {
    opacity: 1;
}

body.dark-mode #finishTimeModal .modal-body {
    background-color: #2a2d3f !important;
    color: #ffffff !important;
}

body.dark-mode #finishTimeModal .modal-footer {
    background-color: #2a2d3f !important;
    border-top-color: #808080 !important;
    color: #ffffff !important;
}

body.dark-mode #finishTimeModal .modal-title {
    color: #ffffff !important;
}

body.dark-mode #finishTimeModal label {
    color: #ffffff !important;
}

body.dark-mode #finishTimeModal p {
    color: #ffffff !important;
}

/* Mantener la fecha de llegada en azul si tiene ese estilo específico */
body.dark-mode #finishTimeModal .modal-body p[style*="color: #3c8dbc"],
body.dark-mode #finishTimeModal .modal-body p[style*="color:#3c8dbc"],
body.dark-mode #finishTimeModal .modal-body p[style*="rgb(60, 141, 188)"] {
    color: #3c8dbc !important;
}

body.dark-mode #finishTimeModal small {
    color: #cccccc !important;
}

/* Modal detalle tiempo (solo lectura) */
body.dark-mode #resultDetailsModal .modal-content {
    background-color: #2a2d3f !important;
    border-color: #808080 !important;
    color: #ffffff !important;
}

body.dark-mode #resultDetailsModal .modal-header {
    background-color: #1c1f2f !important;
    border-bottom-color: #808080 !important;
    color: #ffffff !important;
}

body.dark-mode #resultDetailsModal .modal-header .close {
    color: #ffffff !important;
    opacity: 0.8;
}

body.dark-mode #resultDetailsModal .modal-body {
    background-color: #2a2d3f !important;
    color: #ffffff !important;
}

body.dark-mode #resultDetailsModal .modal-footer {
    background-color: #2a2d3f !important;
    border-top-color: #808080 !important;
    color: #ffffff !important;
}

body.dark-mode #resultDetailsModal .modal-title,
body.dark-mode #resultDetailsModal label,
body.dark-mode #resultDetailsModal p {
    color: #ffffff !important;
}

body.dark-mode #resultDetailsModal .text-muted {
    color: #9a9aa8 !important;
}

body.dark-mode #resultDetailsModal hr {
    border-color: #808080 !important;
}

body.dark-mode #resultDetailsModal small {
    color: #cccccc !important;
}

/* Botones - mantener colores pero con bordes grises */
body.dark-mode #container .btn {
    border-color: #808080 !important;
}

body.dark-mode #container .btn-default {
    background-color: #2a2d3f !important;
    color: #ffffff !important;
    border-color: #808080 !important;
}

body.dark-mode #container .btn-default:hover {
    background-color: #3a3d4f !important;
    border-color: #909090 !important;
}

/* Tablas */
body.dark-mode #container table {
    background-color: #1c1f2f !important;
    color: #ffffff !important;
}

body.dark-mode #container table th,
body.dark-mode #container table td {
    background-color: #2a2d3f !important;
    color: #ffffff !important;
    border-color: #808080 !important;
}

body.dark-mode #container table thead th {
    background-color: #1c1f2f !important;
    border-bottom-color: #808080 !important;
}

/* Alerts */
body.dark-mode #container .alert {
    background-color: #2a2d3f !important;
    border-color: #808080 !important;
    color: #ffffff !important;
}

/* Badges */
body.dark-mode #container .badge {
    background-color: #2a2d3f !important;
    color: #ffffff !important;
    border: 1px solid #808080 !important;
}

/* HR (líneas horizontales) */
body.dark-mode #container hr {
    border-color: #808080 !important;
}

/* Links */
body.dark-mode #container a {
    color: #ffffff !important;
}

body.dark-mode #container a:hover {
    color: #cccccc !important;
}

/* Input groups */
body.dark-mode #container .input-group-addon {
    background-color: #2a2d3f !important;
    border-color: #808080 !important;
    color: #ffffff !important;
}

/* Dropdowns */
body.dark-mode #container .dropdown-menu {
    background-color: #2a2d3f !important;
    border-color: #808080 !important;
}

body.dark-mode #container .dropdown-menu > li > a {
    color: #ffffff !important;
}

body.dark-mode #container .dropdown-menu > li > a:hover {
    background-color: #3a3d4f !important;
    color: #ffffff !important;
}

/* Sobrescribir el fondo del container que tiene estilo inline */
body.dark-mode #container[style*="background-color: #ffffff"] {
    background-color: #1c1f2f !important;
}

/* Mensaje cuando no hay resultados */
body.dark-mode #container div[style*="color: #666"] {
    color: #ffffff !important;
}

/* Título y etiqueta BIB (entrada rápida) */
body.dark-mode #container .ie-page-heading {
    color: #ffffff !important;
}

body.dark-mode #container .ie-bib-label {
    color: #ffffff !important;
}

/* Tarjeta de vista previa instant-entry (.ie-info-card) */
body.dark-mode #container .ie-info-card {
    background-color: #2a2d3f !important;
    border: 1px solid #808080 !important;
    color: #f2f2f5 !important;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35) !important;
}

body.dark-mode #container .ie-info-card .ie-card-kicker {
    color: #9a9aa8 !important;
}

body.dark-mode #container .ie-info-card .ie-athlete-name {
    color: #ffffff !important;
}

body.dark-mode #container .ie-info-card .ie-muted {
    color: #c9c9d4 !important;
}

body.dark-mode #container .ie-info-card .ie-bib-strong {
    color: #f8bbd0 !important;
}

body.dark-mode #container .ie-info-card .ie-preview-time {
    color: #ffffff !important;
}

body.dark-mode #container .ie-info-card .ie-preview-time-warn {
    color: #5bc0de !important;
}

body.dark-mode #container .ie-info-card .ie-preview-time-no-start {
    color: #ffffff !important;
    background: transparent !important;
}

/* Botón rosa: mantener acento Pukiebook (no el borde gris genérico de .btn) */
body.dark-mode #container .ie-info-card .ie-add-time-btn {
    background-color: #e91e63 !important;
    border-color: #e91e63 !important;
    color: #ffffff !important;
}

body.dark-mode #container .ie-info-card .ie-add-time-btn:hover,
body.dark-mode #container .ie-info-card .ie-add-time-btn:focus {
    background-color: #c2185b !important;
    border-color: #c2185b !important;
    color: #ffffff !important;
}

body.dark-mode #container .ie-info-card .ie-add-time-btn:disabled {
    opacity: 0.55 !important;
    color: #ffffff !important;
}

@media (max-width: 575.98px) {
    body.dark-mode #container .ie-result-actions {
        border-top-color: #808080 !important;
    }
}
