
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ========================================
THEME VARIABLES (CINEMATIC EPIC - LIGHT & DARK)
======================================== 
*/
:root {
  /* Light Mode - Epic Bright Glass */
  --bg-color: #f8fafc;
  --orb-color: rgba(99, 102, 241, 0.2);
  --card-bg: rgba(255, 255, 255, 0.6);
  --card-border: rgba(99, 102, 241, 0.15);
  --card-shadow: 0 10px 40px -10px rgba(99, 102, 241, 0.15), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  --accent-primary: #4f46e5;
  --accent-secondary: #0ea5e9;
  --title-gradient: linear-gradient(to right, #4f46e5, #0ea5e9, #4f46e5);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --input-bg: rgba(255, 255, 255, 0.5);
  --input-border: rgba(99, 102, 241, 0.2);
  --input-focus: rgba(255, 255, 255, 0.9);
  --btn-start-bg: linear-gradient(135deg, #1e293b, #0f172a);
  --btn-start-text: #ffffff;
  --item-bg: rgba(255, 255, 255, 0.5);
  --link-bg: rgba(14, 165, 233, 0.1);
  --copy-bg: rgba(255, 255, 255, 0.5);
  --copy-hover: rgba(255, 255, 255, 0.9);
  --status-bg: rgba(255, 255, 255, 0.5);
  --overlay-bg: rgba(79, 70, 229, 0.1);
  --overlay-hover: rgba(79, 70, 229, 0.2);
  --stop-bg: rgba(239, 68, 68, 0.1);
  --stop-hover: rgba(239, 68, 68, 0.2);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
  /* Dark Mode - Pitch Black Cinematic */
  --bg-color: #000000;
  --orb-color: rgba(99, 102, 241, 0.25);
  --card-bg: rgba(15, 15, 20, 0.4);
  --card-border: rgba(99, 102, 241, 0.3);
  --card-shadow: 0 0 30px rgba(79, 70, 229, 0.1), inset 0 0 20px rgba(79, 70, 229, 0.05);
  --accent-primary: #818cf8;
  --accent-secondary: #38bdf8;
  --title-gradient: linear-gradient(to right, #ffffff, #818cf8, #ffffff);
  --text-main: #f8fafc;
  --text-muted: #a1a1aa;
  --input-bg: rgba(0, 0, 0, 0.5);
  --input-border: rgba(99, 102, 241, 0.2);
  --input-focus: rgba(15, 15, 20, 0.8);
  --btn-start-bg: linear-gradient(135deg, #f8fafc, #cbd5e1);
  --btn-start-text: #000000;
  --item-bg: rgba(15, 15, 20, 0.5);
  --link-bg: rgba(56, 189, 248, 0.1);
  --copy-bg: rgba(255, 255, 255, 0.05);
  --copy-hover: rgba(255, 255, 255, 0.15);
  --status-bg: rgba(0, 0, 0, 0.4);
  --overlay-bg: rgba(99, 102, 241, 0.15);
  --overlay-hover: rgba(99, 102, 241, 0.3);
  --stop-bg: rgba(239, 68, 68, 0.15);
  --stop-hover: rgba(239, 68, 68, 0.3);
}

/* ========================================
BASE LAYOUT & PERSISTENT ORB
======================================== 
*/
body {
  background-color: var(--bg-color);
  font-family: 'Plus Jakarta Sans', sans-serif;
  color: var(--text-main);
  margin: 0;
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  transition: background-color 0.5s ease, color 0.5s ease;
  position: relative;
}

/* Epic Glowing Orb behind everything */
body::before {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  width: 70vw; height: 70vw;
  background: radial-gradient(circle, var(--orb-color) 0%, rgba(0,0,0,0) 65%);
  transform: translate(-50%, -50%);
  animation: pulseGlow 4s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

/* ========================================
SPLASH SCREEN (CINEMATIC EPIC)
======================================== 
*/
.splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: var(--bg-color); 
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  overflow: hidden;
  perspective: 1000px;
}

/* Cinematic Top/Bottom Black Bars */
.cinematic-bar {
  position: absolute;
  left: 0;
  width: 100%;
  height: 12vh;
  background: #000;
  z-index: 10;
  transition: transform 1.2s cubic-bezier(0.8, 0, 0.2, 1);
}
.cinematic-bar.top { top: 0; }
.cinematic-bar.bottom { bottom: 0; }

.splash-screen.hidden .cinematic-bar.top { transform: translateY(-100%); }
.splash-screen.hidden .cinematic-bar.bottom { transform: translateY(100%); }

.splash-screen.hidden {
  animation: cinematicExit 1.2s cubic-bezier(0.8, 0, 0.2, 1) forwards;
  pointer-events: none;
}

.splash-content {
  text-align: center;
  z-index: 5;
}

.splash-title {
  font-size: 48px;
  font-weight: 800;
  margin: 0 0 10px 0;
  text-transform: uppercase;
  background: var(--title-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 30px var(--orb-color));
  animation: cinematicText 3s cubic-bezier(0.2, 1, 0.3, 1) forwards, shine 4s linear infinite;
}

.splash-subtitle {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  margin: 0 0 50px 0;
  animation: cinematicSubtitle 3s cubic-bezier(0.2, 1, 0.3, 1) forwards;
}

.loading-container {
  width: 320px;
  height: 2px;
  background: rgba(128, 128, 128, 0.2);
  margin: 0 auto;
  position: relative;
  overflow: visible;
}

.loading-bar {
  height: 100%;
  width: 0%;
  background: var(--accent-primary);
  box-shadow: 0 0 15px var(--accent-primary), 0 0 5px var(--accent-secondary);
  position: relative;
  animation: loadingFill 3s cubic-bezier(0.65, 0, 0.05, 1) forwards;
}

/* Glowing head of the loading bar */
.loading-bar::after {
  content: '';
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 2px;
  background: #ffffff;
  box-shadow: 0 0 20px 4px rgba(255, 255, 255, 0.8), 0 0 10px 2px var(--accent-secondary);
  border-radius: 50%;
}

@keyframes cinematicText {
  0% { opacity: 0; transform: scale(1.15) translateY(20px); filter: blur(12px); letter-spacing: -4px; }
  100% { opacity: 1; transform: scale(1) translateY(0); filter: blur(0); letter-spacing: 4px; }
}

@keyframes cinematicSubtitle {
  0% { opacity: 0; letter-spacing: 2px; transform: translateY(-10px); }
  100% { opacity: 0.6; letter-spacing: 12px; transform: translateY(0); }
}

@keyframes shine {
  to { background-position: 200% center; }
}

@keyframes pulseGlow {
  0% { opacity: 0.5; transform: translate(-50%, -50%) scale(0.9); }
  100% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
}

@keyframes loadingFill {
  0% { width: 0%; }
  40% { width: 30%; }
  75% { width: 85%; }
  100% { width: 100%; }
}

@keyframes cinematicExit {
  0% { opacity: 1; transform: scale(1); filter: blur(0); }
  60% { opacity: 1; background: transparent; }
  100% { opacity: 0; transform: scale(1.15); filter: blur(10px); visibility: hidden; }
}

/* ========================================
MAIN WRAPPER & GLASS CARDS
======================================== 
*/
.wrapper {
  display: flex;
  gap: 20px;
  width: 95%;
  max-width: 820px;
  z-index: 10;
}

.card {
  flex: 1;
  background: var(--card-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 28px;
  border-radius: 20px;
  border: 1px solid var(--card-border);
  box-shadow: var(--card-shadow);
  position: relative;
  transition: all 0.4s ease;
  overflow: hidden;
}

.card:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 40px rgba(99, 102, 241, 0.2), inset 0 0 20px rgba(99, 102, 241, 0.05);
}

/* HEADER & TITLES */
.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.title {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--accent-primary);
  text-shadow: 0 0 10px rgba(99, 102, 241, 0.3);
}

.subtitle {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 24px;
  letter-spacing: -0.5px;
  /* Cinematic text gradient applied to dashboard titles too */
  background: var(--title-gradient);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: shine 4s linear infinite;
}

/* TOGGLE THEME BUTTON */
.theme-toggle-btn {
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  color: var(--text-main);
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.theme-toggle-btn:hover {
  background: var(--input-focus);
  transform: translateY(-2px);
  box-shadow: 0 0 15px var(--orb-color);
  border-color: var(--accent-primary);
}

/* INPUTS */
.label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 8px;
  display: block;
}

.input-group {
  position: relative;
  margin-bottom: 20px;
}

input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  background: var(--input-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--input-border);
  border-radius: 10px;
  color: var(--text-main);
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  transition: var(--transition);
}

input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

input:focus {
  outline: none;
  background: var(--input-focus);
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.2), 0 0 20px rgba(99, 102, 241, 0.2);
}

input[readonly] {
  background: rgba(128, 128, 128, 0.05);
  color: var(--text-muted);
  border: 1px dashed var(--input-border);
  cursor: default;
}

/* BUTTONS */
.flex {
  display: flex;
  gap: 10px;
}

button {
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  border: none;
  border-radius: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.3px;
}

button:hover {
  transform: translateY(-2px);
}

button:active {
  transform: translateY(0);
}

.copy {
  background: var(--copy-bg);
  color: var(--text-main);
  border: 1px solid var(--input-border);
  backdrop-filter: blur(10px);
}

.copy:hover {
  background: var(--copy-hover);
  border-color: var(--accent-primary);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.2);
}

