/* ==========================================================================
   CheckerRekMG — Comic Premium Theme
   Colors: Dark Navy + Deep Blue + Gold Accent + Comic Pop
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Outfit:wght@400;500;600;700;800;900&family=Space+Mono:wght@400;700&display=swap');

:root {
  --bg-darkest: #070b19;
  --bg-dark: #0b132b;
  --bg-card: #0f1c3f;
  --bg-card-alt: #16244f;
  --bg-surface: rgba(15, 28, 63, 0.75);
  
  --gold-primary: #f59e0b;
  --gold-light: #fbbf24;
  --gold-bright: #ffd700;
  --gold-dark: #b45309;
  --gold-gradient: linear-gradient(135deg, #ffd700 0%, #f59e0b 50%, #b45309 100%);
  
  --blue-primary: #2563eb;
  --blue-dark: #1e3a8a;
  --blue-light: #60a5fa;
  --blue-gradient: linear-gradient(135deg, #1e3a8a 0%, #0b132b 100%);
  
  --text-white: #ffffff;
  --text-light: #e2e8f0;
  --text-muted: #94a3b8;
  --text-dim: #64748b;
  
  --status-success: #10b981;
  --status-success-bg: rgba(16, 185, 129, 0.15);
  --status-danger: #ef4444;
  --status-danger-bg: rgba(239, 68, 68, 0.15);
  --status-warning: #f59e0b;
  --status-warning-bg: rgba(245, 158, 11, 0.15);
  --status-info: #3b82f6;
  --status-info-bg: rgba(59, 130, 246, 0.15);
  
  --comic-shadow: 4px 4px 0px #030712;
  --comic-shadow-sm: 2px 2px 0px #030712;
  --comic-shadow-gold: 4px 4px 0px #b45309;
  --comic-border: 2px solid #f59e0b;
  --comic-border-subtle: 1px solid rgba(245, 158, 11, 0.3);
  --card-radius: 14px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Outfit', sans-serif;
  background-color: var(--bg-darkest);
  background-image: 
    radial-gradient(circle at 10% 10%, rgba(30, 58, 138, 0.25) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.1) 0%, transparent 45%),
    linear-gradient(to bottom, #070b19, #0b132b);
  background-attachment: fixed;
  color: var(--text-light);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Comic Halftone Overlay Effect */
.comic-halftone-bg {
  position: relative;
}
.comic-halftone-bg::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: radial-gradient(rgba(245, 158, 11, 0.08) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
  z-index: 1;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--text-white);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.font-comic {
  font-family: 'Bangers', cursive, sans-serif;
  letter-spacing: 0.05em;
}

.text-gold {
  color: var(--gold-light);
}

.text-gold-gradient {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-muted {
  color: var(--text-muted);
}

.text-mono {
  font-family: 'Space Mono', monospace;
}

/* App Wrapper Layout */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* Sidebar */
.app-sidebar {
  width: 260px;
  background-color: #080f24;
  border-right: 2px solid rgba(245, 158, 11, 0.35);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: transform 0.3s ease;
  overflow-y: auto;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.5);
}

.sidebar-header {
  padding: 24px 20px;
  border-bottom: 2px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, #0f1c3f 0%, #080f24 100%);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.sidebar-brand img {
  height: 38px;
  filter: drop-shadow(2px 2px 0px #030712);
}

.sidebar-section-title {
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--gold-light);
  padding: 16px 20px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.sidebar-nav {
  list-style: none;
  padding: 8px 12px;
  flex: 1;
}

.sidebar-item {
  margin-bottom: 6px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text-light);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  transition: var(--transition);
  border: 1px solid transparent;
}

.sidebar-link:hover {
  background-color: rgba(37, 99, 235, 0.15);
  color: var(--gold-light);
  border-color: rgba(245, 158, 11, 0.4);
  transform: translateX(4px);
  box-shadow: var(--comic-shadow-sm);
}

