* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: Arial, Helvetica, sans-serif;
}

body {
  background: #fff;
  color: #111;
  padding: 20px 20px 60px 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  position: relative;
}

/* Layout Principal de 2 Columnas Centrado */
.container {
  width: 100%;
  max-width: 1080px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.app-wrapper {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 50px;
}

/* Panel Izquierdo */
.left-panel {
  flex: 1;
  max-width: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.header-title {
  text-align: left;
}

h1 {
  font-family: 'Finger Paint', cursive, sans-serif;
  font-size: 65px;
  font-weight: 400;
  line-height: 1.1;
  margin-bottom: 8px;

  /* Degradado de tonos caoba y madera natural */
  background: linear-gradient(180deg, #a45a2a 0%, #6d3517 50%, #4a210d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;

  /* Sombra para dar efecto de volumen/tallado */
  filter: drop-shadow(1px 2px 1px rgba(0, 0, 0, 0.25));
  
  /* Permite ver la sombra correctamente con el clip de texto */
  display: inline-block;
}

p {
  font-size: 15px;
  color: #555;
  line-height: 1.4;
}

.allowed-formats {
  display: block;
  margin-top: 14px;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #666;
}

/* Panel Derecho */
.right-panel {
  flex: 1.2;
  max-width: 480px;
  width: 100%;
  display: flex;
  flex-direction: column;
}

/* System Tabs UI */
.tabs-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.tab-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #f0f0f0;
  border: 1px solid #ccc;
  border-radius: 6px 6px 0 0;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: bold;
  color: #555;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.tab-btn.active {
  background: #fff;
  border-bottom-color: #fff;
  color: #111;
}

.tab-close {
  font-size: 12px;
  border-radius: 50%;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #888;
}

.tab-close:hover {
  background: #e0e0e0;
  color: #111;
}

.btn-add-tab {
  background: #eee;
  border: 1px dashed #aaa;
  border-radius: 6px;
  width: 26px;
  height: 26px;
  font-size: 15px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-add-tab:hover {
  background: #ddd;
}

/* Contenedor Compactado */
.box {
  border: 1px solid #ccc;
  border-radius: 0 0 8px 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: -1px;
  background: #fff;
}

/* Área Drag and Drop Compactada */
.drop-zone {
  border: 2px dashed #bbb;
  border-radius: 8px;
  padding: 14px 12px;
  text-align: center;
  background: #fafafa;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.drop-zone:hover, 
.drop-zone.dragover {
  background: #f0f0f0;
  border-color: #111;
}

.drop-zone p {
  font-size: 13px;
  color: #333;
}

/* Escenario del Gorila Compactado */
.crush-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 105px;
  position: relative;
  margin: 4px 0;
  overflow: hidden;
}

.gorilla {
  font-size: 48px;
  z-index: 2;
  transform: translateY(0);
  user-select: none;
  line-height: 1;
  margin-bottom: 2px;
}

.file-preview-container {
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  transform-origin: bottom center;
  transition: transform 0.2s ease;
}

.file-preview-container img, 
.file-preview-container canvas {
  max-height: 42px;
  max-width: 80px;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  border: 1px solid #ddd;
  background: #fff;
}

.file-icon {
  font-size: 32px;
  user-select: none;
  line-height: 1;
}

/* Animaciones de Golpeteo */
.smash-active .gorilla {
  animation: gorillaSmash 0.65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.smash-active .file-preview-container {
  animation: fileSmashFlat 0.65s cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

@keyframes gorillaSmash {
  0% { transform: translateY(0) scale(1) rotate(0deg); }
  30% { transform: translateY(-35px) scale(1.15, 0.9) rotate(-4deg); }
  45% { transform: translateY(2px) scale(0.85, 1.25) rotate(2deg); }
  60% { transform: translateY(-4px) scale(1.05, 0.95); }
  75%, 100% { transform: translateY(0) scale(1) rotate(0deg); }
}

@keyframes fileSmashFlat {
  0%, 35% { transform: scale(1, 1); opacity: 1; }
  45% { transform: scale(1.4, 0.15) translateY(8px); opacity: 0.8; }
  60% { transform: scale(0.9, 1.1) translateY(-2px); }
  75%, 100% { transform: scale(1, 1) translateY(0); opacity: 1; }
}

button, .btn-link {
  display: block;
  width: 100%;
  padding: 8px 10px;
  background: #111;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

button:hover, .btn-link:hover { background: #333; }
button:disabled { background: #ccc; cursor: not-allowed; }

.file-name {
  font-size: 12.5px;
  word-break: break-all;
  color: #222;
  text-align: center;
}

.output {
  font-size: 12.5px;
  line-height: 1.4;
  border-top: 1px solid #eee;
  padding-top: 8px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-weight: 700;
}

.status-badge.idle { color: #666; }
.status-badge.ready { color: #0275d8; }
.status-badge.processing { color: #f0ad4e; }
.status-badge.completed { color: #2e7d32; }
.status-badge.error { color: #d9534f; }

.metrics-table {
  width: 100%;
  margin-top: 6px;
  border-collapse: collapse;
  font-size: 12px;
}

.metrics-table td {
  padding: 4px 0;
  border-bottom: 1px dashed #eee;
  vertical-align: middle;
}

.metrics-table td:last-child {
  text-align: right;
  font-weight: bold;
}

.tooltip-container {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: help;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #eee;
  color: #444;
  font-size: 10px;
  font-weight: bold;
  margin-left: 4px;
}

.tooltip-container:hover .info-icon {
  background: #111;
  color: #fff;
}

.tooltip-text {
  visibility: hidden;
  opacity: 0;
  width: 210px;
  background-color: #222;
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 8px 10px;
  position: absolute;
  z-index: 10;
  bottom: 125%;
  right: 0;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.35;
  box-shadow: 0px 4px 10px rgba(0, 0, 0, 0.2);
  transition: opacity 0.2s ease, visibility 0.2s ease;
  pointer-events: none;
}

.tooltip-text::after {
  content: "";
  position: absolute;
  top: 100%;
  right: 12px;
  border-width: 5px;
  border-style: solid;
  border-color: #222 transparent transparent transparent;
}

.tooltip-container:hover .tooltip-text,
.tooltip-container:focus .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.hidden { display: none !important; }

/* Contenedor de preguntas al final del panel derecho */
.mode-switch-container {
  margin-top: 10px;
  padding: 10px 12px;
  background: #f8f9fa;
  border: 1px dashed #ccc;
  border-radius: 8px;
  text-align: center;
}

.switch-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.switch-option span {
  font-size: 12px;
  color: #555;
  line-height: 1.35;
}

.btn-mode-link {
  background: transparent;
  color: #a45a2a;
  border: none;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  text-decoration: underline;
  padding: 2px 4px;
  width: auto;
  display: inline;
}

.btn-mode-link:hover {
  background: transparent;
  color: #6d3517;
}

/* Sticky Footer Horizontal */
.sticky-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  background: #fff;
  border-top: 1px solid #eee;
  padding: 10px 16px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  color: #666;
  z-index: 100;
}

.sticky-footer span {
  white-space: nowrap;
}

.sticky-footer .dot-separator {
  color: #ccc;
}

#physicsCanvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 9999;
}

.tabs-guide-text {
  margin-top: 8px;
  font-size: 12.5px;
  color: #444;
  background: #f8f9fa;
  padding: 6px 10px;
  border-radius: 0 6px 6px 0;
  line-height: 1.4;
}

.footer-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: #111;
  text-decoration: underline;
}

/* Selector de idioma con estilo limpio y libre de marcos */
.lang-selector-container {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  padding: 0;
  border: none;
  box-shadow: none;
}

.lang-selector-container label {
  font-size: 0.8rem;
  color: #666;
  font-weight: 500;
  user-select: none;
}

.lang-select {
  background: transparent;
  color: #111;
  border: none;
  padding: 2px 4px;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: pointer;
  outline: none;
  transition: color 0.2s ease;
}

.lang-select:hover, 
.lang-select:focus {
  color: #a45a2a;
}

.lang-select option {
  background: #ffffff;
  color: #111111;
}

/* Ajustes responsivos */
@media (max-width: 600px) {
  .lang-selector-container {
    top: 12px;
    right: 12px;
  }

  .lang-selector-container label {
    display: none;
  }
}

@media (max-width: 860px) {
  body {
    align-items: flex-start;
    padding-top: 30px;
  }

  .app-wrapper {
    flex-direction: column;
    gap: 24px;
  }

  .left-panel {
    max-width: 100%;
    text-align: center;
  }

  .header-title {
    text-align: center;
  }

  .right-panel {
    max-width: 100%;
  }

  .tabs-guide-text {
    text-align: left;
    margin: 8px auto 0 auto;
    max-width: 480px;
  }
}
