/* PixelKop - Custom Premium Styling Sheet */

:root {
  --font-heading: 'Outfit', sans-serif;
  --font-body: 'Plus Jakarta Sans', sans-serif;
  
  /* Color Palette - Cyberpunk Vibrant Dark Theme with Pink/Cyan accents */
  --bg-deep: #080306;
  --bg-card: rgba(18, 8, 14, 0.6);
  --bg-card-hover: rgba(26, 12, 21, 0.75);
  --border-glass: rgba(255, 255, 255, 0.05);
  --border-glass-focused: rgba(255, 0, 127, 0.4);
  
  --primary-start: #ff007f; /* Neon Pink */
  --primary-end: #00f3ff;   /* Neon Cyan */
  --accent: #d946ef;        /* Violet */
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;
  
  --shadow-glow: 0 0 25px rgba(255, 0, 127, 0.15);
  --shadow-glow-large: 0 0 50px rgba(255, 0, 127, 0.25);
  --shadow-card: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
  
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
  background-color: var(--bg-deep);
  color: var(--text-primary);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* Background Blobs */
.glass-bg-blobs {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(125px);
  opacity: 0.16;
  mix-blend-mode: screen;
  animation: float-around 22s infinite alternate ease-in-out;
}

.blob-1 {
  width: 550px;
  height: 550px;
  background: var(--primary-start);
  top: -10%;
  left: 10%;
  animation-duration: 18s;
}

.blob-2 {
  width: 480px;
  height: 480px;
  background: var(--primary-end);
  bottom: -5%;
  right: 15%;
  animation-duration: 25s;
}

.blob-3 {
  width: 380px;
  height: 380px;
  background: #a855f7; /* Violet */
  top: 35%;
  left: 45%;
  animation-duration: 20s;
}

@keyframes float-around {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(-30px, 40px) scale(1.08); }
  100% { transform: translate(40px, -30px) scale(0.92); }
}

/* App Container */
.app-container {
  max-width: 1000px;
  width: 100%;
  margin: 0 auto;
  padding: 30px 20px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  justify-content: space-between;
}

/* Header */
.app-header {
  margin-bottom: 25px;
  text-align: center;
}

.logo-area {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  color: #fff;
  box-shadow: var(--shadow-glow);
  transition: var(--transition-normal);
}

.animate-sway {
  animation: sway 6s infinite ease-in-out;
}

@keyframes sway {
  0%, 100% { transform: rotate(-3deg) scale(1); }
  50% { transform: rotate(3deg) scale(1.04); }
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -1px;
}

