/* Global page styling */
body {
  margin: 0;
  padding: 0;
  background-color: white;
}

/* Top application header */
.header {
  background-color: #85d1ec;
  color: white;
  padding: 25px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 45px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Header title */
.header h1 {
  margin: 0;
  font-size: 2.5em;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
  letter-spacing: 1px;
  font-family: "Archivo";
  font-optical-sizing: auto;
  font-style: normal;
}

/* Container for header buttons */
.buttons-container {
  display: flex;
  gap: 15px;
  align-items: center;
}

/* Editor toggle button */
#toggleEditorButton {
  background-color: #FFB347;
  color: white;
  border: 1.5px solid white;
  padding: 14px 16px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Toggle button hover effect */
#toggleEditorButton:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* Download button styling */
#saveWorkspaceButton {
  background-color: #89f0a8; /* Lila Pastel de tu tema */
  color: white;
  border: 1.5px solid white;
  padding: 14px 16px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Download button hover effect */
#saveWorkspaceButton:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  background-color: #BA85E6;
}

/* Download button styling */
#loadWorkspaceButton {
  background-color: #D4A5FF; /* Lila Pastel de tu tema */
  color: white;
  border: 1.5px solid white;
  padding: 14px 16px;
  border-radius: 15px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Download button hover effect */
#loadWorkspaceButton:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  background-color: #BA85E6;
}

#toggleEditorButton {
  border: 1.5px solid white;
  border-radius: 15px;
  padding: 14px 16px;
}

/* Icon used inside buttons */
.button-icon {
  width: 20px;
  height: 20px;
  filter: brightness(0) invert(1);
}

/* Run button */
#runButton {
  background-color: #FF9BB3;
  color: white;
  border: 1.5px solid white;
  padding: 14px 25px 14px 25px;
  border-radius: 15px;
  cursor: pointer;
  font-size: 1.3em;
  font-family: "Archivo";
  font-optical-sizing: auto;
  font-weight: 500;
  font-style: normal;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Run button hover effect */
#runButton:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

/* Play icon used inside the Run button */
.play-icon {
  width: 0;
  height: 0;
  border-top: 10px solid transparent;
  border-left: 16px solid white;
  border-bottom: 10px solid transparent;
}

/* Blockly editor container */
#blocklyDiv {
  position: absolute;
  top: 95px;
  left: 20px;
  right: 20px;
  bottom: 0;
  background-color: white;
  margin: 15px;
  border-radius: 20px;
}

/* Blockly toolbox styling */
.blocklyToolboxDiv {
  border-right: 1px solid #E0E0E0;
  background-color: #f9f9f9;
}

/* Generic close button */
.close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
}

/* Close button hover state */
.close-button:hover {
  color: #333;
}

/* Code output display area */
.code-display {
  background-color: #282c34;
  color: #abb2bf;
  padding: 15px;
  border-radius: 5px;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  overflow-x: auto;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
}

/* Spinner animation */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Disabled button state */
button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Shared editor container styling */
.editor-container {
  position: absolute;
  top: 95px;
  left: 20px;
  right: 20px;
  bottom: 0;
  background-color: white;
  margin: 15px;
  border-radius: 20px;
  overflow: hidden;
}

/* Code editor container */
#codeEditorDiv {
  border: 1px solid #e0e0e0;
}

/* Indicator showing the active editor mode */
.editor-indicator {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 0.8em;
  z-index: 100;
}

/* Code editor action buttons container */
.code-editor-actions {
  position: absolute;
  top: 10px;
  right: 120px;
  z-index: 100;
  display: flex;
  gap: 10px;
}

/* Individual code editor action button */
.code-editor-button {
  background: #85d1ec;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 0.9em;
  transition: background 0.3s;
}

/* Code editor button hover state */
.code-editor-button:hover {
  background: #6bb9f0;
}

/* Responsive layout adjustments */
@media (max-width: 768px) {
  .editor-container {
    left: 10px;
    right: 10px;
    margin: 10px;
  }
}
