@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
  --primary: #ef4444; /* Vibrant Red for Blackpaint */
  --primary-hover: #dc2626;
  --gold: #f59e0b;
  --gold-hover: #d97706;
  --danger: #ef4444;
  --success: #10b981;
  --warning: #f59e0b;
  
  --bg-dark: #09090b;
  --glass-bg: rgba(24, 24, 27, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: rgba(255, 255, 255, 0.1);
}

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

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  /* Animated Background */
  background: linear-gradient(-45deg, #000000, #18181b, #3f0f1c, #000000);
  background-size: 400% 400%;
  animation: gradientBG 15s ease infinite;
  min-height: 100vh;
}

@keyframes gradientBG {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Utils */
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mb-3 { margin-bottom: 1rem; }
.w-100 { width: 100%; }
.flex-row { display: flex; gap: 0.5rem; }
.text-muted { color: var(--text-muted); }

/* Glassmorphism Classes */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 16px;
}

/* Buttons */
.btn {
  padding: 0.65rem 1.2rem;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.3px;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}
.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.btn-gold {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.4);
}

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { background: #dc2626; transform: translateY(-1px); }

.btn-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: rgba(255, 255, 255, 0.2); }

.btn-ghost {
  background: transparent;
  color: var(--text-main);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255, 255, 255, 0.05); }

.btn-icon {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  padding: 0;
  transition: all 0.3s;
}
.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(15deg);
}

/* Inputs */
input, select {
  padding: 0.75rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  background: rgba(0, 0, 0, 0.2);
  color: white;
  transition: all 0.3s;
}
input::placeholder { color: #64748b; }
input:focus, select:focus {
  border-color: var(--primary);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}
select option { background: #18181b; color: white; }

/* Layouts */
.screen { min-height: 100vh; }

/* Login */
#login-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

/* Add a glowing orb effect behind the login card */
#login-screen::before {
  content: '';
  position: absolute;
  width: 350px;
  height: 350px;
  background: var(--primary);
  filter: blur(150px);
  border-radius: 50%;
  opacity: 0.4;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 0;
  animation: pulseOrb 8s infinite alternate;
}

@keyframes pulseOrb {
  0% { transform: translate(-50%, -50%) scale(1); opacity: 0.3; }
  100% { transform: translate(-50%, -50%) scale(1.2); opacity: 0.6; }
}

.login-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 3rem 2.5rem;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 420px;
  z-index: 1;
}

.login-logo-wrap { text-align: center; margin-bottom: 2.5rem; }
.login-logo-wrap img {
  width: 180px;
  height: 80px;
  object-fit: contain;
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.1));
}
.login-logo-wrap h1 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.4rem; letter-spacing: -0.5px; }
.login-logo-wrap p { color: var(--text-muted); font-size: 0.95rem; }

.login-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  background: rgba(255, 255, 255, 0.04);
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--glass-border);
}
.login-tab {
  flex: 1;
  padding: 0.65rem 0.5rem;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
}
.login-tab:hover { color: var(--text-main); background: rgba(255,255,255,0.05); }
.login-tab.active {
  background: rgba(239, 68, 68, 0.15);
  color: #fca5a5;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.form-group { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; }
.form-group label { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px; }
.field-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.35;
  margin-top: -0.25rem;
}

.login-status {
  margin-top: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.4;
  text-align: left;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
}
.login-status.ok {
  border-color: rgba(16, 185, 129, 0.35);
  background: rgba(16, 185, 129, 0.12);
  color: #6ee7b7;
}
.login-status.err {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.12);
  color: #fca5a5;
}
.login-status.warn {
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.12);
  color: #fcd34d;
}

/* Nav */
.top-nav {
  background: white;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid #e5e7eb;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.nav-brand {
  font-weight: 700;
  font-size: 1.3rem;
  color: #111827;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-brand img { height: 35px; width: auto; object-fit: contain; }
.live-dot {
  width: 8px; height: 8px; background: var(--success); border-radius: 50%;
  box-shadow: 0 0 10px var(--success);
  animation: pulse 2s infinite;
}
@keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.4; } 100% { opacity: 1; } }

.nav-controls { display: flex; align-items: center; gap: 1.2rem; }

.user-badge {
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: #111827;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-size: 0.85rem;
  font-weight: 600;
}

.top-nav .btn-icon {
  background: #f3f4f6;
  color: #4b5563;
  border: 1px solid #e5e7eb;
}
.top-nav .btn-icon:hover {
  background: #e5e7eb;
  color: #111827;
}

