/**
 * ZedSec_Labs Portfolio Theme System
 * Enhanced with demo showcase styles
 */

/* === THEME VARIABLES === */
:root {
  --theme-hue: 0;
  --theme-primary: hsl(var(--theme-hue), 54%, 45%);
  --theme-primary-soft: hsl(var(--theme-hue), 54%, 55%);
  --theme-primary-cool: hsl(var(--theme-hue), 100%, 65%);
  --theme-primary-deep: hsl(var(--theme-hue), 60%, 30%);
  --theme-primary-dim: hsla(var(--theme-hue), 54%, 45%, 0.12);
  
  /* Defaults (Night/Crimson) */
  --bg-void: #07080a;
  --bg-soft: #0e1012;
  --bg-elevated: #121316;
  --text-primary: #ece8e1;
  --text-secondary: #9a948c;
  --line-subtle: rgba(255, 255, 255, 0.04);
  --line-default: hsla(var(--theme-hue), 54%, 45%, 0.08);
  --line-strong: hsla(var(--theme-hue), 54%, 45%, 0.16);
}

/* Theme Variants */
[data-theme="crimson"] { --theme-hue: 0; }
[data-theme="cyan"] { --theme-hue: 190; --theme-primary: #00d4ff; --theme-primary-soft: #4ce0ff; --theme-primary-cool: #80ebff; --theme-primary-deep: #0099cc; --theme-primary-dim: rgba(0, 212, 255, 0.12); }
[data-theme="gold"] { --theme-hue: 45; --theme-primary: #d4af37; --theme-primary-soft: #e5c76b; --theme-primary-cool: #f0db8a; --theme-primary-deep: #a68a2e; --theme-primary-dim: rgba(212, 175, 55, 0.12); }
[data-theme="emerald"] { --theme-hue: 150; --theme-primary: #10b981; --theme-primary-soft: #34d399; --theme-primary-cool: #6ee7b7; --theme-primary-deep: #059669; --theme-primary-dim: rgba(16, 185, 129, 0.12); }
[data-theme="purple"] { --theme-hue: 270; --theme-primary: #a855f7; --theme-primary-soft: #c084fc; --theme-primary-cool: #d8b4fe; --theme-primary-deep: #7e22ce; --theme-primary-dim: rgba(168, 85, 247, 0.12); }

/* Day/Night Modes */
[data-mode="night"] {
  --bg-void: #07080a;
  --bg-soft: #0e1012;
  --bg-elevated: #121316;
  --text-primary: #ece8e1;
  --text-secondary: #9a948c;
  --line-subtle: rgba(255, 255, 255, 0.04);
}

[data-mode="day"] {
  --bg-void: #f5f3f0;
  --bg-soft: #ebe8e3;
  --bg-elevated: #e0dcd5;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --line-subtle: rgba(0, 0, 0, 0.06);
  --line-default: hsla(var(--theme-hue), 54%, 45%, 0.15);
  --line-strong: hsla(var(--theme-hue), 54%, 45%, 0.25);
}

/* === DEMO SHOWCASE STYLES === */
.demos {
  padding-block: var(--section-pad);
}

.demos-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.demo-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.demo-card:hover {
  transform: translateY(-4px);
  border-color: var(--theme-primary);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--theme-primary-dim);
}

.demo-preview {
  aspect-ratio: 16/10;
  background: #0a0a0a;
  position: relative;
  overflow: hidden;
}

.preview-chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: #1a1a1a;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.chrome-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.2);
}

.chrome-dot:first-child { background: #ff5f56; }
.chrome-dot:nth-child(2) { background: #ffbd2e; }
.chrome-dot:nth-child(3) { background: #27c93f; }

.chrome-url {
  margin-left: auto;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  color: rgba(255, 255, 255, 0.4);
  letter-spacing: 0.5px;
}

.preview-content {
  padding: 20px;
  height: calc(100% - 33px);
  position: relative;
}

/* Chronicle Preview */
.preview-content:not(.tactical):not(.command):not(.experimental) {
  background: linear-gradient(135deg, #0f0f0f 0%, #1a0a0a 100%);
}

.preview-stamp {
  display: inline-block;
  font-family: 'Orbitron', sans-serif;
  font-size: 8px;
  letter-spacing: 1px;
  padding: 2px 6px;
  background: #b03535;
  color: #000;
  transform: rotate(-2deg);
  margin-bottom: 8px;
}

.preview-date {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 8px;
  color: rgba(255, 255, 255, 0.4);
  margin-left: 8px;
}

.preview-title {
  font-family: 'Orbitron', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 12px;
  text-transform: uppercase;
}

.preview-lines span {
  display: block;
  height: 4px;
  background: rgba(176, 53, 53, 0.3);
  margin-bottom: 4px;
  border-radius: 2px;
}

.preview-lines span:nth-child(1) { width: 100%; }
.preview-lines span:nth-child(2) { width: 80%; }
.preview-lines span:nth-child(3) { width: 60%; }

/* Tactical Preview */
.preview-content.tactical {
  background: linear-gradient(135deg, #0a0f0a 0%, #0a1a0a 100%);
}

.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 20px;
}

.preview-item {
  aspect-ratio: 1;
  background: rgba(212, 175, 55, 0.1);
  border: 1px solid rgba(212, 175, 55, 0.3);
  border-radius: 4px;
}

.preview-badge {
  position: absolute;
  bottom: 12px;
  right: 12px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  padding: 4px 8px;
  background: rgba(212, 175, 55, 0.2);
  border: 1px solid rgba(212, 175, 55, 0.4);
  color: #d4af37;
}

/* Command Preview */
.preview-content.command {
  background: linear-gradient(135deg, #0a0a15 0%, #0a1520 100%);
}

.preview-radar {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  border: 2px solid rgba(0, 212, 255, 0.3);
  border-radius: 50%;
}

.preview-radar::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 4px;
  height: 4px;
  background: #00d4ff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 10px #00d4ff;
}

.preview-metrics {
  position: absolute;
  bottom: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  justify-content: space-between;
  font-family: 'Orbitron', sans-serif;
  font-size: 12px;
  color: #00d4ff;
}

/* Experimental Preview */
.preview-content.experimental {
  background: linear-gradient(135deg, #0f0a15 0%, #1a0a20 100%);
  position: relative;
}

.preview-particles {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 30% 30%, rgba(168, 85, 247, 0.3) 0%, transparent 50%),
                    radial-gradient(circle at 70% 70%, rgba(168, 85, 247, 0.2) 0%, transparent 40%);
}

.preview-shader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  background: linear-gradient(135deg, #a855f7, #7e22ce);
  border-radius: 50%;
  filter: blur(20px);
  opacity: 0.6;
}

/* Demo Info */
.demo-info {
  padding: 20px;
}

.demo-info h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 18px;
  margin-bottom: 8px;
}

.demo-info p {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 12px;
}

.demo-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.demo-tags span {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 8px;
  background: var(--theme-primary-dim);
  color: var(--theme-primary);
  border-radius: 4px;
}

.demo-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--theme-primary);
  transition: gap 0.2s ease;
}

.demo-link:hover {
  gap: 12px;
}

.demo-link svg {
  width: 14px;
  height: 14px;
}

.demos-note {
  margin-top: 40px;
  padding: 20px;
  background: var(--theme-primary-dim);
  border: 1px solid var(--line-default);
  border-radius: 8px;
  text-align: center;
}

.demos-note p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

.demos-note strong {
  color: var(--theme-primary);
}

/* === THEME SWITCHER === */
.theme-switcher {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: rgba(7, 8, 10, 0.9);
  backdrop-filter: blur(20px);
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
}

.theme-switcher-header {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.theme-colors {
  display: flex;
  gap: 8px;
}

.theme-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.theme-btn:hover {
  transform: scale(1.1);
}

.theme-btn.is-active {
  border-color: #fff;
  box-shadow: 0 0 0 2px #07080a, 0 0 0 4px currentColor;
}

.theme-btn[data-theme="crimson"] { background: linear-gradient(135deg, #b03535, #ff4d5a); color: #b03535; }
.theme-btn[data-theme="cyan"] { background: linear-gradient(135deg, #00d4ff, #4ce0ff); color: #00d4ff; }
.theme-btn[data-theme="gold"] { background: linear-gradient(135deg, #d4af37, #f0db8a); color: #d4af37; }
.theme-btn[data-theme="emerald"] { background: linear-gradient(135deg, #10b981, #34d399); color: #10b981; }
.theme-btn[data-theme="purple"] { background: linear-gradient(135deg, #a855f7, #c084fc); color: #a855f7; }

.mode-toggle {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.5);
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.5px;
  cursor: pointer;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.mode-btn:hover {
  border-color: var(--theme-primary);
  color: var(--theme-primary);
}

.mode-btn.is-active {
  background: var(--theme-primary-dim);
  border-color: var(--theme-primary);
  color: var(--theme-primary);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .demos-grid {
    grid-template-columns: 1fr;
  }
  
  .theme-switcher {
    bottom: 10px;
    left: 10px;
    padding: 12px;
  }
  
  .theme-btn {
    width: 24px;
    height: 24px;
  }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  .demo-card:hover {
    transform: none;
  }
  
  .preview-radar::after {
    animation: none;
  }
}
