/*
  Liquid Glass UI Design System - Shared Library
  Version: 1.0
  Author: Dr. Gerard Joseph Lim
  Shared components for high-contrast dark-mode scientific simulations.
*/

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

:root {
  /* Colors */
  --bg-color: #000000;
  --bg-secondary: #0a0a0a;
  
  --text-main: #ffffff;
  --text-muted: rgba(255, 255, 255, 0.6);
  --text-subtle: rgba(255, 255, 255, 0.3);
  
  --primary: #38bdf8;
  --primary-dark: #0284c7;
  --primary-light: #7dd3fc;
  
  --positive: #ff4d4d;
  --negative: #4d94ff;
  --neutral: #9ca3af;
  --warning: #fbbf24;
  --error: #ef4444;
  
  /* Glass Tokens */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.15);
  --glass-border-light: rgba(255, 255, 255, 0.3);
  --glass-shadow:
    inset 0 0 20px rgba(255, 255, 255, 0.05),
    inset 0 0 5px rgba(255, 255, 255, 0.1),
    0 5px 15px rgba(0, 0, 0, 0.5);
  
  --aberration-red: rgba(255, 0, 0, 0.2);
  --aberration-cyan: rgba(0, 255, 255, 0.2);
  --chromatic-shadow:
    -2px 0 2px var(--aberration-red),
    2px 0 2px var(--aberration-cyan),
    inset 0 0 20px rgba(255, 255, 255, 0.1);
  
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

/* Global Reset Utilities (optional, applied to bodies using layout) */
.glass-simulation-body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  margin: 0;
  overflow: hidden;
  height: 100vh;
  width: 100vw;
}

/* Liquid Glass Panel Container */
.liquid-glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border-light);
  border-left: 1px solid var(--glass-border-light);
  box-shadow: var(--chromatic-shadow);
  border-radius: 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
}

/* Subtle reflection line */
.liquid-glass::before {
  content: '';
  position: absolute;
  top: 0;
  left: -50%;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right,
      transparent,
      rgba(255, 255, 255, 0.05),
      transparent);
  transform: skewX(-25deg);
  pointer-events: none;
}

/* Typography elements */
.gradient-title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, #ffffff 0%, #cccccc 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.3);
  margin: 0;
}

/* Standard Buttons */
.btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 10px 20px;
  border-radius: 12px;
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  position: relative;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.btn:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

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

.btn-primary {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.2), rgba(56, 189, 248, 0.1));
  border-color: rgba(56, 189, 248, 0.3);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
}

.btn-primary:hover {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.4), rgba(56, 189, 248, 0.2));
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

.btn-success {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
  color: #ccffcc;
  border-color: rgba(34, 197, 94, 0.3);
  box-shadow: 0 0 15px rgba(34, 197, 94, 0.2);
}

.btn-success:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.4), rgba(34, 197, 94, 0.2));
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.2), rgba(239, 68, 68, 0.1));
  color: #ffcccc;
  border-color: rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.2);
}

.btn-danger:hover {
  background: linear-gradient(135deg, rgba(239, 68, 68, 0.4), rgba(239, 68, 68, 0.2));
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

.btn-warning {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.2), rgba(234, 179, 8, 0.1));
  color: #fff8cc;
  border-color: rgba(234, 179, 8, 0.3);
  box-shadow: 0 0 15px rgba(234, 179, 8, 0.2);
}

.btn-warning:hover {
  background: linear-gradient(135deg, rgba(234, 179, 8, 0.4), rgba(234, 179, 8, 0.2));
  box-shadow: 0 0 20px rgba(234, 179, 8, 0.4);
}

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

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.4);
  transition: .4s;
  border-radius: 34px;
  border: 1px solid var(--glass-border);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: radial-gradient(circle at 30% 30%, #fff, #ccc);
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.4);
}

input:checked + .slider {
  background-color: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background: radial-gradient(circle at 30% 30%, #fff, var(--primary));
  box-shadow: 0 0 10px var(--primary);
}

/* Standard Range inputs */
input[type="range"] {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(0, 0, 0, 0.4);
  height: 6px;
  border-radius: 3px;
  outline: none;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 30% 30%, #fff, #ccc);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.25);
  box-shadow: 0 0 10px #fff;
}

input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  background: radial-gradient(circle at 30% 30%, #fff, #ccc);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
  transition: transform 0.1s;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.25);
  box-shadow: 0 0 10px #fff;
}

/* Input Fields (Text, Number, Dropdowns) */
input[type="text"],
input[type="number"],
select {
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  padding: 6px 10px;
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: 0.9rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 8px rgba(56, 189, 248, 0.3);
}

/* Splash Overlay Modal */
.splash-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.splash-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-modal {
  width: 90%;
  max-width: 500px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: modalPop 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.splash-header {
  text-align: center;
}

.splash-header h1,
.splash-header h2 {
  font-size: 2rem;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #ffffff 0%, #bbbbbb 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
  margin-top: 0;
}

.splash-header .author {
  color: var(--primary);
  font-weight: 500;
  font-size: 0.95rem;
  margin: 0;
}

.splash-body h3 {
  font-size: 1.1rem;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-main);
  margin-top: 0;
}

.splash-body ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
}

.splash-body li {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.4;
  position: relative;
  padding-left: 20px;
}

.splash-body li::before {
  content: '→';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: bold;
}

.splash-body strong {
  color: var(--text-main);
}

.splash-footer {
  display: flex;
  justify-content: center;
}

/* Floating Help Button */
.help-btn {
  pointer-events: auto;
  position: absolute;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 900;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: var(--chromatic-shadow);
}

.help-btn:hover {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.2);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

/* Close button for Property panels */
.close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  padding: 4px;
  line-height: 1;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #fff;
  text-shadow: 0 0 10px #fff;
}

/* Signature Footer Branding */
.signature-footer,
a.signature-footer {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  z-index: 100;
  transition: all 0.3s ease;
  padding: 8px 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  pointer-events: auto;
}

.signature-footer:hover,
a.signature-footer:hover {
  color: var(--primary);
  background: rgba(56, 189, 248, 0.05);
  border-color: rgba(56, 189, 248, 0.3);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.2);
  text-shadow: 0 0 8px rgba(56, 189, 248, 0.5);
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  text-align: left;
}

.data-table thead {
  border-bottom: 1px solid var(--glass-border);
}

.data-table th {
  padding: 8px 6px;
  color: var(--text-muted);
  font-weight: 600;
}

.data-table td {
  padding: 8px 6px;
  color: var(--text-main);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Shared Keyframe Animations */
@keyframes modalPop {
  from {
    opacity: 0;
    transform: scale(0.8) translateY(20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translate(30px, -50%) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translate(0, -50%) scale(1);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}
