/* CLARKSTARK - Iron Forge Workshop Theme */
/* Tony Stark workshop aesthetic with blueprint/schematic patterns */

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

:root {
  /* Cyber Color Palette */
  --color-bg: #0a0a0f;
  --color-bg-dark: #050508;
  --color-surface: #12121a;
  --color-surface-raised: #1a1a25;
  --color-surface-glow: #1e1e2d;

  /* Neon Colors */
  --neon-cyan: #00f0ff;
  --neon-cyan-dim: #00a8b3;
  --neon-magenta: #ff00ff;
  --neon-magenta-dim: #b300b3;
  --neon-purple: #bf00ff;
  --neon-blue: #4d4dff;
  --neon-green: #00ff88;
  --neon-green-dim: #00b35f;
  --neon-yellow: #ffff00;
  --neon-orange: #ff6600;
  --neon-red: #ff0055;
  --neon-pink: #ff0080;

  /* Functional Colors */
  --color-primary: var(--neon-cyan);
  --color-primary-dim: var(--neon-cyan-dim);
  --color-success: var(--neon-green);
  --color-success-dim: var(--neon-green-dim);
  --color-warning: var(--neon-orange);
  --color-danger: var(--neon-red);
  --color-protein: var(--neon-green);
  --color-carbs: var(--neon-yellow);
  --color-fat: var(--neon-orange);
  --color-cals: var(--neon-purple);

  /* Text */
  --color-text: #f0f0f5;
  --color-text-secondary: #a0a0b8;
  --color-text-muted: #606078;
  --color-text-dim: #404055;

  /* Borders */
  --color-border: #2a2a3d;
  --color-border-glow: #3a3a50;

  /* Glows */
  --glow-cyan: 0 0 20px rgba(0, 240, 255, 0.3), 0 0 40px rgba(0, 240, 255, 0.1);
  --glow-green: 0 0 20px rgba(0, 255, 136, 0.3), 0 0 40px rgba(0, 255, 136, 0.1);
  --glow-magenta: 0 0 20px rgba(255, 0, 255, 0.3), 0 0 40px rgba(255, 0, 255, 0.1);
  --glow-purple: 0 0 20px rgba(191, 0, 255, 0.3), 0 0 40px rgba(191, 0, 255, 0.1);

  /* Typography */
  --font-display: 'Orbitron', sans-serif;
  --font-body: 'Rajdhani', sans-serif;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  /* Touch */
  --touch-min: 48px;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

/* Tony Stark Workshop Background - Blueprint/Schematic Tile Pattern */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  /* Blueprint grid - main lines */
  background:
    /* Large grid squares */
    linear-gradient(90deg, rgba(0, 180, 216, 0.08) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 180, 216, 0.08) 1px, transparent 1px),
    /* Medium grid */
    linear-gradient(90deg, rgba(0, 180, 216, 0.04) 1px, transparent 1px),
    linear-gradient(0deg, rgba(0, 180, 216, 0.04) 1px, transparent 1px),
    /* Diagonal tech lines */
    linear-gradient(45deg, transparent 48%, rgba(0, 180, 216, 0.03) 49%, rgba(0, 180, 216, 0.03) 51%, transparent 52%),
    linear-gradient(-45deg, transparent 48%, rgba(0, 180, 216, 0.03) 49%, rgba(0, 180, 216, 0.03) 51%, transparent 52%);
  background-size:
    100px 100px,
    100px 100px,
    20px 20px,
    20px 20px,
    60px 60px,
    60px 60px;
  pointer-events: none;
  z-index: -2;
}

/* Arc Reactor Glow - Center */
body::after {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background:
    radial-gradient(circle at center, rgba(0, 200, 255, 0.08) 0%, transparent 40%),
    radial-gradient(circle at center, rgba(0, 150, 255, 0.05) 0%, transparent 60%);
  pointer-events: none;
  z-index: -1;
  opacity: 0.7;
}

/* Workshop Corner Accents */
.workshop-bg {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

/* Hexagon pattern overlay - like arc reactor segments */
.workshop-bg::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='52'%3E%3Cpath d='M30 0 L60 15 L60 37 L30 52 L0 37 L0 15 Z' fill='none' stroke='%2300b4d8' stroke-width='0.5' opacity='0.06'/%3E%3C/svg%3E");
  background-size: 60px 52px;
  animation: hexFloat 120s linear infinite;
}

