@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;600;800&display=swap');

:root {
  --bg-dark: #030712;
  --bg-panel: rgba(17, 24, 39, 0.6);
  --border-color: rgba(55, 65, 81, 0.4);
  --border-glow: rgba(6, 182, 212, 0.35);
  
  --accent-cyan: #06b6d4;
  --accent-purple: #c084fc;
  --accent-green: #10b981;
  --accent-magenta: #ec4899;
  
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  
  --font-sans: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius-lg: 20px;
  --radius-md: 12px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset and Globals */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 10% 10%, rgba(192, 132, 252, 0.08) 0px, transparent 40%),
    radial-gradient(at 90% 90%, rgba(6, 182, 212, 0.08) 0px, transparent 40%);
  color: var(--text-main);
  font-family: var(--font-sans);
  min-height: 100vh;
  overflow-x: hidden;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--accent-cyan);
}

/* Container & Header */
.container {
  max-width: 1440px;
  margin: 0 auto;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  min-height: 100vh;
}

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 1.25rem;
}

.logo-section h1 {
  font-size: 1.85rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 10%, var(--accent-cyan) 50%, var(--accent-purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-section p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.15rem;
}

.header-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  transition: var(--transition);
}

.header-links a:hover {
  color: #fff;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

/* Three-Column Workspace Grid */
.studio-workspace {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  flex-grow: 1;
}

@media(min-width: 1024px) {
  .studio-workspace {
    grid-template-columns: 320px 1fr 340px;
  }
}

/* Panels (Common) */
.studio-panel {
  background: var(--bg-panel);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  max-height: 80vh;
  overflow-y: auto;
}

.panel-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.75rem;
}

/* Section Title inside panels */
.panel-section-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  font-weight: 700;
  margin-bottom: 1rem;
}

/* Color & Slider Controls */
.controls-group {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.node-control-row {
  display: grid;
  grid-template-columns: 24px 1fr 2fr;
  align-items: center;
  gap: 0.75rem;
  background: rgba(255, 255, 255, 0.02);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.03);
}

.node-number {
  font-family: var(--font-mono);
  font-weight: 800;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* HTML Color Picker input override */
.color-picker-wrapper {
  position: relative;
  width: 100%;
  height: 36px;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.color-picker-wrapper input[type="color"] {
  position: absolute;
  top: -5px;
  left: -5px;
  width: calc(100% + 10px);
  height: calc(100% + 10px);
  border: none;
  cursor: pointer;
  background: transparent;
}

/* Sliders */
.slider-container {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-muted);
}

.custom-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.1);
  outline: none;
}

.custom-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent-cyan);
  cursor: pointer;
  box-shadow: 0 0 8px rgba(6, 182, 212, 0.6);
  transition: var(--transition);
}

.custom-slider::-webkit-slider-thumb:hover {
  background: #fff;
  transform: scale(1.15);
}

/* Animations panel additions */
.switch-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Custom checkbox switch styling */
.switch-label {
  font-size: 0.9rem;
  font-weight: 600;
}

.switch-input {
  appearance: none;
  width: 44px;
  height: 22px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  outline: none;
  transition: var(--transition);
}

.switch-input:checked {
  background: var(--accent-green);
}

.switch-input::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  top: 2px;
  left: 2px;
  transition: var(--transition);
}

.switch-input:checked::before {
  left: 24px;
}

/* Center Canvas */
.canvas-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  min-height: 450px;
}

@media(min-width: 1024px) {
  .canvas-panel {
    min-height: auto;
    height: 100%;
  }
}

.gradient-canvas-container {
  width: 100%;
  height: 100%;
  min-height: 450px;
  background-color: var(--bg-dark);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Canvas Draggable Anchor handles */
.node-handle {
  position: absolute;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid #fff;
  cursor: grab;
  transform: translate(-50%, -50%);
  z-index: 10;
  transition: transform 0.1s ease, border-color 0.2s;
}

.node-handle:active {
  cursor: grabbing;
  transform: translate(-50%, -50%) scale(1.25);
  border-color: var(--accent-cyan);
}

.node-handle::after {
  content: '';
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #000;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

/* Floating Glass Card Component */
.glass-card-preview {
  position: relative;
  width: 320px;
  min-height: 200px;
  padding: 1.75rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.35);
  z-index: 5;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  user-select: none;
}

/* Preview Component Contents */
/* 1. Analytics Widget */
.preview-analytics {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  width: 100%;
}
.analytics-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.analytics-header h4 {
  font-weight: 700;
  font-size: 1.05rem;
}
.pulse-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
  animation: pulse 1.5s infinite;
}
.analytics-main {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}
.analytics-stat {
  display: flex;
  flex-direction: column;
}
.analytics-stat .label {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}
.analytics-stat .value {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
}
.analytics-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 60px;
}
.chart-bar {
  width: 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  transition: var(--transition);
}
.chart-bar.active {
  background: #fff;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* 2. Music Player */
.preview-music {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
}
.song-details h4 {
  font-size: 1.1rem;
  font-weight: 700;
}
.song-details p {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.6);
}
.music-controls {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
}
.music-btn {
  background: transparent;
  border: none;
  color: #fff;
  cursor: pointer;
  font-size: 1.1rem;
}
.play-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  padding-left: 2px;
}
.playback-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.6);
}
.progress-track {
  flex-grow: 1;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 2px;
}
.progress-fill {
  height: 100%;
  background: #fff;
  border-radius: 2px;
}

