/* ── CSS PRINCIPAL DE INSPECTRA OS v3.2 ── */

:root {
  --os-bg: #030816;
  --os-fg: #d1dbed;
  --os-primary: #0088ff;
  --os-primary-glow: rgba(0, 136, 255, 0.4);
  --os-success: #00e676;
  --os-success-glow: rgba(0, 230, 118, 0.3);
  --os-warning: #ffb300;
  --os-danger: #ff1744;
  --os-panel: rgba(10, 22, 47, 0.65);
  --os-panel-border: rgba(0, 136, 255, 0.25);
  --os-panel-hover: rgba(0, 136, 255, 0.15);
  --font-os: 'Outfit', sans-serif;
  --font-terminal: 'JetBrains Mono', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-os);
  background-color: var(--os-bg);
  color: var(--os-fg);
  overflow: hidden;
  height: 100vh;
  width: 100vw;
  user-select: none;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(0, 40, 100, 0.15) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 136, 255, 0.05) 0%, transparent 50%),
    linear-gradient(rgba(3, 8, 22, 0.65), rgba(3, 8, 22, 0.85)),
    url('web/fondopantalla.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* CRT monitor effect and scanlines */
.crt-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: radial-gradient(circle, transparent 65%, rgba(0, 0, 0, 0.4) 100%);
  pointer-events: none;
  z-index: 9999;
}
.scanlines {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.12) 50%);
  background-size: 100% 4px;
  pointer-events: none;
  z-index: 9998;
}

/* MAIN OS CONTAINER */
.os-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  justify-content: space-between;
}

/* TOP STATUS BAR */
.os-statusbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(4, 12, 31, 0.85);
  border-bottom: 1px solid var(--os-panel-border);
  padding: 0 16px;
  height: 36px;
  font-family: var(--font-terminal);
  font-size: 0.75rem;
  letter-spacing: 0.5px;
  backdrop-filter: blur(8px);
  z-index: 100;
}

.sb-left, .sb-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.os-logo {
  color: var(--os-primary);
  font-weight: 700;
  text-shadow: 0 0 8px var(--os-primary-glow);
}

.sb-badge.secure {
  background: rgba(0, 230, 118, 0.15);
  border: 1px solid var(--os-success);
  color: var(--os-success);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: bold;
}

.sb-investigator {
  color: var(--os-warning);
  font-weight: 600;
}

.sb-divider {
  color: rgba(255,255,255,0.15);
}

/* DESKTOP AREA */
.os-desktop {
  flex-grow: 1;
  position: relative;
  display: flex;
  padding: 24px;
  gap: 24px;
  overflow: hidden;
  height: calc(100vh - 84px); /* statusbar + taskbar */
}

/* DESKTOP GRID */
.desktop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 110px));
  grid-auto-rows: minmax(110px, 110px);
  gap: 20px;
  flex-grow: 1;
  align-content: start;
}

.desktop-icon {
  background: transparent;
  border: 1px solid transparent;
  color: var(--os-fg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 8px;
  text-align: center;
  outline: none;
}

.desktop-icon .icon-wrapper {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  font-size: 2.2rem;
  margin-bottom: 4px;
  transition: all 0.25s ease;
  filter: drop-shadow(0 2px 5px rgba(0,0,0,0.8));
}

.desktop-icon .icon-wrapper svg {
  width: 28px;
  height: 28px;
  transition: transform 0.25s ease;
}

.desktop-icon .icon-label {
  font-size: 0.75rem;
  font-weight: 500;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8);
  max-width: 90px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.2px;
}

/* Hover effects */
.desktop-icon:hover {
  background: rgba(0, 136, 255, 0.1);
  border-color: rgba(0, 136, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
  transform: translateY(-2px);
}

.desktop-icon:hover .icon-wrapper {
  background: var(--os-primary);
  color: #fff;
  box-shadow: 0 0 15px var(--os-primary-glow);
  border-color: var(--os-primary);
}

.desktop-icon:hover .icon-wrapper svg {
  transform: scale(1.1);
}

.desktop-icon:active {
  transform: translateY(1px);
}

/* TERMINAL SIDEBAR WIDGET */
.desktop-terminal {
  width: 280px;
  background: rgba(2, 6, 17, 0.85);
  border: 1px solid var(--os-panel-border);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  height: 280px;
  font-family: var(--font-terminal);
  font-size: 0.7rem;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  backdrop-filter: blur(10px);
  position: absolute;
  bottom: 24px;
  right: 24px;
}

.terminal-header {
  background: rgba(6, 15, 34, 0.9);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-bottom: 1px solid var(--os-panel-border);
}

.terminal-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.terminal-dot.red { background: var(--os-danger); }
.terminal-dot.yellow { background: var(--os-warning); }
.terminal-dot.green { background: var(--os-success); }

.terminal-title {
  margin-left: 6px;
  color: #7a8b9e;
  font-weight: bold;
}

.terminal-body {
  padding: 12px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--os-success);
  overflow-y: auto;
}