/* Circuit traces */
.workshop-bg::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 300px;
  height: 300px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100' height='100'%3E%3Cpath d='M0 50 H30 L40 40 H60 L70 50 H100 M50 0 V30 L40 40 M50 100 V70 L60 60 L60 40' fill='none' stroke='%2300f0ff' stroke-width='1' opacity='0.08'/%3E%3Ccircle cx='40' cy='40' r='3' fill='%2300f0ff' opacity='0.1'/%3E%3Ccircle cx='60' cy='60' r='2' fill='%2300f0ff' opacity='0.08'/%3E%3C/svg%3E");
  background-size: 100px 100px;
  opacity: 0.5;
}

@keyframes hexFloat {
  0% { transform: translate(0, 0) rotate(0deg); }
  100% { transform: translate(-30px, -26px) rotate(0.5deg); }
}

/* Keep cyber-orb for bottom glow accent */
.cyber-orb {
  position: fixed;
  bottom: -200px;
  left: 50%;
  transform: translateX(-50%);
  width: 600px;
  height: 400px;
  background: radial-gradient(ellipse at center, rgba(0, 200, 255, 0.1) 0%, transparent 70%);
  pointer-events: none;
  z-index: -1;
}

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.text-glow {
  text-shadow: 0 0 10px currentColor, 0 0 20px currentColor;
}

.text-muted { color: var(--color-text-muted); }
.text-secondary { color: var(--color-text-secondary); }

/* Container */
.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-lg);
}

.main-content {
  padding-bottom: calc(100px + env(safe-area-inset-bottom));
  min-height: 100vh;
}

/* Cyber Card */
.cyber-card {
  background: linear-gradient(135deg, var(--color-surface) 0%, var(--color-bg-dark) 100%);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.cyber-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
}

.cyber-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 2px;
  height: 100%;
  background: linear-gradient(180deg, var(--neon-cyan), transparent);
}

/* Scanline Effect */
.scanlines::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.1) 2px,
    rgba(0, 0, 0, 0.1) 4px
  );
  pointer-events: none;
  z-index: 10;
}

/* Navigation Header */
.nav-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  background: rgba(10, 10, 15, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
}

.nav-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
  letter-spacing: 0.1em;
}

/* Bottom Navigation */
.nav-bottom {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-around;
  padding: var(--space-sm) var(--space-md);
  padding-bottom: calc(var(--space-sm) + env(safe-area-inset-bottom));
  background: rgba(10, 10, 15, 0.95);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--color-border);
  z-index: 100;
}

.nav-bottom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon-cyan), transparent);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-sm) var(--space-md);
  color: var(--color-text-muted);
  text-decoration: none;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  transition: all 0.2s ease;
}

.nav-item:hover {
  color: var(--color-text-secondary);
}

.nav-item.active {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
}

.nav-item.active .nav-icon {
  filter: drop-shadow(0 0 8px var(--neon-cyan));
  transform: scale(1.1);
}

.nav-icon {
  font-size: 22px;
  transition: all 0.2s ease;
}

/* Cyber Button */
.cyber-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 2px solid var(--neon-cyan);
  background: transparent;
  color: var(--neon-cyan);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  overflow: hidden;
}

.cyber-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(0, 240, 255, 0.2), transparent);
  transition: left 0.4s ease;
}

.cyber-btn:hover::before {
  left: 100%;
}

.cyber-btn:hover {
  background: rgba(0, 240, 255, 0.1);
  box-shadow: var(--glow-cyan);
  text-shadow: 0 0 10px var(--neon-cyan);
}

.cyber-btn:active {
  transform: scale(0.98);
}

.cyber-btn-primary {
  background: var(--neon-cyan);
  color: var(--color-bg);
  border-color: var(--neon-cyan);
}

.cyber-btn-primary:hover {
  background: var(--neon-cyan);
  box-shadow: var(--glow-cyan);
}

.cyber-btn-success {
  border-color: var(--neon-green);
  color: var(--neon-green);
}