.gradient-text {
  background: linear-gradient(135deg, #fce7f3 0%, #cffafe 30%, #00f3ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

.tagline {
  color: var(--text-secondary);
  font-size: 14px;
  margin-top: 3px;
  font-weight: 400;
}

/* Privacy Banner */
.privacy-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 0, 127, 0.03);
  border: 1px solid rgba(255, 0, 127, 0.15);
  border-radius: 16px;
  padding: 14px 20px;
  margin-bottom: 20px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.privacy-icon {
  font-size: 20px;
  color: var(--primary-start);
  flex-shrink: 0;
  text-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
}

.privacy-text {
  font-size: 13.5px;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: left;
}

.privacy-text strong {
  color: var(--text-primary);
}

/* General Glass Cards */
.card {
  border-radius: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 24px;
  box-shadow: var(--shadow-card);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
}

/* Dual Panel Layout */
.main-card-layout {
  display: none;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  width: 100%;
}

.main-card-layout.active {
  display: grid;
}

.panel-drawing {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.panel-animation {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.drawing-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

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

.grid-controls label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.panel-title {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* Drawing Toolbar */
.drawing-toolbar {
  display: flex;
  gap: 8px;
  align-items: center;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 6px 12px;
}

.tool-btn, .tool-action-btn {
  width: 36px;
  height: 36px;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.tool-btn:hover, .tool-action-btn:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,0.03);
}

.tool-btn.active {
  background: var(--primary-start);
  color: white;
  box-shadow: 0 0 10px rgba(255, 0, 127, 0.4);
}

.divider-vertical {
  width: 1px;
  height: 24px;
  background: rgba(255,255,255,0.06);
}

/* Native Color Picker Circle */
.color-picker-input {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}

.color-picker-input::-webkit-color-swatch-wrapper {
  padding: 0;
}

.color-picker-input::-webkit-color-swatch {
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 50%;
}

/* Checkered Canvas Board */
.canvas-viewport {
  width: 100%;
  flex-grow: 1;
  background-image: linear-gradient(45deg, #111111 25%, transparent 25%),
                    linear-gradient(-45deg, #111111 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #111111 75%),
                    linear-gradient(-45deg, transparent 75%, #111111 75%);
  background-size: 16px 16px;
  background-position: 0 0, 0 8px, 8px -8px, -8px 0px;
  background-color: #1c1c1c;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  min-height: 380px;
}

#pixel-canvas {
  max-width: 100%;
  max-height: 350px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  image-rendering: pixelated;
  cursor: crosshair;
}

/* Select Form */
.form-select {
  background-color: #120a0e;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  height: 36px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 0 10px;
  outline: none;
  cursor: pointer;
}

.form-select option {
  background-color: #120a0e;
  color: var(--text-primary);
}

/* Animation Preview Frame */
.animation-preview-wrapper {
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255,255,255,0.03);
  border-radius: 14px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#animation-preview-canvas {
  image-rendering: pixelated;
  background-image: linear-gradient(45deg, #111 25%, transparent 25%),
                    linear-gradient(-45deg, #111 25%, transparent 25%),
                    linear-gradient(45deg, transparent 75%, #111 75%),
                    linear-gradient(-45deg, transparent 75%, #111 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  background-color: #1a1a1a;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.4);
}

.animation-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
}

.fps-control {
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  gap: 4px;
}

.fps-control label {
  font-size: 10px;
  color: var(--text-secondary);
  font-weight: 700;
  text-transform: uppercase;
}

/* Timeline Container */
.timeline-container, .exports-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: rgba(255, 255, 255, 0.01);
  border: 1px solid rgba(255, 255, 255, 0.03);
  border-radius: 12px;
  padding: 14px 16px;
}

.timeline-container strong, .exports-container strong {
  font-family: var(--font-heading);
  font-size: 12.5px;
  color: var(--text-secondary);
  text-transform: uppercase;
}

.timeline-frames-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  min-height: 60px;
}

.timeline-frames-row::-webkit-scrollbar {
  height: 4px;
}
.timeline-frames-row::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 10px;
}

.frame-item-wrapper {
  position: relative;
  flex-shrink: 0;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,0.06);
  background: #111;
  width: 48px;
  height: 48px;
  cursor: pointer;
  overflow: hidden;
  transition: var(--transition-fast);
}

.frame-item-wrapper.active {
  border-color: var(--primary-start);
  box-shadow: 0 0 8px rgba(255, 0, 127, 0.3);
}

.frame-item-canvas {
  width: 100%;
  height: 100%;
  image-rendering: pixelated;
}

.btn-frame-delete {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 14px;
  height: 14px;
  background: rgba(239, 68, 68, 0.85);
  color: white;
  border: none;
  border-radius: 2px;
  font-size: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: var(--transition-fast);
}

.frame-item-wrapper:hover .btn-frame-delete {
  opacity: 1;
}

.btn-frame-delete:hover {
  background: var(--error);
}

.exports-buttons-row {
  display: flex;
  gap: 12px;
}

.exports-buttons-row .btn {
  flex-grow: 1;
}

/* Range Slider */
.form-range {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.05);
  outline: none;
  border-radius: 10px;
  appearance: none;
  -webkit-appearance: none;
}

.form-range::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--primary-start);
  cursor: pointer;
}

/* Buttons */
.btn {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: var(--transition-fast);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-start), var(--primary-end));
  color: white;
  box-shadow: 0 4px 12px rgba(255, 0, 127, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff3399, #00d9e5);
  box-shadow: 0 4px 16px rgba(255, 0, 127, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  color: var(--text-primary);
}

.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
}

.btn-small {
  height: 30px;
  font-size: 11.5px;
  padding: 4px 10px;
}

.text-error {
  color: var(--error) !important;
}

/* Footer info */
.app-footer {
  text-align: center;
  margin-top: 25px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.app-footer p {
  color: var(--text-muted);
  font-size: 11.5px;
}

/* Responsive Explorer Layout */
@media (max-width: 800px) {
  .main-card-layout {
    grid-template-columns: 1fr;
  }
  .app-container {
    padding: 20px 10px;
  }
}
