.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  background-color: var(--bg-main);
}

/* Pantalla de Inicio / Dashboard (Rosita y Blanco) */
.home-view {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: #fdf7f8;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 20px;
}

.home-content {
  max-width: 960px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.home-header {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.home-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 28px;
  font-weight: 900;
  color: var(--itch-dark);
}

.home-logo-icon {
  height: 42px;
  width: auto;
  display: block;
}

.home-badge {
  background-color: #fde8e8;
  color: var(--itch-red);
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
}

/* Tarjeta Principal de Creación (+ New Cover) */
.home-create-box {
  background-color: #ffffff;
  border: 2px dashed #f7c6c8;
  border-radius: 12px;
  padding: 36px 20px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  transition: all 0.15s ease;
  box-shadow: 0 4px 16px rgba(247, 198, 200, 0.25);
  user-select: none;
}

.home-create-box:hover {
  border-color: var(--itch-red);
  background-color: #fffafb;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(250, 92, 92, 0.15);
}

.home-plus-btn {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background-color: #fde8e8;
  color: var(--itch-red);
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  pointer-events: none;
  transition: all 0.15s ease;
}

.home-plus-btn svg {
  display: block;
}

.home-create-box:hover .home-plus-btn {
  transform: scale(1.08);
  background-color: var(--itch-red);
  color: #ffffff;
}

.home-create-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--itch-dark);
  pointer-events: none;
}

.home-create-sub {
  font-size: 13px;
  color: var(--itch-muted);
}

/* Acciones Secundarias de Inicio (Descargar plantillas zip / Abrir .itch) */
.home-actions-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

/* Grid de Proyectos Guardados */
.saved-projects-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.saved-projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}

.project-card {
  background-color: #ffffff;
  border: 1px solid var(--itch-border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--itch-red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.project-card-thumb {
  width: 100%;
  aspect-ratio: 630 / 500;
  background-color: var(--itch-pink);
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--itch-border-light);
}

.project-card-body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.project-card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--itch-dark);
  line-height: 1.2;
}

.project-card-desc {
  font-size: 12px;
  color: #666666;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 4px;
}

.project-card-tag {
  font-size: 11px;
  font-weight: 700;
  color: var(--itch-red);
  background-color: #fff0f1;
  padding: 2px 8px;
  border-radius: 4px;
}

.project-card-platforms {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--itch-muted);
}

.project-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--itch-border-light);
}

/* Header Editor */
.app-header {
  height: 52px;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--itch-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  flex-shrink: 0;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-icon-back {
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.editor-project-title-input {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 800;
  color: var(--itch-dark);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  outline: none;
  max-width: 170px;
  transition: all 0.12s ease;
}

.editor-project-title-input:hover {
  background-color: var(--bg-hover);
  border-color: var(--itch-border);
}

.editor-project-title-input:focus {
  background-color: #ffffff;
  border-color: var(--itch-red);
  box-shadow: 0 0 0 2px rgba(250, 92, 92, 0.15);
}

.editor-brand-icon {
  height: 28px;
  width: auto;
  display: block;
  margin-left: 2px;
  transition: transform 0.12s ease;
  cursor: pointer;
}

.editor-brand-icon:hover {
  transform: scale(1.08);
}

/* Pestañas de Proyectos / Diseños */
.project-tabs-container {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow-x: auto;
  max-width: 45vw;
}

.scene-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: var(--bg-card);
  color: var(--itch-muted);
  border: 1px solid var(--itch-border-light);
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.1s ease;
}

.scene-tab:hover {
  background-color: #ffffff;
  color: var(--itch-dark);
}

.scene-tab.active {
  background-color: #ffffff;
  color: var(--itch-red);
  border-color: var(--itch-border);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.tab-rename-input {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 700;
  color: var(--itch-dark);
  background-color: #ffffff;
  border: 1px solid var(--itch-red);
  border-radius: var(--radius-sm);
  padding: 1px 4px;
  outline: none;
  max-width: 110px;
}

.scene-tab-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--itch-muted);
  cursor: pointer;
  font-size: 11px;
}

.scene-tab-close:hover {
  background-color: #fde8e8;
  color: var(--itch-red);
}

