/* ============================================================
   PixelForge — style.css
   Only: custom range sliders, keyframes, reusable component classes
   Everything else is handled by Tailwind utilities in index.html
   ============================================================ */

/* ---------- Fonts & Base ---------- */
* { box-sizing: border-box; }
body { font-family: 'Inter', sans-serif; }

/* ---------- Keyframes ---------- */
@keyframes logoGlow {
  0%   { filter: drop-shadow(0 0 4px rgba(124,92,252,0.3)); }
  100% { filter: drop-shadow(0 0 16px rgba(124,92,252,0.6)); }
}
@keyframes pulseGlow {
  0%, 100% { transform: scale(1);    box-shadow: 0 0 30px rgba(124,92,252,0.35); }
  50%       { transform: scale(1.05); box-shadow: 0 0 50px rgba(124,92,252,0.55); }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes panelIn {
  from { opacity: 0; transform: translateX(10px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.9) translateY(20px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}

/* ---------- Tailwind animation classes (registered in config) ---------- */
.animate-logo-glow  { animation: logoGlow  3s ease-in-out infinite alternate; }
.animate-pulse-glow { animation: pulseGlow 2.5s ease-in-out infinite; }
.animate-fade-up    { animation: fadeInUp  0.6s ease-out; }
.animate-panel-in   { animation: panelIn   0.25s ease-out; }
.animate-modal-in   { animation: modalIn   0.3s cubic-bezier(0.34,1.56,0.64,1); }

/* ---------- Gradient utilities ---------- */
.gradient-text {
  background: linear-gradient(135deg, #7c5cfc 0%, #00c6ff 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.gradient-bg {
  background: linear-gradient(135deg, #7c5cfc 0%, #00c6ff 100%);
}

/* ---------- Custom Scrollbar ---------- */
::-webkit-scrollbar        { width: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #2a2a38; border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: #5a5a70; }

/* ---------- Custom Range Slider ---------- */
.styled-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  background: linear-gradient(to right, #7c5cfc 50%, #22222e 50%);
  border-radius: 4px;
  outline: none;
  cursor: pointer;
}
.styled-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #7c5cfc;
  border: 2px solid #111118;
  cursor: pointer;
  box-shadow: 0 0 8px rgba(124,92,252,0.4);
  transition: transform 0.15s, box-shadow 0.15s;
}
.styled-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  box-shadow: 0 0 14px rgba(124,92,252,0.6);
}
.styled-slider::-webkit-slider-thumb:active { transform: scale(1.3); }
.styled-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #7c5cfc;
  border: 2px solid #111118;
  box-shadow: 0 0 8px rgba(124,92,252,0.4);
}

/* ---------- Color Input ---------- */
.color-input {
  -webkit-appearance: none;
  border: none; width: 36px; height: 36px;
  border-radius: 6px; cursor: pointer;
  background: transparent; padding: 0;
}
.color-input::-webkit-color-swatch-wrapper { padding: 0; }
.color-input::-webkit-color-swatch {
  border: 2px solid #2a2a3a;
  border-radius: 6px;
}

/* ---------- Reusable Component Classes ---------- */

/* Buttons */
.btn-primary {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, #7c5cfc 0%, #00c6ff 100%);
  color: white; border: none;
  border-radius: 10px; padding: 8px 16px;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer;
  box-shadow: 0 2px 12px rgba(124,92,252,0.3);
  transition: box-shadow 0.15s, transform 0.15s;
}
.btn-primary:hover  { box-shadow: 0 4px 20px rgba(124,92,252,0.5); transform: translateY(-1px); }
.btn-primary:active { transform: translateY(0) scale(0.98); }
.btn-primary.btn-lg { padding: 12px 28px; font-size: 15px; border-radius: 14px; }

.btn-ghost {
  display: inline-flex; align-items: center; gap: 6px;
  background: #22222e; color: #9595a8;
  border: 1px solid #2a2a3a; border-radius: 10px;
  padding: 8px 16px;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background 0.15s, color 0.15s;
}
.btn-ghost:hover { background: #2a2a38; color: #eaeaf0; }

/* Tool button (toolbar) */
.tool-btn {
  display: flex; align-items: center; gap: 4px;
  background: transparent; border: none;
  color: #9595a8; padding: 6px 8px;
  border-radius: 6px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
  font-family: 'Inter', sans-serif; font-size: 12px;
}
.tool-btn:hover:not(:disabled) { background: #2a2a38; color: #eaeaf0; }
.tool-btn:active:not(:disabled) { background: #32324a; transform: scale(0.95); }
.tool-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* Sidebar tool */
.sidebar-tool {
  display: flex; flex-direction: column; align-items: center;
  gap: 2px; background: transparent; border: none;
  color: #5a5a70; padding: 10px 8px; border-radius: 10px;
  cursor: pointer; width: 56px; position: relative;
  transition: background 0.15s, color 0.15s;
  font-family: 'Inter', sans-serif;
}
.sidebar-tool:hover { background: #2a2a38; color: #9595a8; }
.sidebar-tool.active {
  color: #7c5cfc;
  background: rgba(124,92,252,0.15);
}
.sidebar-tool.active::before {
  content: ''; position: absolute; left: 0; top: 50%;
  transform: translateY(-50%);
  width: 3px; height: 24px;
  background: #7c5cfc; border-radius: 0 3px 3px 0;
}

/* Slider group */
.slider-group { display: flex; flex-direction: column; gap: 6px; }
.slider-value {
  font-size: 11px; font-weight: 600; color: #7c5cfc;
  min-width: 36px; text-align: right; font-variant-numeric: tabular-nums;
}

/* Transform button */
.transform-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 14px 8px;
  background: #1a1a24; border: 1px solid #2a2a3a;
  border-radius: 10px; color: #9595a8;
  cursor: pointer; transition: all 0.15s;
  font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 500;
}
.transform-btn:hover {
  background: #2a2a38; color: #eaeaf0;
  border-color: #7c5cfc; box-shadow: 0 0 12px rgba(124,92,252,0.25);
  transform: translateY(-2px);
}
.transform-btn:active { transform: translateY(0) scale(0.97); }

/* Preset (crop ratio) button */
.preset-btn {
  padding: 6px 14px; background: #1a1a24;
  border: 1px solid #2a2a3a; border-radius: 6px;
  color: #9595a8; cursor: pointer;
  font-family: 'Inter', sans-serif; font-size: 12px; font-weight: 500;
  transition: all 0.15s;
}
.preset-btn:hover { border-color: #7c5cfc; color: #eaeaf0; }
.preset-btn.active { background: rgba(124,92,252,0.15); border-color: #7c5cfc; color: #7c5cfc; }

/* Draw tool button */
.draw-tool-btn {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  background: #1a1a24; border: 1px solid #2a2a3a;
  border-radius: 6px; color: #9595a8;
  cursor: pointer; transition: all 0.15s;
}
.draw-tool-btn:hover { border-color: #7c5cfc; color: #eaeaf0; }
.draw-tool-btn.active { background: rgba(124,92,252,0.15); border-color: #7c5cfc; color: #7c5cfc; }

/* Style button (bold/italic) */
.style-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: #1a1a24; border: 1px solid #2a2a3a;
  border-radius: 6px; color: #9595a8;
  cursor: pointer; font-family: 'Inter', sans-serif; font-size: 14px;
  transition: all 0.15s;
}
.style-btn:hover { border-color: #7c5cfc; color: #eaeaf0; }
.style-btn.active { background: rgba(124,92,252,0.15); border-color: #7c5cfc; color: #7c5cfc; }

/* Icon button */
.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px;
  background: transparent; border: none;
  color: #5a5a70; border-radius: 6px; cursor: pointer;
  transition: all 0.15s;
}
.icon-btn:hover { background: #2a2a38; color: #eaeaf0; }

/* Toast */
.toast {
  position: fixed; bottom: 48px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #22222e; border: 1px solid #2a2a3a;
  color: #eaeaf0; padding: 10px 20px;
  border-radius: 14px; font-size: 13px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 2000; white-space: nowrap;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Kbd */
.kbd {
  display: inline-block; padding: 1px 5px;
  font-size: 10px; font-family: 'Inter', sans-serif;
  color: #9595a8; background: #22222e;
  border: 1px solid #2a2a3a; border-radius: 4px; line-height: 1.4;
}

/* Drag over */
.drag-over { background-color: rgba(124,92,252,0.06) !important; }
.drag-over::after {
  content: ''; position: absolute; inset: 12px;
  border: 2px dashed #7c5cfc; border-radius: 20px;
  pointer-events: none; animation: borderPulse 1.2s ease-in-out infinite;
}
@keyframes borderPulse {
  0%, 100% { opacity: 0.4; }
  50%       { opacity: 1; }
}
