*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}

body{
  width:100vw;
  height:100vh;
  overflow:hidden;
  font-family:Tahoma,sans-serif;
  background:#dbe4ee;
  position: relative;
}

/* WALLPAPER */
.wallpaper{
  position:fixed;
  width:100%;
  height:100%;
  background:
  linear-gradient(
    rgba(255,255,255,0.25),
    rgba(255,255,255,0.25)
  ),
  url("img/wallpaper1.jpg");
  background-size:cover;
  background-position:center;
  filter:brightness(1.1);
}

/* CRT */
.crt{
  position:fixed;
  width:100%;
  height:100%;
  pointer-events:none;
  background:
  repeating-linear-gradient(
    to bottom,
    rgba(255,255,255,0.03),
    rgba(255,255,255,0.03) 1px,
    transparent 1px,
    transparent 2px
  );
  z-index:100;
}

/* CLASE DE MANEJO DE ARRASTRE DE VENTANAS */
.draggable-window {
  position: absolute;
}

.drag-handle {
  cursor: move; /* Cambia el puntero al pasar por la barra superior */
}

/* TITLE BAR */
.title-bar{
  height:35px;
  background: linear-gradient(to right, #4c87c7, #8cb8e8);
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 10px;
  color:white;
  font-weight:bold;
  user-select: none;
}

.title-right{
  display:flex;
  gap:5px;
}

.window-btn{
  width:24px;
  height:24px;
  border:none;
  background:#f3f3f3;
  cursor:pointer;
  font-weight:bold;
}

.close-btn{
  background:#d66;
  color:white;
}

/* CONTENT */
.window-content{
  display:flex;
  flex-wrap:wrap;
  gap:40px;
  padding:40px;
}

/* DESKTOP ITEMS */
.desktop-item{
  width:100px;
  text-align:center;
  text-decoration:none;
  color:black;
  cursor:pointer;
  padding:10px;
  border:1px solid transparent;
}

.desktop-item:hover{
  background:rgba(255,255,255,0.5);
  border:1px solid #8eb6e8;
}

.desktop-item img{
  width:56px;
  margin-bottom:10px;
}

.desktop-item p{
  font-size:13px;
  word-break:break-word;
}

/* =================================================== */
/* VENTANA DE IMÁGENES FLOTANTE (IMAGE VIEWER) */
/* =================================================== */
.image-viewer-window {
  width: 320px;
  background: #f3f3f3;
  border-radius: 6px;
  overflow: hidden;
  border-top: 2px solid white;
  border-left: 2px solid white;
  border-right: 2px solid #8f8f8f;
  border-bottom: 2px solid #8f8f8f;
  box-shadow: 5px 5px 20px rgba(0,0,0,0.3);
  z-index: 50;
  top: 15%;
  left: 65%;
}

.image-viewer-content {
  padding: 8px;
  background: #eef2f7;
  display: flex;
  justify-content: center;
  align-items: center;
}

.image-viewer-content img {
  max-width: 100%;
  height: auto;
  border: 1px solid #9cb6d6;
}

/* BOTÓN VER CAPTURA */
.view-img-btn {
  display: block;
  margin-top: 10px;
  background: #fff;
  border: 1px solid #4c87c7;
  color: #4c87c7;
  padding: 3px 8px;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 3px;
}

.view-img-btn:hover {
  background: #bcd5f1;
}

/* TASKBAR */
.taskbar{
  position:fixed;
  bottom:0;
  width:100%;
  height:42px;
  background:#ececec;
  border-top:2px solid white;
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding:0 10px;
  z-index:20;
}

.taskbar-left{
  display:flex;
  align-items:center;
  gap:8px;
}

.start-button{
  background:#4c87c7;
  color:white;
  padding:5px 14px;
  font-weight:bold;
  border-radius:3px;
  cursor:pointer;
}

.task-item{
  background:#dcdcdc;
  padding:5px 12px;
  border-top:1px solid white;
  border-left:1px solid white;
  border-right:1px solid #8f8f8f;
  border-bottom:1px solid #8f8f8f;
  font-size:13px;
  cursor:pointer;
}

.active-tab{
  background:#bcd5f1;
}

.taskbar-right{
  display:flex;
  align-items:center;
  gap:15px;
  color:black;
  font-size:14px;
}

.tray-icon{
  font-size:15px;
  cursor:pointer;
}

.system-text{
  color:#555;
  font-size:12px;
}

/* TRANSICION WEB */
.browser-transition{
  position:fixed;
  top:50%;
  left:50%;
  width:200px;
  height:120px;
  transform:translate(-50%,-50%) scale(0.1);
  background:white;
  z-index:500;
  opacity:0;
  transition: transform 1s cubic-bezier(.2,.8,.2,1), opacity 0.5s;
  border-radius:10px;
  overflow:hidden;
}

.browser-transition.active{
  width:82vw;
  height:78vh;
  transform: translate(-50%,-50%) scale(1);
  opacity:1;
  box-shadow:0 0 40px rgba(0,0,0,0.4);
}

.browser-topbar{
  width:100%;
  height:40px;
  background: linear-gradient(to right, #4c87c7, #8cb8e8);
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 10px;
  gap:15px;
  color:white;
  font-size:13px;
  font-weight:bold;
}

.fake-url{
  flex:1;
  background:white;
  border:1px solid #bbb;
  padding:5px 10px;
  color:#666;
  font-size:12px;
  overflow:hidden;
}

.browser-window-buttons{
  display:flex;
  gap:4px;
}

.browser-window-buttons button{
  width:24px;
  height:22px;
  border:none;
  cursor:pointer;
  background:#ececec;
  font-weight:bold;
}

.browser-window-buttons button:last-child{
  background:#d66;
  color:white;
}

/* APAGAR POPUP */
.shutdown-popup{
  position:fixed;
  width:100%;
  height:100%;
  background:rgba(0,0,0,0.35);
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:50;
}

.shutdown-box{
  width:400px;
  background:#f3f3f3;
  padding:30px;
  border-top:2px solid white;
  border-left:2px solid white;
  border-right:2px solid #8f8f8f;
  border-bottom:2px solid #8f8f8f;
  text-align:center;
}

.shutdown-box h2{ margin-bottom:10px; }
.shutdown-box p{ margin-bottom:25px; }

.shutdown-buttons{
  display:flex;
  justify-content:center;
  gap:15px;
}

.shutdown-buttons button{
  padding:10px 18px;
  border:none;
  cursor:pointer;
  background:#4c87c7;
  color:white;
  font-weight:bold;
}

/* BLACK SCREEN */
.black-screen{
  position:fixed;
  width:100%;
  height:100%;
  background:black;
  color:#cfcfcf;
  display:flex;
  justify-content:center;
  align-items:center;
  font-size:30px;
  z-index:200;
}

.hidden{ display:none; }


.desktop-system-item:hover{
  background:rgba(255,255,255,0.2);
  border:1px solid rgba(255,255,255,0.5);
  backdrop-filter:blur(4px);
}

/* MODIFICADO: Agregamos límite elástico para notebooks/pantallas chicas en PC */
.main-window {
  position: absolute;
  width: 85%;
  max-width: calc(100% - 150px); /* Evita pisar los íconos del sistema a la derecha */
  height: 80%;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  background:#f3f3f3;
  border-radius:10px;
  overflow:hidden;
  border-top:2px solid white;
  border-left:2px solid white;
  border-right:2px solid #8f8f8f;
  border-bottom:2px solid #8f8f8f;
  box-shadow:10px 10px 30px rgba(0,0,0,0.25);
  z-index:5;
}

/* MODIFICADO: Íconos del escritorio elásticos para PC */
.desktop-system-icons {
  position: fixed;
  top: 30px;
  right: 2vw;          /* Margen proporcional al ancho de pantalla */
  width: 10vw;         /* Ancho elástico */
  max-width: 90px;     /* Límite máximo para pantallas grandes */
  display: flex;
  flex-direction: column;
  gap: 25px;
  z-index: 10;
}

.desktop-system-item {
  width: 100%;
  text-align: center;
  cursor: pointer;
  padding: 10px;
  border: 1px solid transparent;
  color: white;
  transition: 0.2s;
}

.desktop-system-item img {
  width: 100%;
  max-width: 52px;     /* Mantiene el tamaño original pero puede encogerse */
  height: auto;
  margin-bottom: 8px;
}

.desktop-system-item p {
  font-size: clamp(10px, 1.2vw, 13px); /* La letra se achica sutilmente si es necesario */
  text-shadow:1px 1px 3px black;
}

/* PANELES DE ANÁLISIS */
.analysis-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  padding: 15px;
  height: calc(100% - 35px);
  overflow-y: auto;
  background: #eef2f7;
}

.theory-box {
  background: #fdfdfd;
  border: 1px solid #9cb6d6;
  border-radius: 4px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.theory-box.full-width {
  grid-column: span 2;
}

.box-header {
  background: #cbdcf2;
  color: #2b4e75;
  font-size: 11px;
  font-weight: bold;
  padding: 5px 8px;
  border-bottom: 1px solid #9cb6d6;
  letter-spacing: 0.5px;
}

.box-body {
  padding: 12px;
  font-size: 12px;
  line-height: 1.4;
  flex: 1;
}

.theory-intro {
  color: #555;
  font-size: 11px;
  margin-bottom: 10px;
  font-style: italic;
  border-left: 2px solid #4c87c7;
  padding-left: 6px;
}

/* INTERFAZ PESTAÑAS */
.theory-tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid #bbb;
}

.tab-btn {
  padding: 4px 10px;
  font-size: 11px;
  background: #e1e1e1;
  border: 1px solid #bbb;
  border-bottom: none;
  cursor: pointer;
}

.tab-btn.active {
  background: #fff;
  font-weight: bold;
  border-color: #4c87c7 #bbb transparent #bbb;
  border-top: 2px solid #4c87c7;
  padding-bottom: 5px;
}

.tab-display {
  padding-top: 10px;
  min-height: 70px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* INTERFAZ COMANDOS */
.mano-split { display: flex; gap: 10px; }
.mano-menu { display: flex; flex-direction: column; gap: 4px; }

.mano-btn {
  background: #4c87c7;
  color: white;
  border: 1px solid #2b4e75;
  padding: 4px 8px;
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}

.mano-btn:hover { background: #8cb8e8; }

.mano-output {
  flex: 1;
  background: #fafafa;
  border: 1px dashed #4c87c7;
  padding: 8px;
  font-size: 11.5px;
  min-height: 65px;
}

/* WIZARD */
.wizard-box { background: #f3f3f3; }
.wizard-flex { display: flex; gap: 20px; margin-top: 5px; }
.wizard-radios { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; }
.wizard-radios label { cursor: pointer; }
.wizard-content-box { flex: 1; background: white; border: 1px solid #b0b0b0; padding: 10px; min-height: 60px; }
.wizard-actions { display: flex; justify-content: flex-end; margin-top: 10px; }

.win-btn-classic {
  background: #4c87c7;
  color: white;
  padding: 5px 15px;
  font-weight: bold;
  font-size: 12px;
  border: 1px solid #2b4e75;
  cursor: pointer;
}

.win-btn-classic:hover { background: #366da8; }

@media(max-width: 680px) {
  .analysis-container { grid-template-columns: 1fr; }
  .theory-box.full-width { grid-column: span 1; }
  .wizard-flex { flex-direction: column; }
}


/* ==========================================================================
   ADAPTACIÓN PARA CELULARES Y BLINDAJE RESPONSIVE (PANTALLAS < 768px)
   ========================================================================== */
@media (max-width: 768px) {
  
  /* 1. SISTEMA DE ÍCONOS DE ESCRITORIO */
  .desktop-system-icons {
    top: 12px;
    right: auto;
    left: 12px;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    width: calc(100% - 24px);
    max-width: none;
  }

  .desktop-system-item {
    width: 72px;
    padding: 4px;
  }

  .desktop-system-item img {
    width: 32px;
    max-width: none;
  }

  .desktop-system-item p {
    font-size: 10px;
  }

  /* 2. ÍCONOS CARPETA RAÍZ */
  .window-content {
    padding: 10px;
    gap: 5px;
    justify-content: space-between;
    align-content: flex-start;
  }

  .window-content .desktop-item {
    width: 68px;
    padding: 4px 2px;
  }

  .window-content .desktop-item img {
    width: 32px;
    margin-bottom: 4px;
  }

  .window-content .desktop-item p {
    font-size: 10px;
    line-height: 1.1;
  }

  /* 3. VENTANA PRINCIPAL (OBLIGATORIA PARA EL SCROLL) */
/* 3. VENTANA PRINCIPAL (Forzada al máximo ancho real del celular) */
  .main-window {
    position: fixed !important; 
    width: 90% !important;        /* Ocupa casi la totalidad de la pantalla útil */
    max-width: 100% !important;   /* Rompe el candado del calc() que traía de la PC */
    height: 72% !important;     
    top: 48% !important;        
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    border-radius: 4px !important;
    overflow: hidden !important; 
    box-shadow: 0px 4px 20px rgba(0,0,0,0.4) !important;
  }

  /* CONTENEDOR DE ANÁLISIS (Para que las cajas internas usen todo el espacio nuevo) */
  .analysis-container {
    display: block !important;    
    width: 100% !important;       /* Fuerza a que las cajas adentro no se achiquen */
    padding: 8px !important;                
    height: calc(100% - 35px) !important; 
    overflow-y: scroll !important;       
    -webkit-overflow-scrolling: touch !important; 
  }
  /* Achica el texto del título de la ventana en el celular */
  .title-left {
    font-size: 11px !important;    /* Bajamos el tamaño para que entre cómodo */
    white-space: nowrap;          /* Evita que el texto se rompa en dos renglones */
    overflow: hidden;             /* Si el celular es mini, corta lo que sobre elegantemente */
    text-overflow: ellipsis;      /* Agrega los tres puntitos (...) si no llega a entrar */
    max-width: 70vw;              /* Le da un límite para que no pase por encima de los botones de cerrar */
  }

  /* Forzamos a que cada bloque de teoría use el 100% del ancho de la ventana */
  .theory-box {
    width: 100% !important;
    max-width: 100% !important;
    margin-bottom: 15px !important;
    display: flex !important;
    flex-direction: column !important;
  }

  .box-body {
    padding: 10px;
    font-size: 12px;
  }

  /* 4. ELEMENTOS INTERNOS DE TEORÍA */
  /* Split de Manovich */
  .mano-split {
    flex-direction: column;
    gap: 8px;
  }

  .mano-menu {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .mano-btn {
    flex: 1;
    min-width: 120px;
    font-size: 10px;
    padding: 5px;
  }

  /* Conclusión Wizard */
  .wizard-flex {
    flex-direction: column;
    gap: 10px;
  }

  .wizard-radios {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 10px;
  }

  /* Mini scrolls para las subcajas de texto */
  .tab-display {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 5px;
  }

  .mano-output {
    max-height: 160px;
    overflow-y: auto;
  }

  /* 5. VISOR DE IMÁGENES FLOTANTE */
  .image-viewer-window {
    width: 88vw;
    left: 6vw !important;
    top: 25% !important;
    position: fixed;
  }

  /* 6. TASKBAR (BARRA DE TAREAS) */
  .taskbar {
    height: auto;
    min-height: 42px;
    flex-direction: column;
    padding: 4px;
    gap: 4px;
  }

  .taskbar-left, .taskbar-right {
    width: 100%;
    justify-content: center;
    gap: 8px;
  }

  .system-text, .tray-icon:nth-child(3) { 
    display: none;
  }

  .taskbar-right {
    font-size: 11px;
  }

  /* 7. POPUP APAGADO */
  .shutdown-box {
    width: 88%;
    padding: 20px;
  }

  .shutdown-buttons {
    flex-direction: column;
    gap: 8px;
  }

  .shutdown-buttons button {
    width: 100%;
    padding: 10px;
  }

  /* 8. DESBLOQUEO DE COMPORTAMIENTO TOUCH */
  .drag-handle {
    cursor: default !important;
    touch-action: none !important; /* Desactiva gestos raros en la barra azul */
  }
}