/* =====================================================
   IMPORT FONT
   ===================================================== */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

/* =====================================================
   VARIABLES & RESET
   ===================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* NEW THEME: Professional Dark Green */
  --primary:      #2ea44f;
  --primary-dim:  #238636;
  --primary-glow: rgba(46, 164, 79, 0.15);
  --primary-line: rgba(46, 164, 79, 0.4);

  --bg:         #0d1117;
  --bg-panel:   #010409;
  --bg-card:    #12161d;
  --bg-input:   #0d1117;
  --bg-hover:   rgba(46, 164, 79, 0.1);

  --border:     #1a1a3a;
  --border2:    #2a2a4a;
  --border-hot: #00f3ff;

  --text:       #e0f0ff;
  --text-dim:   #7088a8;
  --text-label: #a0c0e0;

  --accent:     #00f3ff;
  --green:      #00ff9d;
  --blue:       #38bdf8;

  --mono:    'JetBrains Mono', monospace;
  --display: 'Inter', sans-serif;
}
html { scroll-behavior: smooth; }

body {
  font-family: var(--display);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* NEW EFFECT: Cyberpunk Radial Grid & Scanlines */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  background-image: radial-gradient(rgba(48, 54, 61, 0.3) 1px, transparent 1px);
  background-size: 40px 40px;
  pointer-events: none;
  z-index: -1;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(rgba(46, 164, 79, 0.02) 1px, transparent 1px),
              linear-gradient(90deg, rgba(46, 164, 79, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: -2;
}

/* =====================================================
   SCROLLBAR
   ===================================================== */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--primary-dim); border-radius: 5px; }

/* =====================================================
   LOGIN SCREEN
   ===================================================== */
#loginScreen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  background-image: radial-gradient(circle at center, #0a0a20 0%, var(--bg) 100%);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border2);
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5), 0 0 20px var(--primary-glow);
  position: relative;
  padding: 48px 40px 40px;
  overflow: hidden;
}

/* NEW EFFECT: Scanning Line on Login Box */
.login-box::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  animation: scanline 2.5s linear infinite;
}

@keyframes scanline {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.login-logo { text-align: center; margin-bottom: 8px; }
.login-logo img { height: 120px; width: auto; filter: drop-shadow(0 0 10px var(--primary-glow)); }

.login-meta { text-align: center; margin-bottom: 32px; }
.login-meta .sys-tag {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 4px;
}
.login-meta .sys-id {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--primary);
  letter-spacing: 0.1em;
}

.login-field { margin-bottom: 12px; position: relative; }
.login-field-label {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-label);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 6px;
}
.login-field input {
  width: 100%;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  padding: 0 14px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: all 0.3s;
}
.login-field input::placeholder { color: var(--text-dim); }
.login-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
  background: rgba(0, 243, 255, 0.02);
}

.login-btn {
  width: 100%;
  height: 46px;
  margin-top: 16px;
  background: var(--primary-dim);
  color: #fff;
  border: 1px solid var(--primary);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 0 10px var(--primary-glow);
}
.login-btn:hover {
  background: var(--primary);
  color: #000;
  box-shadow: 0 0 25px var(--primary-glow), inset 0 0 10px rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

#loginError {
  font-family: var(--mono);
  font-size: 11px;
  color: #ff3366;
  text-align: center;
  margin-top: 10px;
  display: none;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.layout { display: flex; min-height: 100vh; position: relative; z-index: 1; }

.sidebar {
  width: 240px;
  min-height: 100vh;
  background: var(--bg-panel);
  backdrop-filter: blur(15px);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  flex-shrink: 0;
  box-shadow: 5px 0 20px rgba(0,0,0,0.3);
}

.sidebar-logo {
  padding: 24px 20px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.sidebar-logo img { height: 130px; width: auto; filter: drop-shadow(0 0 5px var(--primary-glow)); }
.sidebar-logo .build-tag {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--primary);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  background: rgba(0, 243, 255, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid var(--primary-line);
}

.sidebar-section-title {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-label);
  padding: 24px 20px 8px;
}

.sidebar-nav { flex: 1; padding: 0 10px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  margin-bottom: 4px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  border-radius: 8px;
  letter-spacing: 0.02em;
  border-left: 3px solid transparent;
  transition: all 0.2s ease;
}
.nav-item:hover {
  color: var(--primary);
  background: var(--bg-hover);
  border-left-color: var(--primary);
  transform: translateX(4px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}
.nav-item i {
  font-size: 13px;
  width: 16px;
  text-align: center;
  opacity: 0.7;
  transition: all 0.2s;
}
.nav-item:hover i { opacity: 1; text-shadow: 0 0 8px var(--primary-glow); }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.status-dot {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--text-label);
}
.dot {
  width: 8px; height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--green);
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

/* =====================================================
   MAIN CONTENT
   ===================================================== */
.content { flex: 1; display: flex; flex-direction: column; min-width: 0; }

.topbar {
  height: 60px;
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
}
.topbar-left .sep { color: var(--border2); }
.topbar-left .page-name { color: var(--text); }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-label);
}
.topbar-right .live-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--green);
  font-size: 11px;
  background: rgba(0, 255, 157, 0.1);
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(0, 255, 157, 0.3);
}