/* Dashboard Content */
.dashboard-content {
  padding: 1.5rem 2rem;
  min-height: calc(100vh - 70px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

/* Admin Panel */
.panel {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  padding: 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  margin-bottom: 1.5rem;
  flex-shrink: 0;
}
.panel-header {
  display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 1rem;
}
.panel-title { font-weight: 700; font-size: 1.1rem; display: flex; align-items: center; gap: 0.5rem; }

.brief-form { display: flex; gap: 1rem; margin-top: 1.2rem; flex-wrap: wrap; align-items: flex-end; }
.brief-form input { flex: 1; min-width: 200px; }
.brief-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 140px;
}
.brief-field label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
}
.admin-slot-field select {
  min-width: 140px;
  background: var(--glass-bg);
  border-color: var(--glass-border);
  font-weight: 600;
}

/* Board & Columns */
.board {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  flex: 1;
  align-items: flex-start;
}

.designer-col {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  width: calc(16.66% - 0.85rem);
  min-width: 250px;
  display: flex;
  flex-direction: column;
}

.col-header {
  padding: 1.2rem;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 12px 12px 0 0;
}
.col-title { font-weight: 700; font-size: 1.05rem; }
.col-status {
  font-size: 0.7rem; padding: 0.3rem 0.6rem; border-radius: 6px; font-weight: 700; display: inline-block; margin-top: 6px; text-transform: uppercase; letter-spacing: 1px;
}
.col-status.aktif { background: rgba(16, 185, 129, 0.2); color: #34d399; border: 1px solid rgba(16, 185, 129, 0.3); }
.col-status.istirahat { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }

.col-body {
  padding: 1rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.col-body::-webkit-scrollbar { width: 6px; }
.col-body::-webkit-scrollbar-track { background: transparent; }
.col-body::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }

/* Task Cards */
.task-card {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 1rem;
  transition: all 0.25s ease;
  position: relative;
}
.task-card:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.25);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.task-card.khusus {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.task-header { display: flex; justify-content: space-between; margin-bottom: 0.8rem; font-size: 0.8rem; color: var(--text-muted); }
.task-admin { color: #f87171; font-weight: 600; }
.task-body { margin-bottom: 1rem; }
.task-customer { font-weight: 700; font-size: 1.1rem; margin-bottom: 0.4rem; color: white; }
.task-wa { font-size: 0.85rem; color: #a1a1aa; }

.task-footer select {
  width: 100%;
  padding: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(0,0,0,0.3);
}

.badge-khusus {
  background: linear-gradient(135deg, #f59e0b, #d97706); color: white; padding: 0.15rem 0.5rem; border-radius: 4px; font-size: 0.7rem; font-weight: 700; margin-left: 0.5rem; vertical-align: middle;
}

/* Select Checkbox */
.task-select {
  width: 1.3rem; height: 1.3rem; accent-color: var(--primary); cursor: pointer; margin-left: 0.2rem;
}

.admin-actions {
  padding: 1rem; background: rgba(0,0,0,0.2); border-top: 1px solid var(--border); border-radius: 0 0 12px 12px;
}

/* Modals & Loader */
.loader-overlay, .modal {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(8px); z-index: 9999; display: flex; justify-content: center; align-items: center;
}
.modal-content {
  background: #18181b; border: 1px solid var(--border); padding: 2.5rem; border-radius: 16px; width: 90%; max-width: 450px; box-shadow: 0 25px 50px rgba(0,0,0,0.5);
}
.modal h3 { margin-bottom: 1rem; font-size: 1.3rem; }
.spinner {
  width: 50px; height: 50px; border: 4px solid rgba(255,255,255,0.1); border-top-color: var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { color: white; font-weight: 600; text-align: center; letter-spacing: 1px; }

/* Force Logout List */
.session-list-item {
  display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding: 1rem 0;
}
.session-list-item:last-child { border-bottom: none; }
.session-info { font-size: 0.95rem; }
.session-actions { display: flex; gap: 0.5rem; }

details summary { font-weight: 600; cursor: pointer; padding: 0.5rem 0; outline: none; }
details summary:hover { color: var(--primary); }

/* SweetAlert2 Premium Dark Mode Overrides */
.swal2-popup {
  background: var(--glass-bg) !important;
  backdrop-filter: blur(25px) !important;
  -webkit-backdrop-filter: blur(25px) !important;
  border: 1px solid var(--glass-border) !important;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5) !important;
  border-radius: 20px !important;
  color: var(--text-main) !important;
}

.swal2-title {
  color: white !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 700 !important;
}

.swal2-html-container {
  color: var(--text-muted) !important;
  font-family: 'Outfit', sans-serif !important;
}

.swal2-icon.swal2-warning { border-color: var(--warning) !important; color: var(--warning) !important; }
.swal2-icon.swal2-error { border-color: var(--danger) !important; color: var(--danger) !important; }
.swal2-icon.swal2-success { border-color: var(--success) !important; color: var(--success) !important; }
.swal2-icon.swal2-info { border-color: #3b82f6 !important; color: #3b82f6 !important; }
.swal2-icon.swal2-question { border-color: #a855f7 !important; color: #a855f7 !important; }

.swal2-confirm {
  background: var(--primary) !important;
  border-radius: 8px !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3) !important;
}

.swal2-cancel {
  background: rgba(255, 255, 255, 0.1) !important;
  color: white !important;
  border-radius: 8px !important;
  font-family: 'Outfit', sans-serif !important;
  font-weight: 600 !important;
}
.swal2-cancel:hover {
  background: rgba(255, 255, 255, 0.2) !important;
}

/* ==========================================================================
   TV MONITOR MODE STYLES
   ========================================================================== */
body.tv-mode {
  background: radial-gradient(circle at center, #180808 0%, #080202 100%) !important;
}

body.tv-mode .top-nav {
  padding: 1.2rem 2.5rem;
  border-bottom: 2px solid rgba(239, 68, 68, 0.15);
  background: rgba(9, 9, 11, 0.85);
}

body.tv-mode .nav-brand span {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: 1.5px;
}

body.tv-mode .nav-brand img {
  height: 38px;
}

body.tv-mode .dashboard-content {
  padding: 2rem;
  max-width: 100% !important;
  width: 100% !important;
}

/* Make columns larger on TV */
body.tv-mode .board {
  gap: 2rem;
}

body.tv-mode .board-column {
  min-width: 320px;
  background: rgba(20, 20, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-radius: 16px;
}

body.tv-mode .designer-col {
  width: calc(16.66% - 0.85rem);
  min-width: 250px;
  background: rgba(20, 20, 25, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border-radius: 16px;
}

body.tv-mode .col-header {
  padding: 1.2rem;
  border-bottom: 2px solid rgba(255,255,255,0.06);
}

body.tv-mode .col-title {
  font-size: 1.25rem;
  font-weight: 800;
}

body.tv-mode .col-status {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
}

/* Make task cards look incredibly premium and massive on TV */
body.tv-mode .task-card {
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  border-radius: 12px;
  background: rgba(30, 30, 35, 0.85);
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
}

body.tv-mode .task-card:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 12px 30px rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.4);
}

body.tv-mode .task-card .task-customer {
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 0.6rem;
}

body.tv-mode .task-card .task-wa {
  font-size: 0.95rem;
  color: var(--text-muted);
  gap: 0.5rem;
  margin-bottom: 0.8rem;
}

body.tv-mode .task-card .task-status-select {
  display: none !important; /* Hide select box status on TV as it is read-only */
}

body.tv-mode .task-card .task-select {
  display: none !important; /* Hide checkboxes on TV */
}

/* Add a beautiful custom glowing status badge for TV */
body.tv-mode .task-card::after {
  content: attr(data-status);
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 6px;
  letter-spacing: 1px;
  margin-top: 0.6rem;
  box-shadow: 0 0 10px rgba(255,255,255,0.1);
}

body.tv-mode .task-card[data-status="Antre"]::after {
  background: rgba(239, 68, 68, 0.15);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.3);
  box-shadow: 0 0 15px rgba(239, 68, 68, 0.25);
}

body.tv-mode .task-card[data-status="Progres"]::after {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.25);
}

body.tv-mode .task-card[data-status="Revisi"]::after {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  box-shadow: 0 0 15px rgba(245, 158, 11, 0.25);
}

body.tv-mode .task-card[data-status="Waiting"]::after {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
  box-shadow: 0 0 15px rgba(168, 85, 247, 0.25);
}

body.tv-mode .task-card[data-status="Selesai"]::after {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

body.tv-mode .task-card[data-status="Pending"]::after {
  background: rgba(107, 114, 128, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

body.tv-mode .admin-actions {
  display: none !important; /* Hide admin footer column actions on TV */
}

body.tv-mode #attendance-panel {
  display: none !important; /* Hide attendance/activation panel on TV */
}

/* Status Select Dropdown in Column Header */
.col-status-select {
  transition: all 0.25s ease;
}
.col-status-select:hover {
  background: rgba(0, 0, 0, 0.6) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}
.col-status-select option {
  background: #18181b;
  color: white;
}