.term-line {
  line-height: 1.3;
}

.animate-pulse-line {
  animation: terminal-pulse 1.5s infinite alternate;
}

@keyframes terminal-pulse {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

/* WINDOW SYSTEM */
.os-window {
  position: absolute;
  width: 700px;
  height: 480px;
  background: var(--os-panel);
  border: 1px solid var(--os-panel-border);
  border-radius: 12px;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.6), inset 0 0 20px rgba(0, 136, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  backdrop-filter: blur(16px);
  z-index: 500;
  animation: window-appear 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}

@keyframes window-appear {
  from { transform: translate(-50%, -46%) scale(0.95); opacity: 0; }
  to { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.window-header {
  background: rgba(5, 14, 33, 0.9);
  padding: 10px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--os-panel-border);
}

.window-title-group {
  display: flex;
  align-items: center;
  gap: 8px;
}

.window-icon {
  font-size: 1rem;
}

.window-title {
  font-size: 0.8rem;
  font-weight: 700;
  font-family: var(--font-terminal);
  letter-spacing: 0.5px;
  color: var(--os-fg);
  text-transform: uppercase;
}

.window-controls {
  display: flex;
  gap: 8px;
}

.win-btn {
  background: transparent;
  border: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 8px;
  color: transparent;
  transition: all 0.2s ease;
}

.win-btn.close { background-color: var(--os-danger); }
.win-btn.minimize { background-color: var(--os-warning); }
.win-btn.maximize { background-color: var(--os-success); }

.window-header:hover .win-btn {
  color: rgba(0,0,0,0.6);
}

.window-body {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* APP SPECIFIC VIEWS LAYOUTS */
/* Application layouts: Split Sidebar / Content is standard */
.app-split-container {
  display: flex;
  height: 100%;
  gap: 16px;
  margin: -20px; /* offset padding */
}

.app-sidebar {
  width: 220px;
  border-right: 1px solid var(--os-panel-border);
  background: rgba(3, 10, 26, 0.5);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.app-content {
  flex-grow: 1;
  padding: 20px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Sidebar List Item */
.sidebar-list-item {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(0, 136, 255, 0.1);
  padding: 12px 16px;
  text-align: left;
  color: var(--os-fg);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.2s ease;
}

.sidebar-list-item:hover {
  background: var(--os-panel-hover);
}

.sidebar-list-item.active {
  background: rgba(0, 136, 255, 0.18);
  border-left: 3px solid var(--os-primary);
}

.item-main-text {
  font-weight: 600;
  font-size: 0.8rem;
}

.item-sub-text {
  font-size: 0.7rem;
  color: #7a8b9e;
}

/* CHAT APP */
.chat-window {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.chat-messages {
  flex-grow: 1;
  overflow-y: auto;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(2, 6, 17, 0.4);
  border-radius: 8px;
  border: 1px solid rgba(0, 136, 255, 0.15);
  margin-bottom: 10px;
  max-height: 300px;
}
.chat-bubble {
  max-width: 75%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-word;
}
.chat-bubble.in {
  background: rgba(255, 255, 255, 0.07);
  align-self: flex-start;
  border-bottom-left-radius: 2px;
  border: 1px solid rgba(255,255,255,0.05);
}
.chat-bubble.out {
  background: rgba(0, 136, 255, 0.18);
  align-self: flex-end;
  border-bottom-right-radius: 2px;
  border: 1px solid rgba(0, 136, 255, 0.2);
}
.bubble-meta {
  font-size: 0.65rem;
  color: #7a8b9e;
  margin-top: 4px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

/* IMAGES APP */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 130px));
  gap: 16px;
  justify-content: center;
}
.gallery-item {
  background: rgba(3, 10, 26, 0.5);
  border: 1px solid var(--os-panel-border);
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.gallery-item:hover {
  transform: translateY(-3px);
  border-color: var(--os-primary);
  box-shadow: 0 4px 10px rgba(0, 136, 255, 0.15);
}
.gallery-img-container {
  width: 100%;
  height: 100px;
  background: #060e20;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.gallery-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery-img-container .img-placeholder {
  font-size: 2rem;
}
.gallery-label {
  font-size: 0.7rem;
  padding: 6px;
  width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gallery-detail-view {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.gallery-detail-img-wrapper {
  max-width: 100%;
  max-height: 250px;
  border: 2px solid var(--os-panel-border);
  border-radius: 8px;
  overflow: hidden;
}
.gallery-detail-img-wrapper img {
  max-width: 100%;
  max-height: 250px;
  display: block;
}
.gallery-back-btn {
  background: rgba(0, 136, 255, 0.15);
  border: 1px solid var(--os-primary);
  color: var(--os-fg);
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all 0.2s ease;
  margin-top: 10px;
}
.gallery-back-btn:hover {
  background: var(--os-primary);
}

/* CCTV VIDEOS APP */
.cctv-app-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}
.cctv-screen {
  background: #000;
  border: 2px solid #222;
  height: 220px;
  border-radius: 8px;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: inset 0 0 30px rgba(0,255,0,0.15);
}
.cctv-screen::before {
  content: '';
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 255, 0, 0.05) 50%);
  background-size: 100% 4px;
  z-index: 5;
  pointer-events: none;
}
.cctv-hud {
  position: absolute;
  top: 10px; left: 10px;
  font-family: var(--font-terminal);
  font-size: 0.75rem;
  color: var(--os-success);
  z-index: 10;
  text-shadow: 0 0 5px var(--os-success);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cctv-indicator-rec {
  position: absolute;
  top: 10px; right: 10px;
  color: var(--os-danger);
  font-weight: bold;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 4px;
  z-index: 10;
}
.cctv-rec-dot {
  width: 8px; height: 8px;
  background-color: var(--os-danger);
  border-radius: 50%;
}
.cctv-screen-feed {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #333;
}
.cctv-static {
  opacity: 0.05;
  background-image: radial-gradient(rgba(255,255,255,0.15) 1px, transparent 0);
  background-size: 4px 4px;
}
.cctv-figure {
  position: absolute;
  transition: all 0.5s ease;
}
.cctv-controls-container {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(3,10,26,0.6);
  padding: 12px;
  border-radius: 6px;
  border: 1px solid var(--os-panel-border);
}
.cctv-slider {
  width: 100%;
  accent-color: var(--os-primary);
  cursor: pointer;
}
.cctv-desc {
  font-size: 0.8rem;
  color: var(--os-warning);
  min-height: 40px;
}

/* MUSIC AUDIO APP */
.audio-app-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
}
.audio-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(3,10,26,0.5);
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid var(--os-panel-border);
}
.audio-play-btn {
  background: var(--os-primary);
  border: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  font-size: 1.2rem;
  box-shadow: 0 0 10px var(--os-primary-glow);
}
.audio-play-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 0 15px var(--os-primary);
}
.audio-play-btn.playing {
  background: var(--os-danger);
  box-shadow: 0 0 10px rgba(255,23,68,0.5);
}
.audio-waveform-container {
  flex-grow: 1;
  background: #030a1c;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(0, 136, 255, 0.15);
  display: flex;
  align-items: center;
  padding: 0 10px;
}
.audio-waveform-canvas {
  width: 100%;
  height: 45px;
  background: transparent;
}
.audio-transcript-container {
  background: rgba(2, 6, 17, 0.8);
  border: 1px solid var(--os-panel-border);
  padding: 16px;
  border-radius: 8px;
  flex-grow: 1;
  overflow-y: auto;
  font-family: var(--font-terminal);
  font-size: 0.78rem;
  line-height: 1.4;
  white-space: pre-line;
  color: #a9b7c6;
}

/* EMAILS / INFORME APP DETAILS styling */
.doc-title {
  color: var(--os-warning);
  font-size: 1.1rem;
  border-bottom: 2px solid rgba(255, 179, 0, 0.3);
  padding-bottom: 8px;
  margin-bottom: 12px;
  font-family: var(--font-terminal);
}
.doc-meta {
  font-size: 0.75rem;
  color: #7a8b9e;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: rgba(255,255,255,0.02);
  padding: 8px 12px;
  border-radius: 4px;
}
.doc-body {
  font-size: 0.85rem;
  line-height: 1.5;
}
.doc-body ul {
  padding-left: 20px;
  margin: 10px 0;
}
.doc-body li {
  margin-bottom: 6px;
}

/* BOTTOM TASKBAR */
.os-taskbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(4, 12, 31, 0.95);
  border-top: 1px solid var(--os-panel-border);
  padding: 0 16px;
  height: 48px;
  backdrop-filter: blur(10px);
  z-index: 100;
}

.tb-btn {
  background: rgba(0, 136, 255, 0.1);
  border: 1px solid var(--os-panel-border);
  color: var(--os-fg);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.8rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s ease;
  text-decoration: none;
}

.tb-btn:hover {
  background: rgba(0, 136, 255, 0.2);
  border-color: var(--os-primary);
  color: #fff;
  box-shadow: 0 0 10px var(--os-primary-glow);
}

.tb-btn.back-btn {
  background: rgba(255, 23, 68, 0.08);
  border-color: rgba(255, 23, 68, 0.3);
}
.tb-btn.back-btn:hover {
  background: var(--os-danger);
  border-color: var(--os-danger);
  box-shadow: 0 0 10px rgba(255,23,68,0.4);
}

.taskbar-quick {
  display: flex;
  gap: 8px;
}

.tb-quick-btn {
  background: transparent;
  border: 1px solid transparent;
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.tb-quick-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255,255,255,0.1);
}