.sidebar-link.active {
  background: linear-gradient(90deg, #1e3a8a 0%, #16244f 100%);
  color: #ffffff;
  border: 1.5px solid var(--gold-primary);
  box-shadow: 2px 2px 0px #000;
}

.sidebar-link .icon {
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
}

.sidebar-user {
  padding: 16px 16px;
  border-top: 2px solid rgba(245, 158, 11, 0.25);
  background-color: #060c1d;
  display: flex;
  align-items: center;
  gap: 12px;
}

.user-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #0b132b;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 1.1rem;
  border: 2px solid #ffffff;
  box-shadow: var(--comic-shadow-sm);
  flex-shrink: 0;
}

.user-info {
  flex: 1;
  overflow: hidden;
}

.user-name {
  font-weight: 700;
  color: #ffffff;
  font-size: 0.95rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  background-color: #1e3a8a;
  color: #93c5fd;
  border: 1px solid #3b82f6;
  text-transform: uppercase;
}

.user-role-badge.superadmin {
  background-color: #854d0e;
  color: #fef08a;
  border-color: #f59e0b;
}

/* Main Content Area */
.app-main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: margin-left 0.3s ease;
}

/* Top Navigation Bar */
.app-topbar {
  height: 70px;
  background: rgba(11, 19, 43, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 2px solid rgba(245, 158, 11, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 900;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.mobile-toggle-btn {
  display: none;
  background: #111d40;
  border: 1.5px solid var(--gold-primary);
  color: #ffffff;
  font-size: 1.3rem;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  cursor: pointer;
  box-shadow: var(--comic-shadow-sm);
}

.page-title-badge {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: #ffffff;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

/* Comic Buttons */
.comic-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  position: relative;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border: 2px solid #000;
  box-shadow: var(--comic-shadow);
}

.comic-btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0px #000;
}

.comic-btn-gold {
  background: var(--gold-gradient);
  color: #0b132b;
  border-color: #ffd700;
}

.comic-btn-gold:hover {
  background: linear-gradient(135deg, #fef08a 0%, #fbbf24 50%, #d97706 100%);
  transform: translateY(-2px);
  box-shadow: 5px 5px 0px #000;
}

.comic-btn-blue {
  background: linear-gradient(135deg, #2563eb 0%, #1e3a8a 100%);
  color: #ffffff;
  border-color: #60a5fa;
}

.comic-btn-blue:hover {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  transform: translateY(-2px);
  box-shadow: 5px 5px 0px #000;
}

.comic-btn-danger {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  color: #ffffff;
  border-color: #f87171;
}

.comic-btn-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%);
  transform: translateY(-2px);
  box-shadow: 5px 5px 0px #000;
}

.comic-btn-outline {
  background: transparent;
  color: var(--text-light);
  border-color: var(--gold-primary);
}

.comic-btn-outline:hover {
  background: rgba(245, 158, 11, 0.15);
  color: var(--gold-bright);
}

.comic-btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 6px;
  box-shadow: var(--comic-shadow-sm);
}

/* Page Content Container */
.page-body {
  padding: 28px;
  flex: 1;
}

/* Comic Cards */
.comic-card {
  background-color: var(--bg-card);
  border: var(--comic-border);
  border-radius: var(--card-radius);
  box-shadow: var(--comic-shadow);
  padding: 24px;
  position: relative;
  overflow: hidden;
  margin-bottom: 24px;
  transition: var(--transition);
}

.comic-card:hover {
  border-color: var(--gold-light);
}

.comic-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  border-bottom: 1.5px solid rgba(245, 158, 11, 0.2);
  padding-bottom: 14px;
}

.comic-card-title {
  font-size: 1.25rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
}

.comic-card-title .icon {
  color: var(--gold-primary);
  font-size: 1.4rem;
}

/* Comic Badge / Pill */
.comic-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 30px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  border: 1.5px solid #000;
  box-shadow: var(--comic-shadow-sm);
}

.comic-pill-success {
  background-color: var(--status-success);
  color: #042f2e;
  border-color: #059669;
}

.comic-pill-danger {
  background-color: var(--status-danger);
  color: #ffffff;
  border-color: #b91c1c;
}

.comic-pill-warning {
  background-color: var(--status-warning);
  color: #451a03;
  border-color: #d97706;
}