.page {
  padding: 32px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* =====================================================
   PANEL
   ===================================================== */
.panel {
  background: var(--bg-card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 12px;
  position: relative;
  overflow: visible;
  box-shadow: 0 8px 30px rgba(0,0,0,0.3);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 243, 255, 0.08);
  border-color: var(--border2);
}

.panel.span-2 { grid-column: span 2; }

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(0,0,0,0.2);
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}
.panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
}
.panel-title i { font-size: 14px; text-shadow: 0 0 10px var(--primary-glow); }

.panel-badge {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--text-label);
  letter-spacing: 0.1em;
  background: var(--bg-hover);
  border: 1px solid var(--border2);
  padding: 4px 10px;
  border-radius: 20px;
}

.panel-body { padding: 24px; overflow: visible; }

/* =====================================================
   FIELDS
   ===================================================== */
.field { margin-bottom: 20px; }
.field:last-child { margin-bottom: 0; }

label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-label);
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

input[type="text"],
input[type="password"],
input[type="number"],
input[readonly] {
  width: 100%;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text);
  padding: 0 16px;
  font-family: var(--mono);
  font-size: 13px;
  outline: none;
  transition: all 0.3s;
  -webkit-appearance: none;
  appearance: none;
}
input::placeholder { color: var(--text-dim); font-size: 12px; }
input:focus {
  border-color: var(--primary) !important;
  box-shadow: 0 0 0 2px var(--primary-glow);
  background: rgba(0, 243, 255, 0.03);
}

.input-row { display: flex; align-items: stretch; gap: 8px; }
.input-row input { flex: 1; border-radius: 8px; }
.input-row .copy-btn {
  width: 44px;
  height: 44px;
  background: var(--bg-hover);
  border: 1px solid var(--border2);
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--primary);
  transition: all 0.2s;
  flex-shrink: 0;
}
.input-row .copy-btn:hover { 
  background: var(--primary-dim); 
  color: #fff;
  border-color: var(--primary);
  transform: scale(1.05);
}

.copy-feedback {
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--green);
  margin-top: 6px;
  opacity: 0;
  transition: opacity 0.3s;
  height: 13px;
}

#faBox { margin-top: 8px; }
#countdown {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--primary);
  margin-top: 8px;
  font-weight: 600;
}

/* =====================================================
   BUTTON
   ===================================================== */
.btn {
  width: 100%;
  height: 46px;
  background: var(--bg-hover);
  color: var(--primary);
  border: 1px solid var(--primary-line);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-top: 12px;
  position: relative;
  overflow: visible;
}
.btn::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 120%; height: 120%;
  background: radial-gradient(circle, var(--primary-glow) 0%, transparent 70%);
  transform: translate(-50%, -50%) scale(0);
  transition: transform 0.5s;
}
.btn:hover::after {
  transform: translate(-50%, -50%) scale(1);
}
.btn:hover {
  background: var(--primary);
  color: #000;
  box-shadow: 0 4px 20px var(--primary-glow);
  transform: translateY(-2px);
}
.btn:active { transform: translateY(0); }
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  border-color: var(--border2);
  color: var(--text-dim);
}
.btn:disabled:hover { background: var(--bg-hover); color: var(--text-dim); }

/* =====================================================
   GET MAIL — 2 BUTTON ROW + STATUS
   ===================================================== */