.btn-add-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--itch-border);
  background-color: #ffffff;
  color: var(--itch-red);
  cursor: pointer;
  font-size: 16px;
  font-weight: 800;
  transition: all 0.12s ease;
}

.btn-add-tab:hover {
  border-color: var(--itch-red);
  background-color: #fff9f9;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

/* Dropdown de Descarga */
.download-dropdown-wrapper {
  position: relative;
}

.download-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background-color: #ffffff;
  border: 1px solid var(--itch-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  min-width: 210px;
  display: none;
  flex-direction: column;
  z-index: 60;
  overflow: hidden;
}

.download-menu.open {
  display: flex;
}

.download-menu-item {
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--itch-dark);
  cursor: pointer;
  border: none;
  background: none;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: background-color 0.1s ease;
}

.download-menu-item:hover {
  background-color: #fde8e8;
  color: var(--itch-red);
}

.download-menu-divider {
  height: 1px;
  background-color: var(--itch-border-light);
}

/* Main Workspace */
.app-workspace {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* Sidebar */
.app-sidebar {
  width: 360px;
  background-color: var(--bg-surface);
  border-right: 1px solid var(--itch-border);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-tabs {
  display: flex;
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--itch-border);
  position: sticky;
  top: 0;
  z-index: 5;
}

.tab-btn {
  flex: 1;
  padding: 12px 6px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--itch-muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: all 0.1s ease;
}

.tab-btn:hover {
  color: var(--itch-dark);
  background-color: var(--bg-hover);
}

.tab-btn.active {
  color: var(--itch-red);
  border-bottom-color: var(--itch-red);
  background-color: #fff9f9;
}

.tab-content {
  padding: 16px;
  display: none;
  flex-direction: column;
  gap: 16px;
}

.tab-content.active {
  display: flex;
}

/* Canvas Viewport */
.canvas-viewport {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-color: #e5e5e5;
  position: relative;
  overflow: auto;
  padding: 40px;
}

.canvas-toolbar {
  position: absolute;
  top: 16px;
  background-color: var(--bg-surface);
  border: 1px solid var(--itch-border);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius-md);
  padding: 4px 8px;
  display: none;
  align-items: center;
  gap: 4px;
  z-index: 20;
}

.canvas-toolbar.visible {
  display: flex;
}

.canvas-wrapper {
  position: relative;
  box-shadow: var(--shadow-canvas);
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 4px;
  background-color: #ffffff;
  line-height: 0;
}

#mainCanvas {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 160px);
  width: auto;
  height: auto;
  object-fit: contain;
}

.viewport-info {
  position: absolute;
  bottom: 12px;
  right: 16px;
  background-color: var(--bg-surface);
  color: var(--itch-dark);
  border: 1px solid var(--itch-border);
  box-shadow: var(--shadow-sm);
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  pointer-events: none;
}

/* Barra Superior de Enlaces / Redes Sociales EternoDev */
.top-social-bar {
  position: absolute;
  top: 24px;
  right: 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 100;
}

/* Enlace base */
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #333333;
  text-decoration: none;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 4px;
  border-radius: 6px;
  transition: color 0.15s ease, transform 0.15s ease;
  user-select: none;
}

.social-link:hover {
  color: #000000;
  transform: translateY(-1px);
}

/* Colores de Hover personalizados para cada red */
.social-link.link-web:hover {
  color: #2563eb; /* Azul EternoDev */
}

.social-link.link-youtube:hover {
  color: #ff0000; /* Rojo YouTube */
}

.social-link.link-github:hover {
  color: #000000; /* Negro GitHub */
}

.social-link.link-banana:hover {
  color: #FBBF24; /* Amarillo Platano / Buy Me a Coffee */
}

/* Iconos SVG */
.social-link svg {
  flex-shrink: 0;
  transition: transform 0.15s ease;
}

.social-link:hover svg {
  transform: scale(1.1);
}

/* Adaptabilidad a pantallas medianas y móviles (Mover al final de la página por debajo de 1160px) */
@media (max-width: 1160px) {
  .top-social-bar {
    position: static;
    order: 10;
    margin-top: 40px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    width: 100%;
  }
}
