/* ============================================
   HYDROGEN ORBITAL VISUALIZER - PREMIUM STYLES
   ============================================ */

/* CSS Variables for theming - Dark Theme (Default) */
:root {
  --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --accent-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --dark-gradient: linear-gradient(135deg, #0c0c1e 0%, #1a1a3e 100%);

  --bg-dark: #0a0a1a;
  --bg-card: rgba(20, 20, 40, 0.85);
  --bg-card-hover: rgba(30, 30, 60, 0.95);
  --bg-topbar: rgba(15, 15, 35, 0.95);
  --bg-canvas: radial-gradient(circle at center, rgba(20, 20, 60, 0.8) 0%, rgba(10, 10, 30, 0.95) 100%);

  --text-primary: #ffffff;
  --text-secondary: #b8b8d0;
  --text-muted: #6b6b8a;

  --accent-cyan: #00f2fe;
  --accent-purple: #764ba2;
  --accent-pink: #f5576c;
  --accent-blue: #4facfe;

  --border-color: rgba(255, 255, 255, 0.1);
  --glow-color: rgba(79, 172, 254, 0.3);

  --font-main: 'Poppins', sans-serif;
  --font-display: 'Orbitron', sans-serif;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 30px;

  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 15px 50px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 30px var(--glow-color);
}

/* Light Theme */
[data-theme="light"] {
  --dark-gradient: linear-gradient(135deg, #e8eaf6 0%, #f5f5f5 100%);

  --bg-dark: #f0f2f5;
  --bg-card: rgba(255, 255, 255, 0.9);
  --bg-card-hover: rgba(255, 255, 255, 0.98);
  --bg-topbar: rgba(255, 255, 255, 0.95);
  --bg-canvas: radial-gradient(circle at center, rgba(230, 235, 255, 0.9) 0%, rgba(200, 210, 240, 0.95) 100%);

  --text-primary: #1a1a2e;
  --text-secondary: #4a4a6a;
  --text-muted: #7a7a9a;

  --border-color: rgba(0, 0, 0, 0.1);
  --glow-color: rgba(102, 126, 234, 0.2);

  --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 15px 50px rgba(0, 0, 0, 0.15);
}

/* Reset & Base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 14px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  background: var(--dark-gradient);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.4s ease, color 0.4s ease;
}

/* Background Particle Effects */
.background-effects {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 6px;
  height: 6px;
  background: var(--accent-cyan);
  border-radius: 50%;
  opacity: 0.4;
  animation: float 15s ease-in-out infinite;
}

.particle:nth-child(1) {
  left: 10%;
  top: 20%;
  animation-delay: 0s;
}

.particle:nth-child(2) {
  left: 20%;
  top: 60%;
  animation-delay: 3s;
}

.particle:nth-child(3) {
  left: 60%;
  top: 30%;
  animation-delay: 6s;
}

.particle:nth-child(4) {
  left: 80%;
  top: 70%;
  animation-delay: 9s;
}

.particle:nth-child(5) {
  left: 40%;
  top: 85%;
  animation-delay: 12s;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) rotate(0deg);
    opacity: 0.4;
  }

  50% {
    transform: translateY(-30px) rotate(180deg);
    opacity: 0.8;
  }
}

/* Main Container - Strict 100vh */
.main-container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* Top Bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 20px;
  background: var(--bg-topbar);
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  flex-shrink: 0;
}

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

.title-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.atom-icon {
  font-size: 1.8rem;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.1);
  }
}

.topbar h1 {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 1px;
  line-height: 1.2;
}

.topbar .subtitle {
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 300;
}

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

/* Theme Toggle Button */
.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.05);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: rotate(20deg) scale(1.1);
  border-color: var(--accent-cyan);
}

.theme-icon {
  font-size: 1.3rem;
  transition: transform 0.3s ease;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 30px;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  animation: statusPulse 1.5s ease-in-out infinite;
}

.status-dot.running {
  background: #00ff88;
  box-shadow: 0 0 10px #00ff88;
}

.status-dot.ready {
  background: #4facfe;
  box-shadow: 0 0 10px #4facfe;
}

.status-dot.paused {
  background: #ffa500;
  box-shadow: 0 0 10px #ffa500;
}

@keyframes statusPulse {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.9);
  }
}

.status-text {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* Content Wrapper - 3 Column Layout */
.content-wrapper {
  display: grid;
  grid-template-columns: 320px 1fr 320px;
  gap: 10px;
  flex: 1;
  padding: 10px 15px;
  overflow: hidden;
  align-items: stretch;
}

/* Glass Card Effect */
.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Panel Titles */
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 15px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.panel-title .icon {
  font-size: 1.3rem;
}

/* Control Panel */
.control-panel {
  padding: 15px;
  overflow-y: auto;
  max-height: 100%;
}

.control-group {
  margin-bottom: 18px;
}

.control-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.control-header label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.value-badge {
  background: var(--primary-gradient);
  color: white;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  min-width: 35px;
  text-align: center;
}

/* Custom Range Slider */
.slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  outline: none;
  margin: 8px 0;
  cursor: pointer;
}

.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  background: var(--accent-gradient);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 0 15px var(--accent-cyan);
  transition: transform 0.2s ease;
}

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

.slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--accent-gradient);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 0 15px var(--accent-cyan);
}

.control-info {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 5px;
  line-height: 1.5;
}

/* Section Titles */
.section-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
}

/* Preset Buttons */
.presets-section {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.preset-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
}

.preset-btn {
  padding: 8px 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.preset-btn:hover {
  background: var(--primary-gradient);
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.preset-btn.active {
  background: var(--accent-gradient);
  border-color: transparent;
}

/* View Options */
.view-options {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.view-buttons {
  display: flex;
  gap: 6px;
}

.view-btn {
  flex: 1;
  padding: 8px 6px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
}

.view-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.view-btn.active {
  background: var(--accent-gradient);
  color: var(--text-primary);
  border-color: transparent;
}

/* Animation Toggle */
.animation-toggle {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid var(--border-color);
}

.toggle-container {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.toggle-container input {
  display: none;
}

.toggle-slider {
  width: 48px;
  height: 26px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 30px;
  position: relative;
  transition: background 0.3s ease;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  top: 3px;
  left: 3px;
  transition: transform 0.3s ease;
}

.toggle-container input:checked+.toggle-slider {
  background: var(--accent-gradient);
}

.toggle-container input:checked+.toggle-slider::before {
  transform: translateX(22px);
}

.toggle-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

/* Visualization Area */
.visualization-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 100%;
  overflow: hidden;
}

.canvas-wrapper {
  position: relative;
  padding: 10px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex: 1;
  min-height: 0;
}

#orbitalCanvas {
  border-radius: var(--radius-md);
  background: var(--bg-canvas);
  box-shadow: inset 0 0 50px var(--glow-color);
  max-height: 100%;
  max-width: 100%;
}

.canvas-overlay {
  position: absolute;
  top: 25px;
  left: 25px;
  right: 25px;
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}

.orbital-label {
  background: var(--primary-gradient);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

/* Action Buttons */
.action-buttons {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border: none;
  border-radius: var(--radius-xl);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.action-btn.primary {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.action-btn.primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.5);
}

.action-btn.secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.action-btn.secondary:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: var(--accent-cyan);
}

/* Info Panel */
.info-panel {
  padding: 15px;
  overflow-y: auto;
  max-height: 100%;
}

.info-card {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-bottom: 12px;
}

.info-card:last-child {
  margin-bottom: 0;
}

.info-card h3 {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 8px;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.info-card h4 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.highlight-card {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
  border: 1px solid rgba(102, 126, 234, 0.3);
  text-align: center;
}

.orbital-type-badge {
  display: inline-block;
  padding: 4px 16px;
  background: var(--secondary-gradient);
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

/* Info Row */
.info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.info-label {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.info-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  font-family: var(--font-display);
}

/* Energy Bar */
.energy-bar {
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  overflow: hidden;
}

.energy-fill {
  height: 100%;
  background: var(--secondary-gradient);
  border-radius: 10px;
  transition: width 0.5s ease;
}

/* Quantum Grid */
.quantum-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.quantum-item {
  text-align: center;
  padding: 10px 5px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius-sm);
}

.q-symbol {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 3px;
}

.q-value {
  display: block;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-display);
}

.q-name {
  display: block;
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* Explanation Card */
.explanation-card {
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.1) 0%, rgba(0, 242, 254, 0.1) 100%);
  border: 1px solid rgba(79, 172, 254, 0.2);
}

.explanation-card p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.7;
}

/* Rules Card */
.rules-card {
  background: rgba(245, 87, 108, 0.08);
  border: 1px solid rgba(245, 87, 108, 0.2);
}

.rules-list {
  list-style: none;
  font-size: 0.8rem;
}

.rules-list li {
  padding: 5px 0;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.rules-list li:last-child {
  border-bottom: none;
}

/* Electron Configuration */
.config-display {
  text-align: center;
  padding: 10px;
}

.config-notation {
  font-size: 1.4rem;
  font-family: var(--font-display);
  color: var(--accent-cyan);
  letter-spacing: 2px;
}

.config-notation sup {
  font-size: 0.9rem;
  color: var(--accent-pink);
}

/* Footer */
.footer {
  text-align: center;
  padding: 8px 15px;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .content-wrapper {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .control-panel,
  .info-panel {
    order: 2;
  }

  .visualization-area {
    order: 1;
  }

  .preset-grid {
    grid-template-columns: repeat(5, 1fr);
  }
}

@media (max-width: 768px) {
  html {
    font-size: 13px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  #orbitalCanvas {
    width: 350px;
    height: 350px;
  }

  .preset-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .quantum-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .main-container {
    padding: 10px;
  }

  #orbitalCanvas {
    width: 280px;
    height: 280px;
  }

  .action-buttons {
    flex-direction: column;
  }

  .action-btn {
    width: 100%;
    justify-content: center;
  }
}

/* Animations */
@keyframes glow {

  0%,
  100% {
    box-shadow: 0 0 20px var(--glow-color);
  }

  50% {
    box-shadow: 0 0 40px var(--glow-color), 0 0 60px var(--glow-color);
  }
}

.canvas-wrapper:hover #orbitalCanvas {
  animation: glow 2s ease-in-out infinite;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb {
  background: var(--primary-gradient);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-gradient);
}