.cyber-btn-success:hover {
  background: rgba(0, 255, 136, 0.1);
  box-shadow: var(--glow-green);
  text-shadow: 0 0 10px var(--neon-green);
}

.cyber-btn-block {
  width: 100%;
}

/* Stat Display */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-sm);
}

.stat-box {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  text-align: center;
  position: relative;
}

.stat-box::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 50%;
  height: 2px;
  background: var(--stat-color, var(--neon-cyan));
  border-radius: 0 0 2px 2px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  color: var(--stat-color, var(--neon-cyan));
  text-shadow: 0 0 10px var(--stat-color, var(--neon-cyan));
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 4px;
}

/* Progress Bar */
.progress-container {
  margin-bottom: var(--space-lg);
}

.progress-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
  font-size: 12px;
}

.progress-bar {
  height: 8px;
  background: var(--color-surface);
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-green));
  border-radius: var(--radius-sm);
  box-shadow: 0 0 10px var(--neon-cyan);
  transition: width 0.3s ease;
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  margin: var(--space-xl) 0 var(--space-md);
}

.section-header::before {
  content: '';
  width: 4px;
  height: 20px;
  background: var(--neon-cyan);
  border-radius: 2px;
  box-shadow: 0 0 10px var(--neon-cyan);
}

.section-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--neon-cyan);
}

/* Checklist Card */
.checklist-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.check-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.check-item:last-child {
  border-bottom: none;
}

.check-item:hover {
  background: var(--color-surface-raised);
}

.check-item:active {
  background: var(--color-surface-glow);
}

.check-item.checked {
  background: rgba(0, 255, 136, 0.05);
}

.check-item.checked .check-label {
  color: var(--color-text-muted);
}

.check-box {
  width: 24px;
  height: 24px;
  border: 2px solid var(--color-border-glow);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.check-item.checked .check-box {
  background: var(--neon-green);
  border-color: var(--neon-green);
  box-shadow: 0 0 10px var(--neon-green);
}

.check-mark {
  color: var(--color-bg);
  font-size: 14px;
  font-weight: 700;
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.2s ease;
}

.check-item.checked .check-mark {
  opacity: 1;
  transform: scale(1);
}

.check-content {
  flex: 1;
  min-width: 0;
}

.check-label {
  font-weight: 600;
  font-size: 15px;
}

.check-detail {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.check-value {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  color: var(--neon-green);
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  font-family: var(--font-display);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
  text-transform: uppercase;
}

.badge-cyan {
  background: rgba(0, 240, 255, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 240, 255, 0.3);
}

.badge-green {
  background: rgba(0, 255, 136, 0.15);
  color: var(--neon-green);
  border: 1px solid rgba(0, 255, 136, 0.3);
}

.badge-purple {
  background: rgba(191, 0, 255, 0.15);
  color: var(--neon-purple);
  border: 1px solid rgba(191, 0, 255, 0.3);
}

.badge-orange {
  background: rgba(255, 102, 0, 0.15);
  color: var(--neon-orange);
  border: 1px solid rgba(255, 102, 0, 0.3);
}

.badge-yellow {
  background: rgba(255, 255, 0, 0.15);
  color: var(--neon-yellow);
  border: 1px solid rgba(255, 255, 0, 0.3);
}

/* Input */
.cyber-input {
  width: 100%;
  padding: var(--space-md);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--color-text);
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.cyber-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 3px rgba(0, 240, 255, 0.1);
}

.cyber-input::placeholder {
  color: var(--color-text-dim);
}

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(10px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  width: 100%;
  max-width: 380px;
  position: relative;
}

.modal-content::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
}

.modal-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--neon-cyan);
  margin-bottom: var(--space-lg);
  text-align: center;
}

/* Utilities */
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }

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

/* Animations */
@keyframes pulse-glow {
  0%, 100% { box-shadow: 0 0 10px var(--neon-cyan); }
  50% { box-shadow: 0 0 20px var(--neon-cyan), 0 0 30px var(--neon-cyan); }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.animate-pulse-glow {
  animation: pulse-glow 2s ease-in-out infinite;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg);
}

::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--neon-cyan);
}

/* Selection */
::selection {
  background: var(--neon-cyan);
  color: var(--color-bg);
}