.tb-quick-btn.active-indicator::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  background-color: var(--os-primary);
  border-radius: 50%;
  box-shadow: 0 0 4px var(--os-primary);
  display: none;
}

.tb-quick-btn.opened::after {
  display: block;
}

.system-status {
  font-family: var(--font-terminal);
  font-size: 0.7rem;
  color: var(--os-success);
  letter-spacing: 0.5px;
}

.status-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-left: 8px;
}

.status-indicator.online {
  background-color: var(--os-success);
  box-shadow: 0 0 8px var(--os-success);
}

.animate-pulse {
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0% { box-shadow: 0 0 4px rgba(0, 230, 118, 0.4); }
  50% { box-shadow: 0 0 12px rgba(0, 230, 118, 0.8); }
  100% { box-shadow: 0 0 4px rgba(0, 230, 118, 0.4); }
}

/* Custom Scrollbar for windows */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(2, 6, 17, 0.3);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 136, 255, 0.25);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 136, 255, 0.5);
}

/* Scanning blink animation for image explorer */
.scanning-blink {
  animation: scan-blink 1.2s infinite alternate;
}
@keyframes scan-blink {
  from { opacity: 0.35; color: #7a8b9e; }
  to { opacity: 1; color: var(--os-primary); }
}

/* ── MUSIC PLAYER (REPRODUCTOR OST) ── */
.player-disc.spinning {
  animation: disc-spin 4s linear infinite;
}
@keyframes disc-spin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

.ost-playlist-item {
  width: 100%;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(0, 136, 255, 0.1);
  border-radius: 6px;
  padding: 8px 12px;
  text-align: left;
  color: var(--os-fg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transition: all 0.2s ease;
  font-family: var(--font-os);
}

.ost-playlist-item:hover {
  background: rgba(0, 136, 255, 0.12);
  border-color: rgba(0, 136, 255, 0.3);
  transform: translateX(2px);
}

.ost-playlist-item.active {
  background: rgba(0, 136, 255, 0.20);
  border-color: var(--os-primary);
  box-shadow: 0 0 8px rgba(0, 136, 255, 0.2);
}

.ost-playlist-item .track-index {
  font-family: var(--font-terminal);
  font-size: 0.75rem;
  color: var(--os-primary);
  font-weight: bold;
}

.ost-playlist-item .track-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ost-playlist-item .track-name {
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ost-playlist-item .track-duration {
  font-size: 0.65rem;
  color: #7a8b9e;
  font-family: var(--font-terminal);
}

.audio-control-btn:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #fff !important;
}

.music-tab-btn:hover {
  color: var(--os-fg) !important;
}

.equalizer-bar {
  width: 4px;
  background: linear-gradient(to top, var(--os-primary), var(--os-success));
  border-radius: 2px 2px 0 0;
  transition: height 0.1s ease;
  min-height: 2px;
}


