/* ==========================================================================
   KUANTUM ÇEKİLİŞ - DESIGN SYSTEM & STYLESHEET
   ========================================================================== */

/* Variables & Base System */
:root {
  --font-display: 'Outfit', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  /* Color Palette - HSL Tailored */
  --bg-space: #060713;
  --bg-glass: rgba(10, 12, 30, 0.45);
  --bg-glass-heavy: rgba(8, 10, 24, 0.90);
  --border-glass: rgba(255, 255, 255, 0.07);
  --border-glass-active: rgba(255, 255, 255, 0.15);
  
  --neon-cyan: hsl(190, 100%, 50%);
  --neon-purple: hsl(270, 85%, 60%);
  --neon-green: hsl(140, 100%, 50%);
  --neon-pink: hsl(325, 100%, 55%);
  --neon-gold: hsl(45, 100%, 50%);
  --neon-silver: hsl(200, 10%, 75%);
  --neon-bronze: hsl(28, 60%, 50%);
  --neon-red: hsl(0, 100%, 60%);

  /* Shadows & Glows */
  --glow-cyan: 0 0 15px rgba(0, 242, 254, 0.4);
  --glow-purple: 0 0 15px rgba(157, 78, 221, 0.4);
  --glow-gold: 0 0 25px rgba(255, 193, 7, 0.5);
  --glow-silver: 0 0 25px rgba(186, 193, 204, 0.4);
  --glow-bronze: 0 0 25px rgba(205, 127, 50, 0.4);
  
  --transition-smooth: all 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  --transition-fast: all 0.15s ease-out;
}

/* Base Reset & Scrollbar styling */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg-space);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(26, 21, 62, 0.3) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(13, 37, 58, 0.3) 0%, transparent 40%);
  color: #e0e5f5;
  font-family: var(--font-display);
  height: 100vh;
  overflow: hidden;
  position: relative;
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.25);
}

/* Typography Utilities */
h1, h2, h3, h4 {
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* Glow Text Utility Classes */
.glow-text-cyan {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 242, 254, 0.6);
}
.glow-text-purple {
  color: var(--neon-purple);
  text-shadow: 0 0 10px rgba(157, 78, 221, 0.6);
}
.glow-text-gold {
  color: var(--neon-gold);
  text-shadow: 0 0 15px rgba(255, 193, 7, 0.6);
}
.glow-text-green {
  color: var(--neon-green);
  text-shadow: 0 0 10px rgba(0, 230, 118, 0.6);
}

/* Glow Elements */
.glow-cyan { filter: drop-shadow(0 0 8px rgba(0, 242, 254, 0.8)); }
.glow-purple { filter: drop-shadow(0 0 8px rgba(157, 78, 221, 0.8)); }
.glow-gold { filter: drop-shadow(0 0 12px rgba(255, 193, 7, 0.8)); }
.glow-silver { filter: drop-shadow(0 0 12px rgba(186, 193, 204, 0.8)); }
.glow-bronze { filter: drop-shadow(0 0 12px rgba(205, 127, 50, 0.8)); }

/* Glassmorphism panel base */
.glass {
  background: var(--bg-glass);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-glass);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Buttons System */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition-smooth);
  user-select: none;
  font-size: 0.85rem;
}

.btn-primary {
  background: linear-gradient(135deg, var(--neon-purple), hsl(290, 80%, 50%));
  color: #fff;
  border-color: rgba(255, 255, 255, 0.1);
  box-shadow: var(--glow-purple);
}
.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 0 25px rgba(157, 78, 221, 0.8);
  filter: brightness(1.1);
}
.btn-primary:active:not(:disabled) {
  transform: translateY(0);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.04);
  color: #e0e5f5;
  border-color: var(--border-glass);
}
.btn-secondary:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--border-glass-active);
  color: #fff;
}

.btn-danger {
  background: rgba(255, 59, 48, 0.1);
  color: #ff453a;
  border-color: rgba(255, 59, 48, 0.2);
}
.btn-danger:hover:not(:disabled) {
  background: rgba(255, 59, 48, 0.25);
  border-color: rgba(255, 59, 48, 0.4);
  color: #ff6b64;
}

