/**
 * Kids Coloring Magic - Base Styles & Theme Variables
 * Designed for iPad touch screens (Safari PWA) and responsive mobile devices.
 */

:root {
  --primary: #FF6584;
  --primary-hover: #FF4A6F;
  --primary-light: #FFEBF0;
  --secondary: #9B51E0;
  --accent: #FFD166;
  --accent-green: #06D6A0;
  --accent-blue: #118AB2;
  --bg-app: #FFF5F7;
  --bg-surface: #FFFFFF;
  --text-main: #2D3748;
  --text-muted: #718096;
  --border: #F0E2E7;
  --shadow-sm: 0 2px 6px rgba(255, 101, 132, 0.08);
  --shadow-md: 0 4px 16px rgba(255, 101, 132, 0.14);
  --shadow-lg: 0 10px 30px rgba(255, 101, 132, 0.2);
  --radius-sm: 12px;
  --radius-md: 20px;
  --radius-lg: 28px;
  --radius-pill: 9999px;
  --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Comic Neue", "Quicksand", sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-app);
  font-family: var(--font-family);
  color: var(--text-main);
  touch-action: none;
  /* Support iPhone & iPad safe area notches */
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

#app-container {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
}

/* Header Top Bar */
.top-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--border);
  box-shadow: var(--shadow-sm);
  z-index: 100;
  min-height: 60px;
  gap: 8px;
}

.header-left, .header-center, .header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.app-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}

.app-brand span.sparkle {
  font-size: 1.4rem;
  animation: pulseSparkle 2s infinite ease-in-out;
}

@keyframes pulseSparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.2) rotate(15deg); }
}

/* Main Workspace */
.main-workspace {
  flex: 1;
  display: flex;
  position: relative;
  overflow: hidden;
  background: #F8FAFC;
  background-image: radial-gradient(#E2E8F0 1.5px, transparent 1.5px);
  background-size: 24px 24px;
}

/* Bottom Controls Wrapper */
.bottom-dock {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-top: 2px solid var(--border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
  z-index: 90;
  padding-bottom: max(6px, env(safe-area-inset-bottom));
}

/* Animations */
@keyframes bounceIn {
  0% { transform: scale(0.85); opacity: 0; }
  60% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

.bounce-in {
  animation: bounceIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

/* Responsive adjustments for mobile phones */
@media (max-width: 768px) {
  .top-header {
    padding: 6px 10px;
    min-height: 52px;
  }
  .app-brand span.brand-text {
    display: none;
  }
  .btn-label-text {
    display: none;
  }
  .top-header .btn-kid {
    padding: 8px 12px;
    font-size: 0.9rem;
  }
}
