/* BITPIERCE UNIFIED CORE THEME */
:root {
  /* Brand Colors */
  --accent: #963484;
  --accent-glow: rgba(150, 52, 132, 0.2);
  --success: #10b981;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Dark Mode (Default) */
  --bg: #0a0c0e;
  --surface: #0f1114;
  --surface-highlight: #16191d;
  --nav-glass: rgba(10, 12, 14, 0.9);
  --text-main: #e2e8f0;
  --text-dim: #64748b;
  --border: rgba(255, 255, 255, 0.05);
  --grid-color: rgba(150, 52, 132, 0.03);

  /* Fonts */
  --font-disp: "Audiowide", sans-serif;
  --font-body: "Roboto", sans-serif;
  --font-tech: "Space Mono", monospace;
}

.light-mode {
  --bg: #f1f5f9;
  --surface: #ffffff;
  --surface-highlight: #f8fafc;
  --nav-glass: rgba(241, 245, 249, 0.9);
  --text-main: #0f172a;
  --text-dim: #64748b;
  --border: rgba(0, 0, 0, 0.08);
  --grid-color: rgba(150, 52, 132, 0.06);
}

/* Base Styles */
body {
  background-color: var(--bg);
  color: var(--text-main);
  font-family: var(--font-body);
  background-image: radial-gradient(var(--accent) 0.5px, transparent 0.5px);
  background-size: 30px 30px;
  transition: background-color 0.3s ease, color 0.3s ease;
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography Hub */
.mono { font-family: var(--font-tech); }
.brand-font { font-family: var(--font-disp); }

.label-tiny {
  font-family: var(--font-tech);
  font-size: 9px;
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* --- SHARED COMPONENT CLASSES --- */

/* 1. Navbar Structure */
.nav-themed {
    width: 100%;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    z-index: 50;
    background: var(--nav-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    box-sizing: border-box;
}

.nav-group {
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Equivalent to gap-3 */
}

.nav-controls {
    display: flex;
    align-items: center;
    gap: 2rem; /* Equivalent to gap-8 */
}

/* 2. Logo & Branding */
.nav-logo {
    height: 40px;
    width: auto;
    display: block;
}

.brand-text {
    font-family: var(--font-disp);
    font-size: 1.5rem; /* text-2xl */
    letter-spacing: -0.05em; /* tracking-tighter */
    line-height: 1;
}

/* 3. Toggle Switch Wrapper */
.toggle-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* 4. Switch UI */
.switch {
  position: relative;
  display: inline-block;
  width: 34px;
  height: 18px;
}
.switch input { opacity: 0; width: 0; height: 0; }

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--text-dim);
  transition: 0.4s;
  border-radius: 20px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 12px; width: 12px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider { background-color: var(--accent); }
input:checked + .slider:before { transform: translateX(16px); }

/* 5. Panels & Dashboard */
.dashboard-layout {
    padding: 120px 2rem 4rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    box-sizing: border-box;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.flat-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.flat-panel:hover {
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
  transform: translateY(-2px);
  border-top-width: 4px solid;
  border-top-color: var(--accent);
}

/* 6. Inputs & Buttons */
.input-field {
  background: var(--surface-highlight);
  border: 1px solid var(--border);
  color: var(--text-main);
  font-family: var(--font-tech);
  transition: border-color 0.2s ease;
}
.input-field:focus {
  border-color: var(--accent);
  outline: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  font-family: var(--font-disp);
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: filter 0.2s ease, transform 0.1s ease;
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: translateY(1px); }

/* 7. Indicators & Progress */
.indicator {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    margin-right: 6px;
}
.ind-active {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}
.progress-track {
    width: 100%;
    height: 2px;
    background: var(--surface-highlight);
    margin-top: 10px;
    overflow: hidden;
}
.progress-bar {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animations */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}
.shake {
  animation: shake 0.2s ease-in-out 0s 2;
  border-color: var(--error) !important;
}

/* Responsive */
@media (max-width: 900px) {
    .dashboard-layout { grid-template-columns: 1fr; }
    .terminal-wrapper { display: none; }
    .nav-themed { padding: 1rem; }
}

/* Scrollbars */
.terminal-body::-webkit-scrollbar { width: 4px; }
.terminal-body::-webkit-scrollbar-thumb { background: var(--border); }

/* --- Logout Animation --- */
.logout-screen {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 10000;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-family: var(--font-tech);
    pointer-events: none;
}

/* Triggered via JS */
.is-logging-out .logout-screen {
    display: flex;
    animation: fadeIn 0.2s forwards;
}

.is-logging-out main, 
.is-logging-out nav {
    filter: blur(10px) brightness(0.5);
    transition: filter 0.5s ease;
}

.scanline {
    position: absolute;
    width: 100%;
    height: 100px;
    background: linear-gradient(0deg, rgba(150, 52, 132, 0) 0%, rgba(150, 52, 132, 0.1) 50%, rgba(150, 52, 132, 0) 100%);
    opacity: 0.1;
    top: -100px;
    animation: scan 1.5s linear infinite;
}

@keyframes scan {
    0% { top: -100px; }
    100% { top: 100%; }
}

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

.flicker {
    animation: flicker 0.1s infinite;
}

@keyframes flicker {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

#cookie-banner {
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--accent);
  box-shadow: 0 -4px 20px rgba(0,0,0,0.5);
  transform: translateY(100%); /* Hidden by default */
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 50;
}
#cookie-banner.active {
  transform: translateY(0);
}
.btn-outline {
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  transition: all 0.2s;
}
.btn-outline:hover {
  background: var(--accent);
  color: #000;
}