.overlay {
  background: var(--overlay-bg);
  color: var(--accent-primary);
  border: 1px solid var(--input-border);
  flex: 1;
}

.overlay:hover {
  background: var(--overlay-hover);
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px var(--orb-color);
}

.start {
  width: 100%;
  background: var(--btn-start-bg);
  color: var(--btn-start-text);
  padding: 14px;
  margin-top: 10px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.start:hover {
  box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
  filter: brightness(1.2);
}

.stop {
  background: var(--stop-bg);
  color: var(--accent-red);
  padding: 14px;
  margin-top: 10px;
  flex: 1;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.stop:hover {
  background: var(--stop-hover);
  border-color: var(--accent-red);
  box-shadow: 0 0 20px rgba(239, 68, 68, 0.2);
}

/* STATUS BAR */
.status {
  margin-top: 24px;
  padding: 12px 16px;
  background: var(--status-bg);
  backdrop-filter: blur(10px);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--input-border);
  transition: all 0.3s ease;
}

/* OVERLAY LIST (Right Card) */
.overlay-container {
  max-height: 380px;
  overflow-y: auto;
  padding-right: 10px;
}

.overlay-container::-webkit-scrollbar {
  width: 5px;
}
.overlay-container::-webkit-scrollbar-track {
  background: transparent;
}
.overlay-container::-webkit-scrollbar-thumb {
  background: var(--card-border);
  border-radius: 10px;
}
.overlay-container::-webkit-scrollbar-thumb:hover {
  background: var(--accent-primary);
}

.overlay-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 12px 14px;
  background: var(--item-bg);
  backdrop-filter: blur(10px);
  border-radius: 14px;
  border: 1px solid var(--input-border);
  transition: var(--transition);
}

