:root{
  /* core palette */
  --bg-dark: #050915;
  --bg-mid:  #071228;
  --panel: rgba(10,22,37,0.66);
  --glass: rgba(12,27,46,0.55);
  --accent1: #7c3aed;
  --accent2: #06b6d4;
  --accent3: #00d4ff;
  --text: #e8f3ff;
  --muted: #9fb0c3;
  --glass-border: rgba(255,255,255,0.04);
  --shadow-strong: 0 10px 40px rgba(2,12,26,0.6);
}

/* reset */
*{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  color:var(--text);
  background:
    radial-gradient(1200px 600px at 10% 10%, rgba(7,29,58,0.6), transparent 5%),
    radial-gradient(1000px 600px at 95% 90%, rgba(8,16,35,0.6), transparent 5%),
    linear-gradient(180deg,var(--bg-mid), var(--bg-dark));
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}
.module-body{
  overflow:hidden;
}

.editor-panel,
.output-panel{
  min-height:0;
}
/* subtle animated stars layer (lightweight) */
body::before{
  content:"";
  position:fixed;
  inset:-20%;
  background:
    radial-gradient(2px 2px at 6% 10%, rgba(255,255,255,0.9) 0,#0000 40%),
    radial-gradient(1.2px 1.2px at 40% 30%, rgba(124,58,237,0.85) 0,#0000 40%),
    radial-gradient(1.2px 1.2px at 80% 70%, rgba(6,182,212,0.85) 0,#0000 40%),
    radial-gradient(1px 1px at 22% 80%, rgba(255,255,255,0.9) 0,#0000 40%);
  background-repeat: repeat;
  background-size: 800px 800px;
  opacity:0.22;
  filter:blur(.3px);
  animation: starsMove 140s linear infinite;
  z-index:0;
}
@keyframes starsMove{
  from{ transform: translateY(0) }
  to{ transform: translateY(-1200px) }
}

/* ===================================
   REFINED SCI-FI NAVBAR (CLEAN)
=================================== */

/* NAVBAR */
.navbar{
  height:95px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 35px;
  background:linear-gradient(90deg,#0b1626,#0e1e34);
  border-bottom:1px solid rgba(0,212,255,0.25);
}

/* LEFT SIDE GROUP */
.nav-left{
  display:flex;
  align-items:center;
  gap:35px;
}

/* ACTIVE TAB + UPTIME GROUP */
.nav-center{
  display:flex;
  align-items:center;
  gap:20px;
}

/* Keep brand pushed right */
.brand-container{
  display:flex;
  align-items:center;
  gap:20px;
}
.right-text{
  font-size:16px;
  font-weight:600;
  color:#9fb6c6;
  display:flex;           /* IMPORTANT */
  align-items:center;
  gap:10px;               /* spacing between dot and text */
}

/* STATUS DOT */
.right-text::before{
  content:"";
  width:10px;
  height:10px;
  border-radius:50%;
  margin-right:8px;
  animation: statusPulse 6s infinite linear;
}

/* Smooth system glow cycle */
@keyframes statusPulse{
  0%{
    background:#00ff88;
    box-shadow:0 0 6px #00ff88, 0 0 12px rgba(0,255,136,0.4);
  }
  33%{
    background:#ff00cc;
    box-shadow:0 0 6px #ff00cc, 0 0 12px rgba(255,0,204,0.4);
  }
  66%{
    background:#ffcc00;
    box-shadow:0 0 6px #ffcc00, 0 0 12px rgba(255,204,0,0.4);
  }
  100%{
    background:#00ff88;
    box-shadow:0 0 6px #00ff88, 0 0 12px rgba(0,255,136,0.4);
  }
}

/* TEXT BLOCK */
.brand{
  display:flex;
  flex-direction:column;
  align-items:center;  /* THIS centers subtitle under title */
  text-align:center;
}

/* TITLE */
.title{
  font-size:26px;
  font-weight:900;
  letter-spacing:3px;
  text-transform:uppercase;
  color:#7c3aed;
  text-shadow:
    0 0 15px rgba(124,58,237,0.5),
    0 0 25px rgba(0,212,255,0.3);
}

/* SUBTITLE */
.subtitle{
  font-size:13px;
  font-style:italic;
  color:#9fb6c6;
  margin-top:6px;
}

/* LOGO */
.logo{
  width:68px;
  height:68px;
}

.logo img{
  width:100%;
  height:100%;
  object-fit:contain;
  filter:
    drop-shadow(0 0 8px #073e49)
    drop-shadow(0 0 18px rgba(39, 7, 94, 0.6));
}


.nav-center span{
  padding:6px 14px;
  border:1px solid rgba(0,212,255,0.3);
  border-radius:20px;
  background:rgba(0,212,255,0.05);
  backdrop-filter:blur(6px);
  text-shadow:0 0 8px rgba(0,212,255,0.6);
}
.nav-center{
  display:flex;
  align-items:center;
  gap:25px;
  margin-left:40px; /* pushes it slightly away from status */
}
/* Uptime display */
.uptime{
  font-size:13px;
  letter-spacing:1px;
  color:#ffcc00;
  font-weight:600;
  gap:20px;
  text-shadow:0 0 10px rgba(255,204,0,0.6);
}

.uptime span{
  color:#ffffff;
}
/* APP LAYOUT */
.app{
  display:flex;
  min-height: calc(100vh - 95px);
  height:auto;
}
/* SIDEBAR */
.sidebar{
  width:300px;
  padding:28px 20px;
  background: linear-gradient(180deg, rgba(8,18,32,0.6), rgba(4,10,20,0.6));
  border-right: 1px solid rgba(255,255,255,0.02);
  backdrop-filter: blur(8px);
  display:flex;
  flex-direction:column;
  gap:14px;
  box-shadow: inset -6px 0 30px rgba(2,12,26,0.35);
}

/* tab buttons (pill) */
.tab{
  appearance:none;
  border: none;
  padding:14px 18px;
  border-radius:14px;
  background: rgba(255,255,255,0.02);
  color:var(--text);
  text-align:left;
  cursor:pointer;
  font-weight:700;
  font-size:15px;
  transition: all .22s ease;
  position:relative;
  overflow:visible;
  box-shadow: 0 6px 18px rgba(2,12,26,0.25);
}

/* subtle icon glow left edge for active */
.tab::before{
  content: "";
  position:absolute;
  left:6px; top:50%;
  transform: translateY(-50%);
  width:8px; height:8px;
  background: transparent;
  border-radius:50%;
  transition: all .22s ease;
  opacity:0;
}

/* active tab – big gradient pill with glow */
.tab.active{
  color:#01101a;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  box-shadow: 0 10px 40px rgba(124,58,237,0.16), 0 0 40px rgba(6,182,212,0.08);
  transform: translateX(3px);
}
.tab.active::before{
  opacity:1;
  background: radial-gradient(circle at 40% 30%, #fff, rgba(255,255,255,0.1)), var(--accent3);
  box-shadow: 0 6px 22px rgba(6,182,212,0.12);
}

/* hover */
.tab:hover:not(.active){
  transform: translateX(6px);
  background: linear-gradient(
    90deg,
    rgba(124,58,237,0.35),
    rgba(6,182,212,0.35)
  );
  color:white;
}

/* CONTENT AREA */
.content{
  flex:1;
  padding:28px;
  overflow:auto;
}

/* MODULE container */
.module{ display:none; height:100%; }
.module.active{ display:flex; flex-direction:column; gap:14px; }

/* module header */
.module-header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  margin-bottom:6px;
}
.module-header h2{
  font-size:28px;
  font-weight:800;
  color:var(--text);
  margin:0;
  letter-spacing:0.2px;
}

/* fullscreen button (consistent) */
.fullscreen-btn{
  padding:9px 14px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.03);
  color:var(--muted);
  cursor:pointer;
  font-weight:700;
  transition:all .18s ease;
}
.fullscreen-btn:hover{ background: rgba(255,255,255,0.04); color:var(--text); transform: translateY(-2px) }

/* MODULE BODY – glass card */
.module-body{
  flex:1;
  display:flex;
  gap:20px;
  background: linear-gradient(180deg, rgba(3,10,18,0.45), rgba(5,12,22,0.6));
  border-radius:18px;
  padding:22px;
  border:1px solid var(--glass-border);
  box-shadow: var(--shadow-strong);
  min-height: 420px;
  position:relative;
}

/* editor and output panels */
.editor-panel{ flex:1; display:flex; flex-direction:column; gap:12px; min-width:0;}
.toolbar{ display:flex; gap:10px; align-items:center; }

#runBtn{
  padding:10px 16px;
  border-radius:12px;
  border:none;
  background: linear-gradient(90deg, var(--accent1), var(--accent2));
  color: #02121a;
  font-weight:800;
  box-shadow: 0 8px 30px rgba(124,58,237,0.16);
  cursor:pointer;
  transition: transform .16s ease;
}
#runBtn:active{ transform: translateY(1px) }

/* editor container */
#editor{
  flex:1;
  border-radius:12px;
  overflow:hidden;
  background:#0a0a0a;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.015);
  border: 1px solid rgba(255,255,255,0.02);
}

/* output panel */
.output-panel{
  width:420px;
  min-width:340px;
  background: linear-gradient(180deg, rgba(8,18,30,0.55), rgba(3,9,16,0.5));
  border-radius:12px;
  padding:18px;
  border:1px solid rgba(255,255,255,0.03);
  color:var(--muted);
  display:flex;
  flex-direction:column;
  gap:12px;
}

/* make pre area readable */
.output-panel h3{ margin:0 0 6px 0; font-size:20px; color:var(--text) }
#output{
  white-space:pre-wrap;
  background: transparent;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, "Roboto Mono", monospace;
  color: #cfeefc;
  font-size:13px;
  margin:0;
}

/* iframe inside module body */
iframe{
  width:100%;
  height:100%;
  border:none;
  border-radius:12px;
  background:#000;
}

/* center text fallback */
.center-text{
  display:flex; align-items:center; justify-content:center; color:var(--muted);
}

/* small helpers for camera controls (if present in main DOM) */
.btn{
  padding:10px 14px;
  border-radius:10px;
  font-weight:800;
  cursor:pointer;
  border:none;
}
.btn-primary{ background: linear-gradient(90deg,var(--accent2),var(--accent3)); color:#02121a; box-shadow: 0 10px 32px rgba(6,182,212,0.12) }
.btn-danger{ background: linear-gradient(90deg,#ff5f6d,#ff7a7a); color:white; box-shadow: 0 8px 28px rgba(255,95,109,0.12) }
.btn-ghost{ background: rgba(255,255,255,0.03); color:var(--muted); border:1px solid rgba(255,255,255,0.03) }

/* responsive tweaks */

/* ===================================================
   RESPONSIVE - CLEAN REWRITE
=================================================== */

/* Tablet 1100px */
@media(max-width:1100px){
  .sidebar{width:220px;padding:18px 14px}
  .output-panel{width:300px;min-width:240px}
  .title{font-size:20px;letter-spacing:2px}
  .logo{width:54px;height:54px}
}

/* Small tablet 900px */
@media(max-width:900px){
  .navbar{padding:0 20px;min-height:80px}
  .sidebar{width:200px;padding:14px 10px}
  .output-panel{width:260px;min-width:220px}
  .tab{font-size:13px;padding:12px 14px}
  .title{font-size:18px}
  .subtitle{font-size:11px}
}

/* Mobile 820px - sidebar becomes horizontal scroller */
@media(max-width:820px){
  body{overflow:auto}

  .navbar{
    flex-wrap:wrap;
    height:auto;
    padding:10px 14px;
    gap:8px;
    min-height:auto;
  }

  .nav-left{
    flex-wrap:wrap;
    gap:10px;
    width:100%;
    justify-content:space-between;
  }

  .nav-center{
    margin-left:0;
    gap:10px;
  }

  .brand-container{
    width:100%;
    justify-content:center;
    gap:12px;
  }

  .title{font-size:18px;letter-spacing:1.5px}
  .subtitle{font-size:11px}
  .logo{width:50px;height:50px}
  .uptime{font-size:12px}
  .right-text{font-size:13px}

  .app{
    flex-direction:column;
    min-height:auto;
  }

  .sidebar{
    width:100%;
    flex-direction:row;
    overflow-x:auto;
    overflow-y:hidden;
    gap:8px;
    padding:10px 12px;
    scrollbar-width:none;
    border-right:none;
    border-bottom:1px solid rgba(255,255,255,0.04);
    box-shadow:none;
  }

  .sidebar::-webkit-scrollbar{display:none}

  .tab{
    flex:0 0 auto;
    white-space:nowrap;
    font-size:13px;
    padding:10px 14px;
    transform:none !important;
  }

  .content{padding:12px}

  .module-body{
    flex-direction:column;
    min-height:auto;
    padding:14px;
    gap:14px;
  }

  .output-panel{
    width:100%;
    min-width:0;
    min-height:150px;
  }

  #editor{min-height:260px}
  .module-header h2{font-size:20px}
}

/* Mobile 600px */
@media(max-width:600px){
  .navbar{padding:10px 12px;gap:6px}
  .nav-left{gap:8px}
  .brand-container{gap:10px}
  .title{font-size:15px;letter-spacing:1px}
  .subtitle{font-size:10px;margin-top:3px}
  .logo{width:42px;height:42px}
  .uptime{font-size:11px}
  .right-text{font-size:12px}
  .nav-center span{font-size:12px;padding:4px 10px}
  .tab{font-size:12px;padding:9px 11px}
  .module-header{flex-direction:column;align-items:flex-start;gap:8px}
  .fullscreen-btn{width:100%;text-align:center}
  .editor-actions{flex-direction:column}
  .action-btn{width:100%;text-align:center}
  .module-body{padding:10px;gap:10px;border-radius:12px}
  #editor{min-height:220px}
  .module-header h2{font-size:18px}
  .output-panel{min-height:130px}
}

/* Ultra small 400px */
@media(max-width:400px){
  .title{font-size:13px;letter-spacing:0.5px}
  .tab{font-size:11px;padding:8px 9px}
  .module-header h2{font-size:15px}
  .logo{width:36px;height:36px}
  .subtitle{display:none}
}
