/* =========================================
   MAIN STYLES & THEME SYSTEM
   ========================================= */

:root {
  --accent-1: #00f2ff;
  --accent-2: #ff0055;
  --accent-dim: rgba(0, 242, 255, 0.1);
  --bg-primary: #050505;
  --text-primary: #ffffff;
  --text-secondary: #8b9bb4;
  --border-color: rgba(255, 255, 255, 0.1);
  --panel-bg: rgba(10, 10, 12, 0.95);
  --input-bg: rgba(0, 0, 0, 0.3);
  --metric-bg: rgba(255, 255, 255, 0.1);
  --switch-bg: rgba(0, 0, 0, 0.3);
  --terminal-height: 300px;
}

/* Light Mode */

body.light-mode {
  --bg-primary: #eef2f6;
  --text-primary: #1a1a1a;
  --text-secondary: #5a6b7c;
  --border-color: rgba(0, 0, 0, 0.15);
  --panel-bg: rgba(255, 255, 255, 0.92);
  --input-bg: rgba(255, 255, 255, 0.8);
  --metric-bg: rgba(0, 0, 0, 0.1);
  --switch-bg: rgba(255, 255, 255, 0.8);
}

/* Matt Black Mode */

body.matt-mode {
  --bg-primary: #0a0a0a;
  --text-primary: #e0e0e0;
  --text-secondary: #a0a0a0;
  --border-color: rgba(150, 150, 150, 0.15);
  --panel-bg: rgba(5, 5, 5, 0.98);
  --input-bg: rgba(20, 20, 20, 0.9);
  --metric-bg: rgba(100, 100, 100, 0.2);
  --switch-bg: rgba(20, 20, 20, 0.9);
  text-shadow: 0 0 8px currentColor;
}

/* Beach Mode */

body.beach-mode {
  --bg-primary: #f5e6d3;
  --text-primary: #2c3e50;
  --text-secondary: #5d6d7e;
  --border-color: rgba(0, 0, 0, 0.12);
  --panel-bg: rgba(255, 245, 235, 0.95);
  --input-bg: rgba(255, 255, 255, 0.9);
  --metric-bg: rgba(0, 0, 0, 0.08);
  --switch-bg: rgba(255, 255, 255, 0.9);
}

body {
  margin: 0;
  min-height: 100vh;
  height: 100%;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: 'JetBrains Mono', monospace;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.5s ease, color 0.5s ease;
  padding: 10px;
  box-sizing: border-box;
}

#background-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}

.console-wrapper {
  width: 1200px;
  max-width: 100%;
  height: auto;
  min-height: 800px;
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  background: var(--panel-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
  animation: bootUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.console-wrapper::before, .console-wrapper::after {
  content: '';
  position: absolute;
  width: 40px;
  height: 40px;
  border-style: solid;
  border-width: 3px;
  border-image: linear-gradient(45deg, var(--accent-1), var(--accent-2)) 1;
  border-image-slice: 1;
  box-shadow: 0 0 15px var(--accent-dim);
  z-index: 10;
  pointer-events: none;
}

.console-wrapper::before {
  top: -1px;
  left: -1px;
  border-right: none;
  border-bottom: none;
}

.console-wrapper::after {
  bottom: -1px;
  right: -1px;
  border-left: none;
  border-top: none;
}

@keyframes bootUp {
  from {
    opacity: 0;
    transform: scale(0.92) translateY(30px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0);
  }
}

.panel-left {
  padding: 30px;
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(135deg, var(--accent-dim) 0%, transparent 100%);
  transition: background 0.5s ease;
}

.panel-right {
  padding: 30px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow-y: auto;
  max-height: 800px;
}

.panel-right::-webkit-scrollbar {
  width: 6px;
}

.panel-right::-webkit-scrollbar-track {
  background: transparent;
}

.panel-right::-webkit-scrollbar-thumb {
  background: var(--text-secondary);
  opacity: 0.3;
  border-radius: 3px;
}

.brand-section h1 {
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  line-height: 0.9;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 2px;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 0 30px var(--accent-dim);
  word-break: break-word;
}

.brand-tag {
  font-size: 0.75rem;
  color: var(--accent-1);
  letter-spacing: 4px;
  text-transform: uppercase;
  font-weight: 700;
  margin-top: 10px;
  display: block;
}

.section-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary) !important;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.section-label::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background: var(--border-color);
}

.section-label span {
  color: var(--accent-1);
  margin-right: 5px;
}