.btn-large {
  padding: 14px 28px;
  font-size: 1rem;
  border-radius: 12px;
}

.btn-small {
  padding: 6px 12px;
  font-size: 0.75rem;
  border-radius: 6px;
}

.btn-icon {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 8px;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
  filter: none !important;
}

/* Glow Buttons */
.glow-btn-purple {
  position: relative;
  overflow: hidden;
}
.glow-btn-purple::before {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  transition: 0.5s;
}
.glow-btn-purple:hover::before {
  left: 100%;
}

.glow-btn-gold {
  background: linear-gradient(135deg, var(--neon-gold), #ff9f0a);
  color: #000;
  box-shadow: var(--glow-gold);
  border-color: rgba(255,255,255,0.2);
}
.glow-btn-gold:hover {
  box-shadow: 0 0 30px rgba(255, 193, 7, 0.9) !important;
  transform: scale(1.03) translateY(-2px) !important;
}

/* Overlay & Intro Dialog */
.overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(3, 4, 10, 0.7);
  backdrop-filter: blur(25px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}
.overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.intro-card {
  width: 90%;
  max-width: 480px;
  padding: 40px;
  border-radius: 24px;
  text-align: center;
  position: relative;
  overflow: hidden;
  animation: scale-up 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.intro-card::before {
  content: '';
  position: absolute;
  top: -50%; left: -50%;
  width: 200%; height: 200%;
  background: radial-gradient(circle, rgba(0, 242, 254, 0.08) 0%, transparent 60%);
  pointer-events: none;
}

.logo-container {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  background: rgba(0, 242, 254, 0.05);
  border: 1.5px solid rgba(0, 242, 254, 0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.logo-icon {
  width: 40px;
  height: 40px;
}

.pulse-ring {
  position: absolute;
  width: 120px;
  height: 120px;
  border: 1px solid rgba(0, 242, 254, 0.15);
  border-radius: 50%;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  animation: pulse-ring-anim 3s infinite linear;
}

.intro-card h1 {
  font-size: 2.2rem;
  margin-bottom: 8px;
  letter-spacing: 0.08em;
}

.subtitle {
  font-size: 0.85rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 24px;
}

.description {
  font-size: 0.95rem;
  line-height: 1.6;
  color: #a0a7c4;
  margin-bottom: 32px;
}

/* Dashboard Layout */
.dashboard-layout {
  display: flex;
  width: 100vw;
  height: 100vh;
  position: relative;
}

/* Sidebar Styling */
.sidebar {
  width: 380px;
  height: 100%;
  border-right: 1px solid var(--border-glass);
  display: flex;
  flex-direction: column;
  z-index: 20;
  transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  flex-shrink: 0;
  background: var(--bg-glass-heavy);
}

.sidebar.collapsed {
  transform: translateX(-100%);
  position: absolute;
}

.sidebar-header {
  padding: 24px;
  border-bottom: 1px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 28px;
  height: 28px;
}

.brand h2 {
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  color: #fff;
  line-height: 1.1;
}

.brand span.version {
  font-size: 0.62rem;
  font-family: var(--font-mono);
  color: rgba(255, 255, 255, 0.35);
  letter-spacing: 0.05em;
}

.sidebar-scroll-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* Panel Sections */
.panel-section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(255, 255, 255, 0.7);
}

.section-title i {
  width: 18px;
  height: 18px;
  color: var(--neon-cyan);
}

.section-title h3 {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
}

/* JSON Input Container */
.json-container {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-glass);
  background: rgba(0, 0, 0, 0.25);
  transition: var(--transition-smooth);
}

.json-container:focus-within {
  border-color: var(--neon-purple);
  box-shadow: 0 0 15px rgba(157, 78, 221, 0.15);
}

textarea#json-input {
  width: 100%;
  height: 160px;
  background: transparent;
  border: none;
  outline: none;
  padding: 16px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: #9cb3e6;
  resize: vertical;
  line-height: 1.5;
}

.badge {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 0.65rem;
  font-weight: 700;
  font-family: var(--font-mono);
  padding: 3px 8px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
  opacity: 0.8;
}

.badge-success {
  background: rgba(0, 230, 118, 0.1);
  color: var(--neon-green);
  border: 1px solid rgba(0, 230, 118, 0.2);
}

.badge-error {
  background: rgba(255, 69, 58, 0.1);
  color: var(--neon-red);
  border: 1px solid rgba(255, 69, 58, 0.2);
}

.button-group {
  display: flex;
  gap: 8px;
}

/* Counter Box */
.counter-display {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px;
  text-align: center;
}

.counter-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.counter-label {
  font-size: 0.6rem;
  letter-spacing: 0.12em;
  color: rgba(255, 255, 255, 0.35);
  font-weight: 600;
}

.counter-value {
  font-size: 1.8rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

/* Swtiches & Inputs settings */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
}

.setting-item.flex-column {
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
}

.setting-info {
  display: flex;
  flex-direction: column;
}

.setting-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
}

