/* Modern Light Theme CSS para OTD Dashboard */

/* Variables de colores para tema moderno claro */
:root {
  /* Colores principales */
  --light-primary: #3a57e8;
  --light-primary-light: #4361f0;
  --light-secondary: #6c757d;
  --light-success: #1aa053;
  --light-danger: #c03221;
  --light-warning: #f16a1b;
  --light-info: #08b1e8;
  --light-light: #f8f9fa;
  --light-dark: #212529;
  --light-white: #ffffff;
  
  /* Colores para tema claro */
  --light-body-bg: #dee2e6;
  --light-card-bg: #f8f9fa;
  --light-card-shadow: 0 0.75rem 1.5rem rgba(0, 0, 0, 0.08);
  --light-border-color: #e9ecef;
  --light-hover-bg: #f8f9fa;
  --light-text-muted: #6c757d;
  --light-text-primary: #343a40;
  --light-text-secondary: #6c757d;
  --light-sidebar-bg: #ffffff;
  --light-sidebar-text: #343a40;
  --light-header-height: 70px;
  --light-table-header-bg: #f8f9fa;
  --light-table-row-bg: #ffffff;
  --light-table-row-alt-bg: #f8f9fa;
  
  /* Colores de botones vibrantes */
  --light-btn-blue: #3a57e8;
  --light-btn-red: #c03221;
  --light-btn-green: #1aa053;
  --light-btn-yellow: #f16a1b;
  --light-btn-purple: #6c25be;
  --light-btn-teal: #08b1e8;
  
  /* Colores semáforo para el tema claro */
  --light-danger-bg: #f8d7da;
  --light-warning-bg: #fff3cd;
  --light-success-bg: #d4edda;
  --light-info-bg: #d1ecf1;
}

