/* ══════════════════════════════════════════════════════════════
   ESTILOS GLOBALES COMPARTIDOS
   ══════════════════════════════════════════════════════════════ */

/* ══ PALETA DE COLORES ══════════════════════════════════ */
:root {
  --bg-primary: #0a0612;
  --bg-secondary: #1a1424;
  --bg-tertiary: rgba(255,255,255,0.04);
  --text-primary: #ffffff;
  --text-secondary: rgba(220,210,255,0.8);
  --text-muted: rgba(196,164,255,0.5);
  --border-color: rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.09);
  --accent-primary: #8b5cf6;
  --accent-dark: #6d28d9;
  --success: #6ddf84;
  --error: #fca5a5;
  --warning: #f5c95a;
  --info: #7eb8ff;
  --purple-light: #a78bfa;
  --scrollbar-color: rgba(139,92,246,0.5);
  --shadow-sm: 0 4px 18px rgba(109,40,217,0.4);
  --shadow-lg: 0 8px 28px rgba(139,92,246,0.55);
}

:root.light-mode {
  --bg-primary: #fafbfc;
  --bg-secondary: #f3f4f7;
  --bg-tertiary: #f0f1f5;
  --text-primary: #000000;
  --text-secondary: #2d2d4a;
  --text-muted: #595975;
  --border-color: #e0e1e8;
  --border-light: #ececf3;
  --accent-primary: #7c3aed;
  --accent-dark: #6d28d9;
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --purple-light: #6d28d9;
  --scrollbar-color: rgba(124,58,237,0.6);
  --shadow-sm: 0 2px 8px rgba(124,58,237,0.1);
  --shadow-lg: 0 8px 24px rgba(124,58,237,0.12);
  color-scheme: light;
}

/* ══ RESET ══════════════════════════════════ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
* { scrollbar-width: thin; scrollbar-color: var(--scrollbar-color) transparent; }
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-thumb { background: var(--scrollbar-color); border-radius: 10px; }

/* ══ FUENTES ══════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500;600;700&family=DM+Serif+Display:ital@0;1&family=DM+Mono:wght@400;500&display=swap');

/* ══ ANIMACIONES COMPARTIDAS ══════════════════════════════════ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes toastIn {
  from { transform: translateX(36px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ══ LOGO BRAND ══════════════════════════════════ */
.logo-brand {
  filter: invert(0);
  transition: filter 0.2s ease;
}

:root.light-mode .logo-brand {
  filter: invert(0);
}

:root:not(.light-mode) .logo-brand {
  filter: invert(1) brightness(1.1);
}

/* ══ THEME TOGGLE BUTTON ══════════════════════════════════ */
#theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  font-size: 18px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  flex-shrink: 0;
}

#theme-toggle-btn:hover {
  background: var(--bg-tertiary);
  border-color: var(--accent-primary);
  transform: scale(1.05);
}

/* ══ PAGINATION ══════════════════════════════════ */
.pagination-active {
  background: rgba(139,92,246,0.3) !important;
  border-color: #8b5cf6 !important;
}

:root.light-mode .pagination-active {
  background: linear-gradient(135deg, #7c3aed, #6d28d9) !important;
  border-color: #7c3aed !important;
  color: #ffffff !important;
}

.pagination-info {
  margin-left: 15px;
  font-size: 12px;
  color: rgba(196,164,255,0.5);
}

:root.light-mode .pagination-info {
  color: #000000;
}

/* ══ INFO CELL (KAM/PM y otros campos) ══════════════════════════════ */
.info-cell label {
  color: #888 !important;
}

:root.light-mode .info-cell label {
  color: #595975 !important;
}

.info-cell span {
  color: rgba(220, 210, 255, 0.9) !important;
}

:root.light-mode .info-cell span {
  color: #000000 !important;
}

/* ══ ADMIN APPROVAL BUTTON ══════════════════════════════ */
#btn-admin-approve {
  background: rgba(16,185,129,0.2) !important;
  border-color: rgba(16,185,129,0.4) !important;
  color: #6ee7b7 !important;
}

:root.light-mode #btn-admin-approve {
  background: #10b981 !important;
  border-color: #059669 !important;
  color: #ffffff !important;
}

/* ══ VERSIONS CARD ══════════════════════════════ */
#card-versions {
  color: rgba(196, 164, 255, 0.5);
}

:root.light-mode #card-versions {
  color: #000000;
}

#versions-list {
  color: rgba(196, 164, 255, 0.5);
}

:root.light-mode #versions-list {
  color: #2d2d4a;
}

/* ══ BRIEF/ADJUNTO TEXT ══════════════════════════════ */
#brief-filename,
[id*="brief"] {
  color: rgba(196, 164, 255, 0.5);
}

:root.light-mode #brief-filename,
:root.light-mode [id*="brief"] {
  color: #2d2d4a;
}

/* ══ VERSION HISTORY STYLES ══════════════════════════════ */
.version-number {
  color: #fff !important;
}

:root.light-mode .version-number {
  color: #000000 !important;
}

.version-badge {
  color: #c4b5fd !important;
}

:root.light-mode .version-badge {
  color: #7c3aed !important;
}

.version-date {
  color: rgba(196, 164, 255, 0.5) !important;
}

:root.light-mode .version-date {
  color: #000000 !important;
}

.version-items {
  color: rgba(196, 164, 255, 0.5) !important;
}

:root.light-mode .version-items {
  color: #000000 !important;
}

.version-total {
  color: #c4b5fd !important;
}

:root.light-mode .version-total {
  color: #7c3aed !important;
}

/* ══ KAM/PM SELECT ══════════════════════════════ */
.kam-pm-select {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(139, 92, 246, 0.2) !important;
}

:root.light-mode .kam-pm-select {
  color: #000000 !important;
  background: #ffffff !important;
  border: 1px solid #e0e1e8 !important;
}

/* ══ VERSIONS COUNT ══════════════════════════════ */
#versions-count {
  color: rgba(196, 164, 255, 0.5) !important;
}

:root.light-mode #versions-count {
  color: #2d2d4a !important;
}

/* ══ VERSIONS CARD TITLE ══════════════════════════════ */
#card-versions h3 {
  color: rgba(196, 164, 255, 0.5);
}

:root.light-mode #card-versions h3 {
  color: #000000 !important;
}