.setting-desc {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.4);
}

/* Switch Toggle CSS */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-switch {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: rgba(255,255,255,0.1);
  transition: .4s;
  border-radius: 24px;
  border: 1px solid var(--border-glass);
}

.slider-switch:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-switch {
  background-color: var(--neon-purple);
  box-shadow: 0 0 10px rgba(157, 78, 221, 0.4);
}

input:checked + .slider-switch:before {
  transform: translateX(20px);
}

/* Slider Controls */
.setting-slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  font-weight: 600;
}

.setting-value {
  color: var(--neon-cyan);
  font-family: var(--font-mono);
}

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

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--neon-cyan);
  cursor: pointer;
  box-shadow: var(--glow-cyan);
  transition: transform 0.15s ease;
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

/* Terminal Log */
.terminal-section {
  flex: 1;
  min-height: 150px;
}

.terminal-box {
  flex: 1;
  height: 140px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 10px;
  padding: 12px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.terminal-line {
  color: #a5b7d6;
  word-break: break-all;
}

.terminal-line.system {
  color: rgba(255,255,255,0.35);
}

.terminal-line.success {
  color: var(--neon-green);
}

.terminal-line.danger {
  color: var(--neon-red);
}

.sidebar-footer {
  padding: 24px;
  border-top: 1px solid var(--border-glass);
}

/* Viewport Area */
.viewport {
  flex: 1;
  height: 100%;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

canvas#quantum-field {
  width: 100%;
  height: 100%;
  display: block;
}

/* HUD Overlay */
.canvas-hud {
  position: absolute;
  top: 24px;
  left: 24px; right: 24px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
  z-index: 10;
}

.glass-hud {
  background: rgba(10, 12, 30, 0.4);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 10px 18px;
  display: flex;
  gap: 20px;
  pointer-events: auto;
}

.hud-item {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hud-label {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.4);
}

.hud-value {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-weight: 700;
}

/* Floating HUD elements */
.floating-trigger {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 15;
}

.hidden {
  display: none !important;
}

/* Ceremony & Podium Display */
.ceremony-container {
  width: 95%;
  max-width: 980px;
  text-align: center;
  animation: scale-up 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ceremony-header {
  margin-bottom: 48px;
}

.trophy-icon {
  width: 56px;
  height: 56px;
  margin-bottom: 16px;
}

.ceremony-header h1 {
  font-size: 2.5rem;
  margin-bottom: 12px;
  letter-spacing: 0.08em;
}

.ceremony-header p {
  color: #a0a6cc;
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
}

/* Podium Grid */
.podium-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
  width: 100%;
  max-width: 820px;
  margin-bottom: 48px;
  align-items: flex-end;
}

.podium-card {
  border-radius: 20px;
  padding: 36px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.podium-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Sequential Reveal States */
.podium-card.hide-card {
  opacity: 0;
  transform: scale(0.3) translateY(120px);
  pointer-events: none;
  transition: transform 0.9s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.8s ease-out, border-color 0.3s ease;
}

.podium-card.reveal-card {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

.podium-card.best.reveal-card {
  transform: scale(1.06) translateY(-16px);
}

.podium-card.best.reveal-card:hover {
  transform: scale(1.06) translateY(-24px);
}

.podium-rank {
  position: absolute;
  top: -16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.95rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.award-icon, .crown-icon {
  width: 38px;
  height: 38px;
  margin-bottom: 20px;
}

.podium-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 6px;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.podium-card p {
  font-size: 0.85rem;
  color: #9098be;
  margin-bottom: 24px;
}

.podium-footer {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 6px 16px;
  border-radius: 30px;
  background: rgba(255,255,255,0.05);
}

/* Rank specific aesthetics */
.podium-card.gold {
  border-color: rgba(255, 193, 7, 0.2);
  height: 290px;
}
.podium-card.gold:hover {
  box-shadow: 0 10px 40px rgba(255, 193, 7, 0.12);
  border-color: rgba(255, 193, 7, 0.4);
}
.podium-card.gold .podium-rank {
  background: var(--neon-gold);
  color: #000;
}
.podium-card.gold .podium-footer {
  color: var(--neon-gold);
  background: rgba(255, 193, 7, 0.1);
}

.podium-card.silver {
  border-color: rgba(186, 193, 204, 0.15);
  height: 250px;
}
.podium-card.silver:hover {
  box-shadow: 0 10px 30px rgba(186, 193, 204, 0.1);
  border-color: rgba(186, 193, 204, 0.35);
}
.podium-card.silver .podium-rank {
  background: var(--neon-silver);
  color: #000;
}
.podium-card.silver .podium-footer {
  color: var(--neon-silver);
  background: rgba(186, 193, 204, 0.1);
}

.podium-card.bronze {
  border-color: rgba(205, 127, 50, 0.15);
  height: 230px;
}
.podium-card.bronze:hover {
  box-shadow: 0 10px 30px rgba(205, 127, 50, 0.1);
  border-color: rgba(205, 127, 50, 0.35);
}
.podium-card.bronze .podium-rank {
  background: var(--neon-bronze);
  color: #fff;
}
.podium-card.bronze .podium-footer {
  color: var(--neon-bronze);
  background: rgba(205, 127, 50, 0.1);
}

.ceremony-actions {
  display: flex;
  gap: 16px;
}

/* Sound Indicator Bubble */
.sound-indicator-bubble {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: rgba(10, 12, 30, 0.7);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-glass-active);
  color: var(--neon-green);
  border-radius: 30px;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 12;
  box-shadow: 0 4px 15px rgba(0,230,118,0.15);
}

/* ==========================================================================
   ANIMATIONS & KEYFRAMES
   ========================================================================== */

@keyframes pulse-ring-anim {
  0% {
    transform: translateX(-50%) scale(0.85);
    opacity: 0.8;
  }
  50% {
    transform: translateX(-50%) scale(1.15);
    opacity: 0.3;
  }
  100% {
    transform: translateX(-50%) scale(1.4);
    opacity: 0;
  }
}

@keyframes scale-up {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-spin-slow {
  animation: spin 16s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .podium-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    align-items: stretch;
  }
  .podium-card.gold, .podium-card.silver, .podium-card.bronze {
    height: auto;
    padding: 20px;
  }
  .podium-card.gold {
    order: -1;
  }
  .ceremony-container {
    overflow-y: auto;
    padding: 40px 10px;
    height: 100%;
  }
}

@media (max-width: 768px) {
  .dashboard-layout {
    flex-direction: column;
  }
  
  .sidebar {
    width: 100%;
    height: auto;
    max-height: 50vh;
    border-right: none;
    border-bottom: 1px solid var(--border-glass);
    position: absolute;
    bottom: 0; left: 0; right: 0;
    transform: translateY(100%);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .sidebar.active {
    transform: translateY(0);
  }

  .sidebar.collapsed {
    transform: translateY(100%);
  }

  .viewport {
    height: 100vh;
    width: 100vw;
  }

  .canvas-hud {
    top: 12px;
    left: 12px; right: 12px;
  }

  .glass-hud {
    padding: 6px 12px;
    gap: 10px;
  }
}