.comic-pill-info {
  background-color: var(--status-info);
  color: #ffffff;
  border-color: #1d4ed8;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 28px;
}

.stat-card {
  background: linear-gradient(145deg, #111d40 0%, #0d1733 100%);
  border: 2px solid rgba(245, 158, 11, 0.35);
  border-radius: 12px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--comic-shadow);
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--gold-light);
  box-shadow: 6px 6px 0px #000;
}

.stat-card::after {
  content: '';
  position: absolute;
  top: -20px;
  right: -20px;
  width: 80px;
  height: 80px;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.2) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.stat-icon {
  font-size: 1.5rem;
}

.stat-value {
  font-size: 2.2rem;
  font-weight: 900;
  color: #ffffff;
  line-height: 1;
  font-family: 'Outfit', sans-serif;
}

/* Form Controls */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-light);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.form-control, .form-select {
  width: 100%;
  background-color: #0a1128;
  border: 2px solid #23366f;
  border-radius: 10px;
  padding: 12px 16px;
  color: #ffffff;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  transition: var(--transition);
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.4);
}

.form-control:focus, .form-select:focus {
  outline: none;
  border-color: var(--gold-light);
  background-color: #0e1738;
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.25);
}

textarea.form-control {
  resize: vertical;
  min-height: 140px;
  font-family: 'Space Mono', monospace;
  font-size: 0.95rem;
}

/* Tables */
.comic-table-container {
  overflow-x: auto;
  border-radius: 10px;
  border: 2px solid rgba(245, 158, 11, 0.3);
  box-shadow: var(--comic-shadow);
}

.comic-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  background-color: #0b142e;
}

.comic-table th {
  background-color: #111d42;
  color: var(--gold-light);
  font-weight: 800;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 14px 18px;
  border-bottom: 2px solid var(--gold-primary);
}

.comic-table td {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(35, 54, 111, 0.6);
  font-size: 0.92rem;
  font-weight: 500;
}

.comic-table tr:hover td {
  background-color: rgba(30, 58, 138, 0.2);
}

/* Result Card */
.result-card-box {
  background: linear-gradient(145deg, #0f1c3f 0%, #070c1d 100%);
  border: 3px solid var(--gold-primary);
  border-radius: 16px;
  box-shadow: 6px 6px 0px #000;
  padding: 30px;
  margin-top: 24px;
  position: relative;
  animation: popIn 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px dashed rgba(245, 158, 11, 0.3);
}

.result-row:last-child {
  border-bottom: none;
}

.result-label {
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.88rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.result-val {
  font-weight: 800;
  font-size: 1.15rem;
  color: #ffffff;
}

/* Progress Bar */
.progress-container {
  width: 100%;
  background-color: #070c1b;
  border: 2px solid #23366f;
  border-radius: 20px;
  height: 24px;
  overflow: hidden;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.6);
  position: relative;
  margin: 16px 0;
}

.progress-bar-fill {
  height: 100%;
  background: var(--gold-gradient);
  border-radius: 20px;
  transition: width 0.4s ease;
  position: relative;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.5);
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 12px;
  pointer-events: none;
}

.comic-toast {
  pointer-events: auto;
  background-color: #0d1736;
  border: 2px solid var(--gold-primary);
  border-radius: 12px;
  padding: 16px 20px;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 4px 4px 0px #000;
  min-width: 300px;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: slideInRight 0.3s ease;
}

.comic-toast.success { border-color: var(--status-success); }
.comic-toast.error { border-color: var(--status-danger); }
.comic-toast.warning { border-color: var(--status-warning); }
.comic-toast.info { border-color: var(--status-info); }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
  .app-sidebar {
    transform: translateX(-100%);
  }
  .app-sidebar.show {
    transform: translateX(0);
  }
  .app-main {
    margin-left: 0;
  }
  .mobile-toggle-btn {
    display: inline-flex;
  }
}

@media (max-width: 640px) {
  .page-body {
    padding: 16px;
  }
  .app-topbar {
    padding: 0 16px;
  }
  .comic-card {
    padding: 16px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
