:root {
  --bg-dark: #09090b;
  --panel-bg: rgba(24, 24, 27, 0.6);
  --panel-border: rgba(255, 255, 255, 0.08);
  --accent-cyan: #06b6d4;
  --accent-purple: #a855f7;
  --accent-red: #ef4444;
  --accent-green: #22c55e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', 'Sarabun', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Ambient Orbs */
.ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: -1;
  opacity: 0.5;
}

.orb-1 {
  background: var(--accent-purple);
  width: 400px;
  height: 400px;
  top: -100px;
  left: -100px;
}

.orb-2 {
  background: var(--accent-cyan);
  width: 500px;
  height: 500px;
  bottom: -200px;
  right: -100px;
  opacity: 0.3;
}

/* Container & Header */
.app-container {
  max-width: 680px;
  margin: 0 auto;
  padding: 40px 20px;
}

.app-header {
  text-align: center;
  margin-bottom: 40px;
}

.header-badge {
  display: inline-block;
  background: rgba(168, 85, 247, 0.15);
  color: var(--accent-purple);
  padding: 4px 12px;
  border-radius: 20px;
  font-family: var(--font-title);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 1px;
  margin-bottom: 15px;
  border: 1px solid rgba(168, 85, 247, 0.3);
}

.app-header h1 {
  font-family: var(--font-title);
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -1px;
}

.text-gradient {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
}

/* Glass Panels */
.glass-panel {
  background: var(--panel-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.highlight-panel {
  border-color: rgba(6, 182, 212, 0.3);
  box-shadow: 0 0 20px rgba(6, 182, 212, 0.1);
}

.panel-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--panel-border);
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.panel-icon {
  font-size: 1.2rem;
}

.panel-header h2 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  font-weight: 600;
}

.panel-body {
  padding: 24px;
}

/* Forms */
.form-row {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
}

@media (max-width: 500px) {
  .form-row { flex-direction: column; }
}

.input-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="time"],
select {
  width: 100%;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(255,255,255,0.1);
  color: white;
  padding: 14px 16px;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  transition: all 0.3s ease;
  outline: none;
}

input:focus, select:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.2);
}

.select-wrapper {
  position: relative;
}

.select-wrapper::after {
  content: "▼";
  font-size: 0.7rem;
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

/* Time Grid */
.time-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.time-header-row label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.time-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 10px;
}

.time-box {
  position: relative;
}

.time-checkbox {
  position: absolute;
  opacity: 0;
  cursor: pointer;
}

.time-label {
  display: block;
  text-align: center;
  padding: 12px 0;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.9rem;
  font-family: var(--font-title);
  transition: all 0.2s ease;
  user-select: none;
}

.time-box:hover .time-label {
  background: rgba(255, 255, 255, 0.05);
}

.time-checkbox:checked ~ .time-label {
  background: rgba(6, 182, 212, 0.15);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  font-weight: 600;
}

.badge-placeholder {
  position: absolute;
  top: -6px;
  right: -6px;
}

.time-badge {
  background: var(--accent-cyan);
  color: var(--bg-dark);
  font-size: 0.7rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: zoomIn 0.2s ease;
}

/* Priority Queue */
.selected-times-preview {
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 54px;
  align-items: center;
}

.priority-item {
  background: rgba(6, 182, 212, 0.1);
  border: 1px solid rgba(6, 182, 212, 0.4);
  color: var(--accent-cyan);
  border-radius: 8px;
  padding: 6px 12px;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  animation: slideIn 0.2s ease;
}

.priority-number {
  background: var(--accent-cyan);
  color: var(--bg-dark);
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 800;
}

/* Checkbox */
.custom-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  position: relative;
  padding: 16px;
  background: rgba(0,0,0,0.2);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  transition: all 0.2s;
}

.custom-checkbox:hover {
  background: rgba(255,255,255,0.03);
}

.custom-checkbox input {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

.checkmark {
  height: 20px;
  width: 20px;
  background-color: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  margin-top: 2px;
  position: relative;
}

.custom-checkbox input:checked ~ .checkmark {
  background-color: var(--accent-purple);
  border-color: var(--accent-purple);
}

.checkmark:after {
  content: "";
  position: absolute;
  display: none;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.custom-checkbox input:checked ~ .checkmark:after {
  display: block;
}

.checkbox-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.checkbox-label strong {
  color: #fff;
  font-size: 0.95rem;
}

.checkbox-label span {
  color: var(--text-muted);
  font-size: 0.8rem;
  line-height: 1.4;
}

/* Buttons */
.btn {
  font-family: var(--font-title);
  font-size: 1rem;
  font-weight: 600;
  padding: 16px 24px;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: white;
  box-shadow: 0 8px 25px rgba(168, 85, 247, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(168, 85, 247, 0.6);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.btn-outline {
  background: transparent;
  border: 1px solid rgba(6, 182, 212, 0.5);
  color: var(--accent-cyan);
}

.btn-outline:hover {
  background: rgba(6, 182, 212, 0.1);
  transform: translateY(-1px);
}

.btn-full { width: 100%; }

.btn-text {
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.85rem;
  cursor: pointer;
}

.btn-text:hover {
  text-decoration: underline;
}

/* Terminal */
.terminal-section {
  padding: 0;
  background: #020105;
}

.terminal-header {
  padding: 12px 20px;
  background: rgba(255,255,255,0.02);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  display: flex;
  align-items: center;
}

.terminal-dots {
  display: flex;
  gap: 6px;
  margin-right: 15px;
}

.terminal-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}
.terminal-dot.red { background: #ff5f56; }
.terminal-dot.yellow { background: #ffbd2e; }
.terminal-dot.green { background: #27c93f; }

.terminal-title {
  font-family: var(--font-title);
  color: var(--text-muted);
  font-size: 0.8rem;
  flex-grow: 1;
}

#clearLogsBtn {
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s;
}

#clearLogsBtn:hover { opacity: 1; }

.terminal-body {
  padding: 20px;
  font-family: 'Outfit', monospace;
  font-size: 0.85rem;
  height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.log-line.system { color: #f59e0b; }
.log-line.success { color: var(--accent-green); }
.log-line.error { color: var(--accent-red); }
.log-line.info { color: var(--accent-cyan); }
.log-line.normal { color: #fff; }

/* Utilities */
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.mb-3 { margin-bottom: 16px; }

@keyframes slideIn {
  from { transform: translateX(10px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes zoomIn {
  from { transform: scale(0.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* Instruction Steps UI styling */
.instruction-steps {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.step-item {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.step-badge {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: white;
  font-family: var(--font-title);
  font-size: 0.85rem;
  font-weight: 800;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(168, 85, 247, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.step-content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.step-content strong {
  font-size: 0.95rem;
  color: var(--text-main);
  font-weight: 600;
}

.step-content p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

