:root {
  /* Colores UCB */
  --ucb-yellow: #FFCF00; /* Amarillo UCB */
  --ucb-blue: #004679;  /* Azul UCB */
  --ucb-dark-blue: #002D50; /* Azul más oscuro para texto principal */
  
  /* Paleta de Interfaz */
  --text-light: #ffffff; /* Blanco */
  --bg-primary: #F0F2F5; /* Gris muy claro para el fondo principal */
  --text-secondary: #5A6675; /* Gris para texto secundario */
}

/* Base */
* {
  box-sizing: border-box;
  transition: all 0.2s ease-in-out; /* Transiciones suaves para hover */
}

body {
  margin: 0;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--ucb-blue); /* Fondo principal de la aplicación */
  color: var(--ucb-dark-blue);
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  display: flex;
  flex: 1;
  height: 100vh;
  flex-direction: row;
  background-color: var(--bg-primary); /* Fondo del área de trabajo */
  padding: 10px;
}

/* Barra Lateral (Sidebar) */
.sidebar {
  background-color: var(--text-light); /* Fondo blanco */
  color: var(--ucb-dark-blue);
  padding: 1.5em;
  width: 300px; /* Un poco más ancha */
  min-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  border-radius: 8px; /* Bordes redondeados */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Sombra sutil */
  overflow-y: auto; /* Permite el scroll vertical */
}

.sidebar h2 {
  margin-top: 0;
  color: var(--ucb-blue); /* Títulos en azul */
  border-bottom: 2px solid var(--ucb-yellow);
  padding-bottom: 0.5em;
  margin-bottom: 1em;
}

.sidebar h3 {
  color: var(--text-secondary); /* Subtítulos en gris */
  margin-top: 1em;
  margin-bottom: 0.5em;
}

.sidebar hr {
  width: 100%;
  border: 0;
  height: 1px;
  background-color: var(--ucb-yellow);
  margin: 15px 0;
}

/* Botones */
.sidebar button {
  background-color: var(--ucb-yellow); /* Fondo amarillo */
  color: var(--ucb-blue); /* Texto azul */
  border: 1px solid var(--ucb-blue);
  padding: 10px 15px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 6px;
  text-align: left;
}

.sidebar button:hover {
  background-color: var(--ucb-blue); /* Invertir colores al pasar el ratón */
  color: var(--ucb-yellow);
  transform: translateY(-2px); /* Efecto 3D sutil */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar button:active {
  transform: translateY(0);
}

.sidebar button:disabled {
  background-color: #e0e0e0;
  color: #a0a0a0;
  border: 1px solid #c0c0c0;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Área del Canvas */
.canvas-area {
  flex-grow: 1;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: var(--bg-primary); /* Mantiene el fondo gris claro */
  padding: 1em;
}

.canvas-wrapper {
  width: 90vmin;
  height: 90vmin;
  max-width: 700px; /* Más espacio para el canvas */
  max-height: 700px;
  border-radius: 8px;
  overflow: hidden; /* Asegura que el canvas no se salga */
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

canvas {
  width: 100%;
  height: 100%;
  border: 4px solid var(--ucb-blue); /* Borde grueso en azul UCB */
  border-radius: 8px; /* Bordes redondeados para el canvas */
}

/* Adaptabilidad Móvil */
@media (max-width: 900px) { /* Aumentado el breakpoint para un mejor manejo en tabletas */
  .container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    min-width: auto;
    max-height: 30vh; /* Limitar la altura del sidebar en móvil */
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    border-radius: 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  }

  .sidebar button {
    flex-grow: 1; /* Los botones crecen para ocupar el espacio */
    margin: 5px;
    text-align: center;
  }
  
  .sidebar h2, .sidebar h3, .sidebar hr {
      width: 100%;
      text-align: center;
      margin-left: 0;
      margin-right: 0;
  }
  
  .canvas-area {
    padding: 0.5em;
  }
}