/* =============================================
   SVG Path Animator — Styles
   Theme: Dark mode, Purple/Cyan  
   ============================================= */

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

:root {
  --bg: #0F1219;
  --bg-card: #161B26;
  --bg-input: #0F1219;
  --bg-hover: #1C2233;
  --border: rgba(168, 85, 247, 0.12);
  --border-focus: rgba(168, 85, 247, 0.5);
  --primary: #A855F7;
  --primary-dim: rgba(168, 85, 247, 0.12);
  --primary-glow: rgba(168, 85, 247, 0.3);
  --secondary: #C084FC;
  --accent: #22D3EE;
  --accent-dim: rgba(34, 211, 238, 0.12);
  --text: #E8ECF0;
  --text-dim: #8B95A8;
  --text-muted: #4A5268;
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --transition: 0.2s ease;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

html { font-size: 16px; -webkit-font-smoothing: antialiased; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; line-height: 1.6; overflow: hidden; }
body::before { content: ''; position: fixed; inset: 0; background: radial-gradient(ellipse at top left, rgba(168,85,247,0.04), transparent 50%), radial-gradient(ellipse at bottom right, rgba(34,211,238,0.03), transparent 50%); pointer-events: none; }

/* Header */
.header { border-bottom: 1px solid var(--border); background: rgba(22,27,38,0.9); backdrop-filter: blur(12px); position: sticky; top: 0; z-index: 10; }
.header-inner { max-width: 100%; padding: 10px 20px; display: flex; align-items: center; justify-content: space-between; }
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.2rem; width: 38px; height: 38px; display: flex; align-items: center; justify-content: center; background: var(--primary-dim); border-radius: var(--radius-sm); }
.logo h1 { font-size: 1.05rem; font-weight: 700; letter-spacing: -0.02em; }
.tagline { font-size: 0.72rem; color: var(--text-dim); }
.header-actions { display: flex; gap: 6px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; font-family: var(--font); font-size: 0.8rem; font-weight: 500; border: none; border-radius: 6px; cursor: pointer; transition: all var(--transition); white-space: nowrap; }
.btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), #7C3AED); color: white; font-weight: 600; }
.btn-primary:hover { box-shadow: 0 4px 16px var(--primary-glow); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-dim); border: 1px solid var(--border); }
.btn-ghost:hover { color: var(--text); border-color: var(--primary); background: var(--primary-dim); }

/* Layout */
.main { height: calc(100vh - 59px); overflow: hidden; }
.layout { display: grid; grid-template-columns: 320px 1fr; height: 100%; }

/* Controls Panel */
.controls-panel { height: 100%; overflow-y: auto; border-right: 1px solid var(--border); padding: 16px; scrollbar-width: thin; scrollbar-color: var(--text-muted) transparent; }

.control-section { margin-bottom: 18px; }
.section-title { font-size: 0.78rem; font-weight: 600; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.path-count { font-size: 0.68rem; background: var(--primary-dim); color: var(--primary); padding: 1px 7px; border-radius: 10px; }

/* Input Area */
textarea {
  width: 100%; padding: 10px; font-family: monospace; font-size: 0.78rem; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: var(--radius-sm); outline: none; resize: vertical; transition: all var(--transition);
}
textarea:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-dim); }
textarea::placeholder { color: var(--text-muted); }

.input-actions { display: flex; gap: 6px; margin-top: 8px; }

/* Controls */
.control-group { margin-bottom: 10px; }
.control-group label { display: flex; align-items: center; justify-content: space-between; font-size: 0.75rem; font-weight: 500; color: var(--text-dim); margin-bottom: 4px; }
.ctrl-value { color: var(--accent); font-weight: 600; }

.control-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

input[type="range"] { width: 100%; height: 4px; -webkit-appearance: none; appearance: none; background: rgba(168,85,247,0.2); border-radius: 2px; outline: none; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: var(--primary); cursor: pointer; box-shadow: 0 0 8px var(--primary-glow); }

input[type="color"] { width: 100%; height: 32px; padding: 2px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; cursor: pointer; }

select {
  width: 100%; padding: 7px 10px; font-family: var(--font); font-size: 0.8rem; color: var(--text); background: var(--bg-input); border: 1px solid var(--border); border-radius: 6px; outline: none; cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%238B95A8' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 8px center; padding-right: 26px;
}
select:focus { border-color: var(--border-focus); box-shadow: 0 0 0 3px var(--primary-dim); }

/* Playback */
.playback-controls { display: flex; gap: 8px; }
.btn-play { flex: 1; justify-content: center; padding: 10px; }

/* Path List */
.path-list { display: flex; flex-direction: column; gap: 4px; }
.path-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--bg-card); border: 1px solid var(--border); border-radius: 6px; font-size: 0.75rem; transition: all var(--transition); }
.path-item:hover { border-color: rgba(168,85,247,0.3); }
.path-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.path-label { flex: 1; color: var(--text-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: monospace; }
.path-length { color: var(--accent); font-weight: 500; font-size: 0.7rem; }

/* Canvas */
.canvas-panel { display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); position: relative; overflow: hidden; }

.canvas-container { width: 100%; max-width: 600px; aspect-ratio: 1; position: relative; }

.canvas-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; color: var(--text-muted); text-align: center; gap: 12px; }
.empty-icon { font-size: 3rem; opacity: 0.4; }

#canvas-svg { width: 100%; height: 100%; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg-card); }

/* Path animation classes via JS */
.svg-path-animated {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Responsive */
@media (max-width: 768px) {
  body { overflow: auto; }
  .main { height: auto; }
  .layout { grid-template-columns: 1fr; height: auto; }
  .controls-panel { border-right: none; border-bottom: 1px solid var(--border); max-height: none; }
  .canvas-panel { min-height: 50vh; }
}
