/* styles.css */
:root {
  --primary-color: #007acc;
  --success-color: #4CAF50;
  --error-color: #f44336;
  --warning-color: #ff9800;
  --dark-bg: #1e1e1e;
  --header-bg: #252526;
  --toolbar-bg: #2d2d2d;
  --border-color: #333;
  --text-color: #d4d4d4;
  --text-muted: #858585;
  --status-online: #4CAF50;
  --status-offline: #f44336;
}

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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--dark-bg);
  color: var(--text-color);
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  line-height: 1.5;
}

h1 {
  font-size: 1.8rem;
  font-weight: 600;
  color: white;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  width: 100vw;
}

#header {
  padding: 1rem;
  background: var(--header-bg);
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

#header.min-toolbar {
  height: 60px;
  overflow: hidden;
  padding: 0.5rem 1rem;
}

#header.min-toolbar h1 {
  font-size: 1.2rem;
}

#header.min-toolbar #toolbar {
  display: none;
}

#toolbar {
  background: var(--toolbar-bg);
  padding: 0.8rem;
  display: flex;
  align-items: center;
  margin-top: 0.8rem;
  flex-wrap: wrap;
  gap: 0.8rem;
  border-radius: 4px;
}

select, button, input {
  padding: 0.5rem 0.8rem;
  background: #333;
  color: white;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.9rem;
  outline: none;
}

button {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
}

button:hover {
  background: #444;
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.7;
  background: #333 !important;
  color: white !important;
  transform: none !important;
}

select {
  min-width: 180px;
  cursor: pointer;
}

input {
  background: #2b2b2b;
  color: white;
  padding: 0.5rem 0.8rem;
  min-width: 120px;
}

input:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 122, 204, 0.3);
}

#editor-container {
  flex: 1;
  position: relative;
  min-height: 300px;
  background: #1e1e1e;
}

#monaco-editor {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  overflow: hidden;
}

.status-bar {
  padding: 0 10px 10px 0;
  background: var(--success-color);
  font-size: 0.8rem;
  font-weight: 500;
  display: flex;
  justify-content: space-between;
}

.status-bar.offline {
  background: var(--error-color);
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.9);
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 4px;
  z-index: 1000;
  display: none;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transition: opacity 300ms ease;
}

.toast.error {
  background: var(--error-color);
}

#icon {
  height: 40px;
  width: 40px;
  object-fit: contain;
}

.save-status {
  position: fixed;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 122, 204, 0.9);
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 4px;
  font-size: 0.8rem;
  display: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.min-toolbar-btn {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1rem;
  font-size: 1rem;
  font-weight: bold;
  background: linear-gradient(135deg, #ff8a00, #e52e71);
  color: white;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  border: none;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.min-toolbar-btn:hover {
  background: linear-gradient(135deg, #e52e71, #ff8a00);
}

.min-toolbar-btn i {
  font-size: 1.2rem;
}

/* Estilos para botones especiales */
#load-types-btn {
  background: #94FF94;
  color: black;
  
}

#load-types-btn:hover {
  background: #49AC50;
  color: white;
}

#copy-btn {
	background: #1565C0;
	color: #FFFFFF;
}

#copy-btn:hover {
	background: #0b7dda;
}

#download-btn {
	background: #673ab7;
	color: #F5F5FF;
}

#download-btn:hover {
	background: #5e35b1;
}

#install-btn.available {
  background: #FF9800;
  animation: pulse 2s infinite;
}

#install-btn.available:hover {
  background: #e68a00;
}

#reset-btn {
	background: #A02222;
	color: #EEEEEE;
}

#reset-btn:hover {
  background: #da190b;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 152, 0, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 152, 0, 0);
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Media queries para responsive design */
@media (max-width: 1200px) {
  #toolbar {
    gap: 0.6rem;
  }
  
  select, button, input {
    padding: 0.4rem 0.6rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 768px) {
  
  #header {
    padding: 0.8rem;
  }
  
  h1 {
    font-size: 1.4rem;
  }
  
  #toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  select {
    min-width: 150px;
  }
  
  #filename-input {
    flex: 1;
    min-width: 100px;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 1.2rem;
    gap: 0.5rem;
  }
  
  #icon {
    height: 30px;
    width: 30px;
  }
  
  .min-toolbar-btn {
    font-size: 0.9rem;
    padding: 0.8rem;
  }
  
  #toolbar {
    gap: 0.4rem;
  }
  
  select, button, input {
    padding: 0.4rem;
    font-size: 0.8rem;
  }
  
  button span {
    display: none;
  }
  
  button i {
    margin-right: 0;
  }
  
  .status-bar {
    font-size: 1rem;
    padding: 0.3rem 0.6rem;
    height: 25px;
  }
  
  .toast {
    width: 95%;
    padding: 0.6rem;
    font-size: 0.9rem;
  }
}

/* Estilos para PWA en modo standalone */
@media (display-mode: standalone) {
  #app {
    height: 100dvh;
    margin-top: 0;
  }
  
  .min-toolbar-btn {
    display: none;
  }
}