/* Estilos generales para tema moderno claro */
body.light-mode {
  background-color: var(--light-body-bg);
  color: var(--light-text-primary);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Barra de navegación */
body.light-mode .bg-primary {
  background: linear-gradient(90deg, #c9cfd4, #d6dbe0) !important;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.15);
  height: var(--light-header-height);
  border-bottom: 1px solid #ced4da;
}

body.light-mode .navbar-brand {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.05rem;
  color: #000000;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* Título OTD Dashboard en tema claro */
body.light-mode .dashboard-title {
  color: #212529 !important;
  font-weight: 700;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

body:not(.light-mode) .dashboard-title {
  color: #ffffff !important;
}

/* Mantener el título del cliente en blanco */
body.light-mode .card-header.bg-dark {
  background: linear-gradient(135deg, #343a40, #212529) !important;
}

body.light-mode .card-header.bg-dark .text-white {
  color: #ffffff !important;
}

/* Estilos para encabezados de tarjetas en página de completados */
body.light-mode .card-header.bg-success {
  background: linear-gradient(135deg, #198754, #157347) !important;
}

body.light-mode .card-header.bg-warning {
  background: linear-gradient(135deg, #ffc107, #e0a800) !important;
}

body.light-mode .card-header.bg-success .text-white,
body.light-mode .card-header.bg-warning .text-white {
  color: #ffffff !important;
}

body.light-mode .navbar .btn {
  border-radius: 0.5rem;
  font-size: 0.875rem;
  padding: 0.5rem 1rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
  font-weight: 500;
}

/* Tarjetas */
body.light-mode .card {
  background-color: var(--light-card-bg);
  border: none;
  border-radius: 0.75rem;
  box-shadow: var(--light-card-shadow);
  margin-bottom: 1.5rem;
  overflow: hidden;
  border: 1px solid var(--light-border-color);
}

body.light-mode .card-header {
  background-color: var(--light-card-bg);
  border-bottom: 1px solid var(--light-border-color);
  padding: 1rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.light-mode .card-header h5,
body.light-mode .card-header h6 {
  font-weight: 600;
  margin-bottom: 0;
  color: var(--light-text-primary);
}

body.light-mode .card-header.bg-dark {
  background: linear-gradient(135deg, #343a40, #212529) !important;
  border-bottom: none;
  color: #ffffff;
}

body.light-mode .card-header.bg-dark h5,
body.light-mode .card-header.bg-dark h6 {
  color: #ffffff;
}

body.light-mode .card-body {
  padding: 1.5rem;
}

body.light-mode .card-footer {
  background-color: var(--light-card-bg);
  border-top: 1px solid var(--light-border-color);
  padding: 1.25rem 1.5rem;
}

/* Tablas */
body.light-mode .table {
  color: var(--light-text-primary);
  margin-bottom: 0;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 0.5rem;
  overflow: hidden;
}

body.light-mode .table thead th {
  background-color: var(--light-table-header-bg);
  border-bottom: 1px solid var(--light-border-color);
  color: var(--light-text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  padding: 0.75rem 1.25rem;
  white-space: nowrap;
}

body.light-mode .table-striped > tbody > tr:nth-of-type(odd) {
  background-color: var(--light-table-row-bg);
}

/* Estilos para tablas en página de completados */
body.light-mode .table-success {
  background-color: rgba(25, 135, 84, 0.15) !important;
}

body.light-mode .table-warning {
  background-color: rgba(255, 193, 7, 0.15) !important;
}

body.light-mode .table-light {
  background-color: #f8f9fa !important;
  color: #212529 !important;
}

body.light-mode .badge.bg-primary {
  background-color: #0d6efd !important;
  color: #ffffff !important;
}

body.light-mode .badge.bg-success {
  background-color: #198754 !important;
  color: #ffffff !important;
}

body.light-mode .badge.bg-warning {
  background-color: #ffc107 !important;
  color: #212529 !important;
}

body.light-mode .badge.bg-secondary {
  background-color: #6c757d !important;
  color: #ffffff !important;
}

body.light-mode .table-striped > tbody > tr:nth-of-type(even) {
  background-color: var(--light-table-row-alt-bg);
}

body.light-mode .table-hover > tbody > tr:hover {
  background-color: var(--light-hover-bg);
}

body.light-mode .table td, 
body.light-mode .table th {
  border-color: var(--light-border-color);
  padding: 1rem 1.25rem;
  vertical-align: middle;
  font-size: 0.875rem;
}

body.light-mode .table td {
  color: var(--light-text-primary);
}

/* Estilos para tablas dentro de cards */
body.light-mode .card .table {
  margin: 0;
}

body.light-mode .card .table th:first-child,
body.light-mode .card .table td:first-child {
  padding-left: 1.5rem;
}

body.light-mode .card .table th:last-child,
body.light-mode .card .table td:last-child {
  padding-right: 1.5rem;
}

body.light-mode .table td, 
body.light-mode .table th {
  border-top: 1px solid var(--light-border-color);
  padding: 0.75rem;
  vertical-align: middle;
}

/* Badges y estados */
body.light-mode .badge {
  font-weight: 500;
  padding: 0.5em 0.75em;
  border-radius: 0.5rem;
  font-size: 0.75rem;
  letter-spacing: 0.025rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

body.light-mode .bg-danger {
  background-color: #dc3545 !important;
  color: white !important;
}

body.light-mode .bg-warning {
  background-color: #ffc107 !important;
  color: #343a40 !important;
}

body.light-mode .bg-success {
  background-color: #28a745 !important;
  color: white !important;
}

body.light-mode .bg-info {
  background-color: #17a2b8 !important;
  color: white !important;
}

/* Badges con borde */
body.light-mode .badge.border {
  border: 1px solid;
}

/* Botones */
body.light-mode .btn {
  font-weight: 500;
  padding: 0.5rem 1rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  transition: all 0.2s ease;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
  border: none;
}

body.light-mode .btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0.3rem 0.5rem rgba(0, 0, 0, 0.05);
  opacity: 0.9;
}

body.light-mode .btn:active {
  transform: translateY(0);
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.05);
}

body.light-mode .btn-light {
  background-color: #e9ecef;
  color: var(--light-text-primary);
}

body.light-mode .btn-light:hover {
  background-color: #dee2e6;
  color: var(--light-text-primary);
}

body.light-mode .btn-light.active {
  background-color: var(--light-primary);
  color: white;
}

/* Botones de acción */
body.light-mode .btn-info {
  background-color: #17a2b8;
  color: white;
}

body.light-mode .btn-success {
  background-color: #28a745;
  color: white;
}

body.light-mode .btn-warning {
  background-color: #ffc107;
  color: #343a40;
}

body.light-mode .btn-danger {
  background-color: #dc3545;
  color: white;
}

body.light-mode .btn-primary {
  background-color: #212529;
  color: white;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.2);
}

/* Botones de acción en tablas */
body.light-mode .btn-sm {
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.375rem;
}

/* Botones en la barra de navegación */
body.light-mode .navbar .btn {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--light-text-primary);
  transition: all 0.2s ease;
}

body.light-mode .navbar .btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
}

body.light-mode .navbar .btn.active,
body.light-mode .btn-primary,
body.light-mode .btn-light.active,
body.light-mode a.btn.active {
  background-color: #212529 !important;
  color: white !important;
  box-shadow: 0 0.125rem 0.375rem rgba(0, 0, 0, 0.2);
  border-color: #212529 !important;
}

/* Modales */
body.light-mode .modal-content {
  border: none;
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

body.light-mode .modal-header {
  background-color: var(--light-white);
  border-bottom: 1px solid var(--light-border-color);
  padding: 1rem 1.25rem;
}

body.light-mode .modal-footer {
  border-top: 1px solid var(--light-border-color);
  padding: 1rem 1.25rem;
}

/* Formularios */
body.light-mode .form-control,
body.light-mode .form-select {
  border-color: var(--light-border-color);
  border-radius: 0.25rem;
  padding: 0.375rem 0.75rem;
}

body.light-mode .form-control:focus,
body.light-mode .form-select:focus {
  border-color: var(--light-primary);
  box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Footer */
body.light-mode .footer {
  background-color: var(--light-white) !important;
  border-top: 1px solid var(--light-border-color);
  padding: 1rem 0;
}

body.light-mode .footer .text-muted {
  color: var(--light-text-muted) !important;
}

/* ID Único y otros elementos específicos */
body.light-mode td span[style*="background-color: #e2e3e5"] {
  background-color: #f8f9fa !important;
  color: #343a40 !important;
  border: 1px solid #dee2e6;
  font-family: 'Roboto Mono', monospace;
}

/* Ajustes para las filas de productos */
body.light-mode .orden-card tr.table-danger,
body.light-mode .orden-card tr.table-danger.bg-opacity-25,
body.light-mode .orden-card tbody tr.table-danger,
body.light-mode .orden-card tbody tr.table-danger td {
  background-color: var(--light-danger-bg) !important;
  color: #343a40 !important;
  border-color: #f5c2c7 !important;
}

body.light-mode .orden-card tr.table-warning,
body.light-mode .orden-card tr.table-warning.bg-opacity-25,
body.light-mode .orden-card tbody tr.table-warning,
body.light-mode .orden-card tbody tr.table-warning td {
  background-color: var(--light-warning-bg) !important;
  color: #343a40 !important;
  border-color: #ffe69c !important;
}

body.light-mode .orden-card tr.table-success,
body.light-mode .orden-card tr.table-success.bg-opacity-25,
body.light-mode .orden-card tbody tr.table-success,
body.light-mode .orden-card tbody tr.table-success td {
  background-color: var(--light-success-bg) !important;
  color: #343a40 !important;
  border-color: #c3e6cb !important;
}

/* Sobrescribir estilos de Bootstrap para las filas en tema claro */
body.light-mode .table-danger {
  --bs-table-bg: var(--light-danger-bg) !important;
  --bs-table-striped-bg: var(--light-danger-bg) !important;
  --bs-table-active-bg: var(--light-danger-bg) !important;
  --bs-table-hover-bg: #f5c2c7 !important;
  color: #343a40 !important;
}

body.light-mode .table-warning {
  --bs-table-bg: var(--light-warning-bg) !important;
  --bs-table-striped-bg: var(--light-warning-bg) !important;
  --bs-table-active-bg: var(--light-warning-bg) !important;
  --bs-table-hover-bg: #ffe69c !important;
  color: #343a40 !important;
}

body.light-mode .table-success {
  --bs-table-bg: var(--light-success-bg) !important;
  --bs-table-striped-bg: var(--light-success-bg) !important;
  --bs-table-active-bg: var(--light-success-bg) !important;
  --bs-table-hover-bg: #c3e6cb !important;
  color: #343a40 !important;
}

/* Estilo para el ID único en tema claro */
body.light-mode .id-unico-badge {
  background-color: #e9ecef;
  color: #495057;
  font-size: 0.65rem;
  padding: 1px 4px;
  border-radius: 3px;
  display: inline-block;
}

/* Estilos para los botones de tema - Tema Claro */
body.light-mode .theme-buttons {
  display: flex;
  gap: 0.5rem;
}

body.light-mode .theme-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--light-text-secondary);
  transition: all 0.2s ease;
  cursor: pointer;
}

body.light-mode .theme-btn:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-2px);
}

/* Estilos específicos para cada botón de tema - Tema Claro */
body.light-mode .theme-standard-btn {
  border: 1px solid rgba(0, 0, 0, 0.1);
}

body.light-mode .theme-dark-btn {
  background-color: #343a40;
  color: #f8f9fa;
}

body.light-mode .theme-light-btn {
  background-color: #f8f9fa;
  color: #343a40;
  border: 1px solid rgba(0, 0, 0, 0.1);
}

/* Indicador de tema activo - Tema Claro */
body.light-mode #theme-light-btn.active,
body.light-mode .theme-btn[data-theme="modern-light"].active {
  background-color: #212529 !important;
  color: white !important;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.2);
  transform: scale(1.1);
  border: none;
}

/* Efectos de hover en enlaces */
body.light-mode a:not(.btn):not(.nav-link) {
  color: var(--light-btn-blue);
  text-decoration: none;
  transition: all 0.2s ease;
}

body.light-mode a:not(.btn):not(.nav-link):hover {
  color: #0056b3;
  text-decoration: underline;
}

/* Estilos para tooltips */
body.light-mode .tooltip .tooltip-inner {
  background-color: var(--light-bg-tertiary);
  color: var(--light-text-primary);
  border: 1px solid var(--light-border-color);
  box-shadow: 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
}

body.light-mode .tooltip .tooltip-arrow::before {
  border-top-color: var(--light-bg-tertiary);
}

/* Estilos para dropdown menus */
body.light-mode .dropdown-menu {
  background-color: var(--light-white);
  border: 1px solid var(--light-border-color);
  border-radius: 0.5rem;
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

body.light-mode .dropdown-item {
  color: var(--light-text-primary);
}

body.light-mode .dropdown-item:hover, 
body.light-mode .dropdown-item:focus {
  background-color: var(--light-hover-bg);
  color: var(--light-text-primary);
}

body.light-mode .dropdown-item.active {
  background-color: var(--light-btn-blue);
  color: white;
}