.mail-btn-row {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.btn-half {
  flex: 1;
  margin-top: 0;
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--primary-line);
  color: var(--primary);
}
.btn-outline:not(:disabled):hover {
  background: rgba(0, 243, 255, 0.1);
  color: var(--primary);
  box-shadow: 0 0 15px var(--primary-glow);
}
.btn-outline:disabled {
  border-color: var(--border2);
  color: var(--text-dim);
}

.mail-status {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--primary);
  margin-top: 8px;
  min-height: 16px;
  letter-spacing: 0.05em;
}
.mail-status.error { color: #ff3366; }
.mail-status.ok    { color: var(--green); }

/* =====================================================
   CUSTOM SELECT
   ===================================================== */
.custom-select-wrapper {
  position: relative;
  width: 100%;
  cursor: pointer;
  user-select: none;
}
.select-trigger {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 16px;
  height: 44px;
  border: 1px solid var(--border2);
  border-radius: 8px;
  background: var(--bg-input);
  color: var(--text);
  font-size: 13px;
  font-family: var(--mono);
  transition: all 0.3s;
}
.select-trigger:hover { border-color: var(--primary-line); }
.icon-arrow { font-size: 10px; color: var(--primary); pointer-events: none; transition: transform 0.3s; }
.custom-select-wrapper.open .icon-arrow { transform: rotate(180deg); }
.custom-options {
  position: absolute;
  top: calc(100% + 4px); left: 0; right: 0;
  background: var(--bg-card);
  backdrop-filter: blur(15px);
  border: 1px solid var(--border2);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  display: none;
  z-index: 9999;
  padding: 8px 0;
  margin: 0;
  overflow: hidden;
}
.custom-select-wrapper.open .custom-options { display: block; animation: slideDown 0.2s ease-out; }
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
.custom-select-wrapper.open .select-trigger { border-color: var(--primary); box-shadow: 0 0 10px var(--primary-glow); }
li.custom-option {
  padding: 12px 16px;
  font-size: 13px;
  font-family: var(--mono);
  color: var(--text);
  list-style: none;
  cursor: pointer;
  transition: all 0.2s;
}
li.custom-option:hover { background: rgba(0, 243, 255, 0.1); color: var(--primary); padding-left: 20px; }
#extra_input { display: none; margin-top: 16px; }

/* =====================================================
   VIDEO LIST
   ===================================================== */
#video-list { display: flex; flex-direction: column; gap: 8px; }

.video-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-input);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text-dim) !important;
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.3s;
}
.video-btn::before { content: '▶'; font-size: 10px; color: var(--primary-dim); transition: all 0.3s; }
.video-btn:hover {
  background: rgba(0, 243, 255, 0.05);
  border-color: var(--primary-line);
  color: var(--primary) !important;
  transform: translateX(6px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.video-btn:hover::before { color: var(--primary); text-shadow: 0 0 10px var(--primary-glow); }

/* =====================================================
   MOBILE
   ===================================================== */
.mobile-header {
  display: none;
  height: 60px;
  background: var(--bg-panel);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 999;
}
.mobile-header img { height: 120px; margin: 10px 0px 0px -20px; filter: drop-shadow(0 0 5px var(--primary-glow)); }
.hamburger {
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px;
}
.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
  transition: all 0.3s;
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 900px) {
  .sidebar { display: none; }
  .sidebar.open {
    display: flex;
    position: fixed;
    left: 0; top: 0; bottom: 0;
    z-index: 1000;
    width: 260px;
  }
  .mobile-header { display: flex; }
  .topbar { display: none; }
  .page {
    grid-template-columns: 1fr;
    padding: 20px 16px;
    gap: 16px;
  }
  .panel.span-2 { grid-column: span 1; }
}

/* =====================================================
   ACC TAB ROW
   ===================================================== */
.acc-tab-row {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.acc-tab {
  flex: 1;
  height: 44px;
  background: var(--bg-input);
  border: 1px solid var(--border2);
  border-radius: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.acc-tab:hover {
  background: rgba(0, 243, 255, 0.05);
  color: var(--primary);
  border-color: var(--primary-line);
}
.acc-tab.active {
  background: rgba(0, 243, 255, 0.1);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: inset 0 0 15px var(--primary-glow);
}
.acc-tab i { font-size: 14px; }