/* 3. Credit Card */
.preview-card-chip {
  margin-bottom: 1.5rem;
}
.preview-card-number {
  font-family: var(--font-mono);
  font-size: 1.25rem;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}
.preview-card-footer {
  display: flex;
  justify-content: space-between;
}
.card-label {
  font-size: 0.65rem;
  color: rgba(255, 255, 255, 0.6);
  display: block;
}
.card-val {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

/* 4. Login Form */
.preview-form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
}
.preview-form h4 {
  text-align: center;
  margin-bottom: 0.25rem;
  font-size: 1.1rem;
}
.preview-input {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  color: #fff;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  outline: none;
}
.preview-submit {
  background: #fff;
  color: #000;
  border: none;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 0.25rem;
}

/* Preview Select Tabs */
.preview-type-tabs {
  position: absolute;
  bottom: 1rem;
  display: flex;
  gap: 0.5rem;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  z-index: 15;
}

.preview-select-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: var(--transition);
}

.preview-select-btn:hover {
  color: #fff;
}

.preview-select-btn.active {
  background: var(--accent-cyan);
  color: #fff;
  box-shadow: 0 2px 8px rgba(6, 182, 212, 0.4);
}

/* Code Output Panel */
.code-panel {
  max-height: 80vh;
}

.code-container {
  position: relative;
  background: rgba(5, 7, 18, 0.9);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  flex-grow: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.code-container pre {
  margin: 0;
  overflow: auto;
  flex-grow: 1;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--accent-cyan);
}

.copy-btn {
  background: linear-gradient(135deg, var(--accent-cyan) 0%, var(--accent-purple) 100%);
  color: #fff;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  transition: opacity var(--transition);
  margin-top: 1rem;
}

.copy-btn:hover {
  opacity: 0.9;
  box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
}

/* Keyframes Pulse */
@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.6; }
  100% { transform: scale(1); opacity: 1; }
}

/* Footer layout */
footer {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.8rem;
  padding: 1rem 0;
  border-top: 1px solid var(--border-color);
}
footer a {
  color: var(--accent-cyan);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* Monetization & Pro Upgrade Styling */
.pro-badge-btn {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #000;
  border: none;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 0.85rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.4);
  transition: var(--transition);
  animation: pulse-glow 2s infinite;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.pro-badge-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.7);
}
@keyframes pulse-glow {
  0% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
  50% { box-shadow: 0 0 20px rgba(245, 158, 11, 0.7); }
  100% { box-shadow: 0 0 12px rgba(245, 158, 11, 0.4); }
}

.code-panel-header {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 0.5rem;
  margin-bottom: 0.75rem;
}
.code-tab-btn {
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  padding: 0.4rem 0.8rem;
  cursor: pointer;
  border-radius: 6px;
  transition: var(--transition);
}
.code-tab-btn:hover {
  color: #fff;
}
.code-tab-btn.active {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px solid var(--border-color);
}
.code-tab-btn.locked {
  color: #d1d5db;
  opacity: 0.75;
}
.code-tab-btn.locked:hover {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
}

.pro-modal {
  border: none;
  background: transparent;
  padding: 0;
  margin: auto;
  max-width: 500px;
  width: 90%;
  outline: none;
}
.pro-modal::backdrop {
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(8px);
}
.pro-modal-content {
  background: #0b0f19;
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  color: #fff;
  position: relative;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 30px rgba(245, 158, 11, 0.15);
}
.close-modal-btn {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.75rem;
  cursor: pointer;
  transition: var(--transition);
  line-height: 1;
}
.close-modal-btn:hover {
  color: #fff;
}
.pro-modal-header {
  text-align: center;
  margin-bottom: 1.75rem;
}
.pro-modal-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.premium-text {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 900;
}
.pro-modal-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.35rem;
}
.pro-features-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.pro-feature-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.feature-icon {
  font-size: 1.3rem;
  background: rgba(245, 158, 11, 0.1);
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(245, 158, 11, 0.2);
}
.pro-feature-item h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}
.pro-feature-item p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}
.pro-pricing {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 1.5rem;
}
.price-tier {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.price-value {
  font-size: 2.5rem;
  font-weight: 800;
  color: #fff;
  font-family: var(--font-mono);
}
.price-period {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pro-buy-btn {
  width: 100%;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  color: #000;
  text-decoration: none;
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1rem;
  text-align: center;
  padding: 0.85rem;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
  transition: var(--transition);
}
.pro-buy-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.5);
}