.overlay-item:hover {
  border-color: var(--accent-primary);
  background: var(--overlay-bg);
  transform: translateY(-2px);
  box-shadow: 0 4px 15px var(--orb-color);
}

.overlay-item span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.overlay-buttons {
  display: flex;
  gap: 6px;
}

.link {
  background: var(--link-bg);
  color: var(--accent-secondary);
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 8px;
}

.link:hover {
  background: var(--accent-secondary);
  color: #fff;
  box-shadow: 0 0 10px var(--accent-secondary);
}

.copy-small {
  background: var(--copy-bg);
  color: var(--text-muted);
  border: 1px solid var(--input-border);
  padding: 6px 12px;
  font-size: 11px;
  border-radius: 8px;
}

.copy-small:hover {
  color: var(--text-main);
  background: var(--copy-hover);
  border-color: var(--text-main);
}

.footer {
  margin-top: 25px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  border-top: 1px solid var(--input-border);
  padding-top: 20px;
}

.footer a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 700;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.footer a:hover {
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
  text-shadow: 0 0 10px var(--orb-color);
}

/* Animations & Responsiveness */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(15px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Menunda animasi masuk card agar berjalan bertepatan dengan hilangnya splash screen */
.card { 
  opacity: 0;
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards; 
  animation-delay: 3.2s; 
}
.card:nth-child(2) { 
  animation-delay: 3.4s; 
}

@media (max-width: 768px) {
  .wrapper {
    flex-direction: column;
    padding: 20px 0;
    height: 100vh;
    overflow-y: auto;
  }
  body {
    height: auto;
    align-items: flex-start;
  }
  .card {
    border-radius: 16px;
    padding: 20px;
  }
}