:root {
  /* Backgrounds */
  --bg: #fffdfa; /* Soft cream base */
  --bg-gradient: linear-gradient(135deg, #fffdfa 0%, #ffe0f0 20%, #d0f0ff 50%, #fff9d6 80%, #f0f4ff 100%);
  
  --panel: #ffffff; /* Panel background */
  --panel-gradient: linear-gradient(180deg, #ffffff 0%, #e0f7ff 40%, #fff8e6 70%, #fffdfa 100%);
  
  /* Text Colors */
  --white: #1f2937; /* Main readable text */
  --muted: #6b7280; /* Secondary text */
  
  /* Accents */
  --accent: #f97316;  /* Bright Orange */
  --accent-2: #22c55e; /* Fresh Green */
  --accent-3: #3b82f6; /* Blue */
  --accent-4: #a855f7; /* Purple */
  --accent-gradient: linear-gradient(90deg, #f97316, #facc15, #3b82f6, #a855f7); /* lively multi-color gradient for buttons and highlights */
  
  /* Glass & overlays */
  --glass: rgba(255,255,255,0.6); /* soft translucent overlay */
  
  /* Canvas background */
  --canvas-bg: radial-gradient(circle at center, #ffffff 0%, #ffe0f0 25%, #d0f0ff 50%, #fff9d6 75%, #f0f4ff 100%); /* colorful but soft */
  
  /* Shadows */
  --shadow: rgba(0,0,0,0.08); /* subtle shadow */
  --shadow-light: rgba(255,255,255,0.6); /* subtle highlight glow */
}

/* ---------------------- */
/* GLOBAL STYLES          */
/* ---------------------- */
* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg-gradient);
  color: var(--white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
}

header {
  width: 100%;
  max-width: 1280px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

header h1 { margin: 0; font-size: 22px; font-weight: 600; }
header p { margin: 0; color: var(--muted); font-size: 13px; }

.app {
  width: 100%;
  max-width: 1280px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  align-items: start;
}

/* ---------------------- */
/* PANELS & WORKSPACE     */
/* ---------------------- */
.panel {
  background: var(--panel-gradient);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--shadow-light);
  min-height: 480px;
  box-shadow: 0 8px 20px var(--shadow);
  transition: all 0.2s ease;
}

.panel:hover { border-color: var(--accent-2); }

.workspace {
  background: var(--panel-gradient);
  border-radius: 12px;
  padding: 16px;
  border: 1px solid var(--shadow-light);
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 8px 20px var(--shadow);
}

/* ---------------------- */
/* LAYERS & CONTROLS      */
/* ---------------------- */
.section-title { 
  font-size: 13px; 
  color: var(--muted); 
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  margin-bottom: 8px;
}

.frame-nav { 
  display: flex; 
  gap: 10px; 
  align-items: center; 
}

.frameLabel { flex: 1; text-align: center; color: var(--muted); font-weight: 500; }

.layers {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 280px;
  overflow-y: auto;
  padding-right: 6px;
}

.layer {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass);
  padding: 10px;
  border-radius: 10px;
  border: 1px solid var(--shadow-light);
  cursor: grab;
  transition: all 0.2s ease;
}

.layer:hover { background: rgba(16,185,129,0.15); }

.layer.selected {
  outline: 2px solid var(--accent-2);
  background: var(--accent-gradient);
  background-size: 200% 200%;
  animation: gradientShift 3s ease infinite;
}

.layer .thumb {
  width: 60px; 
  height: 42px; 
  border-radius: 8px; 
  background: #ffe4e1;
  overflow: hidden;
  border: 1px solid var(--shadow-light);
}

.layer .meta {
  flex: 1;
  display: flex; 
  justify-content: space-between; 
  align-items: center; 
  font-size: 13px;
  color: var(--white);
}

.layer .controls { display: flex; gap: 6px; align-items: center; }

/* ---------------------- */
/* BUTTONS                */
/* ---------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--shadow-light);
  background: var(--accent-gradient);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s ease;
  background-size: 200% 200%;
}

.btn:hover { 
  background-position: right center;
  transform: translateY(-2px);
}

.btn.ghost { 
  background: transparent; 
  border: 1px solid var(--accent-2); 
  color: var(--accent-2); 
}
.small { font-size: 12px; padding: 6px 8px; }

/* ---------------------- */
/* CANVAS & TOOLBAR       */
/* ---------------------- */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; overflow-x: auto; }

.canvas-wrap { display: flex; justify-content: center; }

.canvas-stage {
  background: var(--canvas-bg);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: inset 0 0 20px var(--shadow-light);
}

canvas {
  border-radius: 10px;
  display: block;
  touch-action: none;
  background: var(--canvas-bg);
  box-shadow: 0 8px 25px var(--shadow);
  max-width: 100%;
  height: auto;
}

/* ---------------------- */
/* INFO & FOOTER          */
/* ---------------------- */
.infos { display: flex; justify-content: space-between; width: 100%; color: var(--muted); font-size: 13px; margin-top: 6px; }

footer { width: 100%; max-width: 1280px; margin-top: 20px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------------------- */
/* ANIMATION              */
/* ---------------------- */
@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* ---------------------- */
/* RESPONSIVE FIXED       */
/* ---------------------- */
@media (max-width: 980px) {
  .app { grid-template-columns: 1fr; }
  .panel, .workspace { order: unset; width: 100%; }
}

@media (max-width: 600px) {
  body { padding: 12px; }
  .toolbar { gap: 6px; }
  .layer { padding: 6px; gap: 6px; }
  .layer .thumb { width: 48px; height: 34px; }
  .btn { padding: 6px 10px; font-size: 12px; }
}

@media (max-width: 420px) {
  .toolbar { flex-wrap: nowrap; overflow-x: auto; }
  footer { font-size: 11px; }
}

/* Common ad styling */
.ad {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 8px 0;
}

/* Sidebar ad */
.ad-sidebar {
  width: 160px;
  margin: 12px auto;
  text-align: center;
}

/* Header ad */
.ad-header {
  width: 100%;
  text-align: center;
  margin: 10px 0;
}

/* Footer ad */
.ad-footer {
  width: 100%;
  text-align: center;
  margin: 15px auto;
}

/* Make ads responsive on small screens */
@media (max-width: 768px) {
  .ad-sidebar {
    display: none; /* hide sidebar ad on small screens */
  }

  .ad-header iframe,
  .ad-footer iframe {
    width: 100% !important;
    height: auto !important;
  }
}



