@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600&display=swap');

/* --- Header y Navegación Compartida --- */
header {
  width: 100%;
  display: flex;
  justify-content: center;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.6);
  margin-bottom: 20px;
}

.navbar {
  width: 100%;
  max-width: 1200px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
}

.logo {
  font-size: 1.4rem;
  font-weight: 600;
  color: #3d3b6a;
  text-decoration: none;
}

.nav-links {
  display: flex;
  gap: 20px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: #4a4a6a;
  font-weight: 500;
  transition: color 0.2s;
}

.nav-links a:hover, .nav-links a.active {
  color: #6d597a;
  font-weight: 600;
}

.container {
  max-width: 900px;
  width: 100%;
  padding: 20px;
  margin: 0 auto 40px auto;
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 0.85rem;
  color: #6c757d;
  width: 100%;
  margin-top: auto;
}



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

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #e0c3fc 0%, #8ec5fc 100%);
  color: #4a4a6a;
  padding: 20px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 20px;
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 12px 28px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
  margin-bottom: 20px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  flex-wrap: wrap;
  justify-content: center;
}

.control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  font-size: 0.95rem;
}

input[type="color"] {
  -webkit-appearance: none;
  appearance: none;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  background: none;
}

input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
input[type="color"]::-webkit-color-swatch {
  border: 2px solid #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

input[type="range"] {
  accent-color: #b8c0ff;
  cursor: pointer;
}

.btn {
  background-color: #b8c0ff;
  color: #3d3b6a;
  border: none;
  padding: 8px 18px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 4px 10px rgba(184, 192, 255, 0.5);
}

.btn.alt {
  background-color: #ffcad4;
  color: #6d597a;
  box-shadow: 0 4px 10px rgba(255, 202, 212, 0.5);
}

.btn:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Layout ampliado */
.app-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

#canvas-container {
  position: relative;
  width: 1200px;
  height: 700px;
  background-color: #ffffff;
  border-radius: 24px;
  box-shadow: 0 12px 32px rgba(100, 100, 111, 0.15);
  border: 3px solid #ffffff;
  overflow: hidden;
}

#canvas-container canvas {
  position: absolute;
  top: 0;
  left: 0;
  cursor: crosshair;
}

/* Panel lateral de capas */
.layers-panel {
  background-color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  padding: 16px;
  border-radius: 20px;
  box-shadow: 0 8px 24px rgba(149, 157, 165, 0.2);
  width: 250px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.6);
  height: 700px;
}

.layers-panel h3 {
  font-size: 1rem;
  font-weight: 600;
}

.layers-list {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  flex-grow: 1;
  overflow-y: auto;
}

.layer-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: #f0f2f5;
  padding: 10px 12px;
  border-radius: 12px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s ease;
}

.layer-item.active {
  border-color: #b8c0ff;
  background-color: #e8eaff;
}

.layer-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 500;
}

.layer-item.active .layer-item-header {
  font-weight: 600;
}

.layer-item .delete-btn {
  background: none;
  border: none;
  color: #ff6b6b;
  font-weight: bold;
  cursor: pointer;
  font-size: 1rem;
  padding: 0 4px;
}

/* Estilo para el control de opacidad de la capa */
.layer-opacity-control {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: #6c757d;
}

.layer-opacity-control input[type="range"] {
  width: 100%;
  height: 4px;
}

.layer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

select {
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background-color: #ffffff;
  color: #4a4a6a;
  font-family: 'Poppins', sans-serif;
  font-weight: 500;
  cursor: pointer;
  outline: none;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

#downloadBtn {
  background-color: #b5e2fa;
  color: #2b3a4a;
  box-shadow: 0 4px 10px rgba(181, 226, 250, 0.5);
}