.theme-section-title {
  font-size: 0.6rem;
  color: var(--text-secondary) !important;
  margin-bottom: 5px;
  margin-top: 5px;
  display: block;
  letter-spacing: 1px;
}

.hex-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.color-node {
  height: 40px;
  cursor: pointer;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
  overflow: visible;
  border: 2px solid transparent;
}

.color-preview {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
}

.color-glow {
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
  background: inherit;
  filter: blur(8px);
}

.color-node:hover .color-preview {
  transform: scale(1.1);
  filter: brightness(1.2);
}

.color-node:hover .color-glow {
  opacity: 0.5;
  animation: glowPulse 1.5s infinite;
}

.color-node.active {
  border-color: var(--text-primary);
}

.color-node.active .color-preview {
  transform: scale(1.05);
  box-shadow: 0 0 25px currentColor;
  animation: activeGlow 2s infinite;
}

@keyframes glowPulse {
  0%, 100% {
    opacity: 0.3;
    filter: blur(8px);
  }
  50% {
    opacity: 0.6;
    filter: blur(12px);
  }
}

@keyframes activeGlow {
  0%, 100% {
    filter: brightness(1);
    box-shadow: 0 0 20px currentColor;
  }
  50% {
    filter: brightness(1.3);
    box-shadow: 0 0 35px currentColor;
  }
}

.hardware-tag {
  font-size: 0.65rem;
  color: var(--accent-2) !important;
  margin-top: -5px;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  display: block;
}

.metric-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 0.7rem;
  color: var(--text-secondary) !important;
}

.metric-bar-bg {
  flex-grow: 1;
  height: 6px;
  background: var(--metric-bg);
  border-radius: 3px;
  overflow: hidden;
}

.metric-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  box-shadow: 0 0 8px var(--accent-1);
  transition: width 0.5s ease-out;
}

.config-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}

.btn-launch {
  margin-top: auto;
  background: linear-gradient(90deg, var(--accent-1), var(--accent-2));
  color: #000;
  border: none;
  padding: 15px;
  font-family: 'Rajdhani', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  cursor: pointer;
  clip-path: polygon(15px 0, 100% 0, 100% calc(100% - 15px), calc(100% - 15px) 100%, 0 100%, 0 15px);
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
}

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

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

.btn-launch:hover {
  filter: brightness(1.2);
  box-shadow: 0 0 25px var(--accent-1);
  letter-spacing: 4px;
  color: #fff;
  transform: translateY(-2px);
}

/* Mobile Optimizations */

@media (max-width: 768px) {
  body {
    padding: 5px;
    align-items: flex-start;
  }
}

@media (max-width: 768px) {
  .console-wrapper {
    grid-template-columns: 1fr;
    min-height: auto;
    height: auto;
    border-radius: 16px;
  }
}

@media (max-width: 768px) {
  .panel-left {
    display: block;
    padding: 20px;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }
}

@media (max-width: 768px) {
  .panel-right {
    padding: 20px;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .brand-section h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .terminal-window {
    margin-top: 20px;
    margin-bottom: 15px;
  }
}

@media (max-width: 768px) {
  .hex-grid {
    gap: 6px;
  }
}

@media (max-width: 768px) {
  .color-node {
    height: 35px;
  }
}

@media (max-width: 768px) {
  .config-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

@media (max-width: 768px) {
  .switches-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .btn-launch {
    padding: 12px;
    font-size: 1rem;
  }
}

/* Small Phone Optimizations */

@media (max-width: 480px) {
  .panel-left, .panel-right {
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .brand-section h1 {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .brand-tag {
    font-size: 0.65rem;
    letter-spacing: 2px;
  }
}

@media (max-width: 480px) {
  .hex-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
  }
}

@media (max-width: 480px) {
  .color-node {
    height: 30px;
  }
}

@media (max-width: 480px) {
  .section-label {
    font-size: 0.65rem;
  }
}

@media (max-width: 480px) {
  .metric-row span {
    font-size: 0.65rem;
  }
}

/* Landscape Mode */

@media (max-height: 600px) and (orientation: landscape) {
  body {
    align-items: center;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .console-wrapper {
    min-height: auto;
    max-height: 95vh;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .panel-left, .panel-right {
    padding: 15px;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .terminal-window {
    margin-top: 10px;
    margin-bottom: 10px;
  }
}

@media (max-height: 600px) and (orientation: landscape) {
  .brand-section h1 {
    font-size: 2rem;
  }
}

