/* Lottery Management System - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Hind+Siliguri:wght@300;400;500;600;700&family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --background: #F0F4F7;
  --foreground: #212121;
  --card: #FFFFFF;
  --card-foreground: #212121;
  --popover: #FFFFFF;
  --popover-foreground: #212121;
  --primary: #FDBE15;
  --primary-hover: #B58A00;
  --primary-foreground: #000000;
  --secondary: #F5F5F5;
  --secondary-foreground: #212121;
  --muted: #F5F5F5;
  --muted-foreground: #757575;
  --accent: #E6111C;
  --accent-foreground: #FFF;
  --destructive: #E6111C;
  --destructive-foreground: #FFF;
  --border: #E0E0E0;
  --input: #FFFFFF;
  --input-background: #FFFFFF;
  --ring: #FDBE15;
  --radius: 0.625rem;
  --sidebar: #FFFFFF;
  --sidebar-border: #E0E0E0;
  --warning: #f59e0b;
  --success: #10b981;
}

/* Inherits from :root */

[data-theme="dark"] {
  --background: #000000;
  --foreground: #ffffff;
  --card: #000000;
  --card-foreground: #ffffff;
  --popover: #000000;
  --popover-foreground: #ffffff;
  --primary: #FDBE15;
  --primary-hover: #D49D00;
  --primary-foreground: #000000;
  --secondary: #0a0a0a;
  --secondary-foreground: #ffffff;
  --muted: #0a0a0a;
  --muted-foreground: #a1a1aa;
  --accent: #E6111C;
  --accent-foreground: #ffffff;
  --destructive: #E6111C;
  --destructive-foreground: #ffffff;
  --border: #1a1a1a;
  --input: #000000;
  --input-background: #000000;
  --ring: #FDBE15;
  --sidebar: #000000;
  --sidebar-border: #1a1a1a;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  font-family: 'Hind Siliguri', 'Inter', ui-sans-serif, system-ui, sans-serif;
  background-color: var(--background);
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
}

button {
  cursor: pointer;
  font-family: inherit;
}

input,
select,
textarea {
  font-family: inherit;
}

/* ============ UTILITIES ============ */
.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.grid {
  display: grid;
}

.block {
  display: block;
}

.inline-flex {
  display: inline-flex;
}

.items-center {
  align-items: center;
}

.items-start {
  align-items: flex-start;
}

.justify-center {
  justify-content: center;
}

.justify-between {
  justify-content: space-between;
}

.justify-start {
  justify-content: flex-start;
}

.justify-end {
  justify-content: flex-end;
}

.flex-col {
  flex-direction: column;
}

.flex-row {
  flex-direction: row;
}

.flex-wrap {
  flex-wrap: wrap;
}

.flex-1 {
  flex: 1;
}

.shrink-0 {
  flex-shrink: 0;
}

.gap-1 {
  gap: 0.25rem;
}

.gap-2 {
  gap: 0.5rem;
}

.gap-3 {
  gap: 0.75rem;
}

.gap-4 {
  gap: 1rem;
}

.gap-6 {
  gap: 1.5rem;
}

.p-2 {
  padding: 0.5rem;
}

.p-3 {
  padding: 0.75rem;
}

.p-4 {
  padding: 1rem;
}

.p-6 {
  padding: 1.5rem;
}

.px-3 {
  padding-inline: 0.75rem;
}

.px-4 {
  padding-inline: 1rem;
}

.py-2 {
  padding-block: 0.5rem;
}

.py-3 {
  padding-block: 0.75rem;
}

.py-4 {
  padding-block: 1rem;
}

.py-8 {
  padding-block: 2rem;
}

.mt-1 {
  margin-top: 0.25rem;
}

.mt-2 {
  margin-top: 0.5rem;
}

.mt-4 {
  margin-top: 1rem;
}

.mb-2 {
  margin-bottom: 0.5rem;
}

.mb-4 {
  margin-bottom: 1rem;
}

.mr-2 {
  margin-right: 0.5rem;
}

.ml-auto {
  margin-left: auto;
}

.mx-auto {
  margin-inline: auto;
}

.w-full {
  width: 100%;
}

.w-fit {
  width: fit-content;
}

.h-full {
  height: 100%;
}

.min-h-screen {
  min-height: 100vh;
}

.text-xs {
  font-size: 0.75rem;
}

.text-sm {
  font-size: 0.875rem;
}

.text-base {
  font-size: 1rem;
}

.text-lg {
  font-size: 1.125rem;
}

.text-xl {
  font-size: 1.25rem;
}

.text-2xl {
  font-size: 1.5rem;
}

.text-3xl {
  font-size: 1.875rem;
}

.font-normal {
  font-weight: 400;
}

.font-medium {
  font-weight: 500;
}

.font-semibold {
  font-weight: 600;
}

.font-bold {
  font-weight: 700;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.text-white {
  color: #fff;
}

.text-primary {
  color: var(--primary);
}

.text-muted {
  color: var(--muted-foreground);
}

.text-destructive {
  color: var(--destructive);
}

.text-green {
  color: #10b981;
}

.text-yellow {
  color: #f59e0b;
}

.bg-card {
  background-color: var(--card);
}

.bg-primary {
  background-color: var(--primary);
}

.bg-secondary {
  background-color: var(--secondary);
}

.bg-background {
  background-color: var(--background);
}

.bg-input {
  background-color: var(--input);
}

.border {
  border: 1px solid var(--border);
}

.border-primary {
  border-color: var(--primary);
}

.rounded {
  border-radius: 0.25rem;
}

.rounded-md {
  border-radius: calc(var(--radius) - 2px);
}

.rounded-lg {
  border-radius: var(--radius);
}

.rounded-xl {
  border-radius: calc(var(--radius) + 4px);
}

.rounded-full {
  border-radius: 9999px;
}

.shadow-md {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
}

.shadow-lg {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

.overflow-hidden {
  overflow: hidden;
}

.overflow-x-auto {
  overflow-x: auto;
}

.relative {
  position: relative;
}

.absolute {
  position: absolute;
}

.fixed {
  position: fixed;
}

.sticky {
  position: sticky;
}

.table-container {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whitespace-nowrap {
  white-space: nowrap;
}

.opacity-50 {
  opacity: 0.5;
}

.opacity-70 {
  opacity: 0.7;
}

.transition {
  transition: all 0.15s ease;
}

.cursor-pointer {
  cursor: pointer;
}

/* ============ COMMON COMPONENTS ============ */

/* Card */
.card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--card-foreground);
}

.card-header {
  padding: 1.5rem 1.5rem 0;
}

.card-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--foreground);
}

.card-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-top: 0.25rem;
}

.card-content {
  padding: 1.5rem;
}

.card-footer {
  padding: 0 1.5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.15s ease;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.btn-primary:hover {
  background-color: var(--primary-hover);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--secondary-foreground);
}

.btn-secondary:hover {
  background-color: var(--border);
}

.btn-destructive {
  background-color: var(--destructive);
  color: #fff;
}

.btn-destructive:hover {
  background-color: #b91c1c;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--border);
  color: var(--foreground);
}

.btn-outline:hover {
  background-color: var(--secondary);
}

.btn-ghost {
  background-color: transparent;
  color: var(--foreground);
}

.btn-ghost:hover {
  background-color: var(--secondary);
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

.btn-icon {
  padding: 0.5rem;
  width: 2.25rem;
  height: 2.25rem;
}

/* Form Elements */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.form-input {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  color: var(--foreground);
  font-size: 0.875rem;
  transition: border-color 0.15s ease, box-shadow 0.15rem ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 147, 78, 0.2);
}

.form-input::placeholder {
  color: var(--muted-foreground);
}

.form-select {
  width: 100%;
  padding: 0.5rem 0.75rem;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  color: var(--foreground);
  font-size: 0.875rem;
  outline: none;
  cursor: pointer;
}

.form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(23, 147, 78, 0.2);
}

/* Input with icon */
.input-wrapper {
  position: relative;
}

.input-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  width: 1rem;
  height: 1rem;
  pointer-events: none;
}

.input-with-icon {
  padding-left: 2.5rem;
}

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.badge-pending {
  background-color: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border: 1px solid #f59e0b;
}

.badge-active {
  background-color: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid #10b981;
}

.badge-inactive {
  background-color: rgba(220, 38, 38, 0.15);
  color: #dc2626;
  border: 1px solid #dc2626;
}

.badge-completed {
  background-color: rgba(107, 114, 128, 0.15);
  color: #6b7280;
  border: 1px solid #6b7280;
}

/* Alert */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  border: 1px solid;
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
}

.alert-info {
  background-color: rgba(23, 147, 78, 0.1);
  border-color: var(--border);
  color: var(--foreground);
}

.alert-warning {
  background-color: rgba(245, 158, 11, 0.1);
  border-color: #f59e0b;
  color: #f59e0b;
}

.alert-destructive {
  background-color: rgba(220, 38, 38, 0.1);
  border-color: var(--destructive);
  color: var(--destructive);
}

/* Table */
.table-container {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table thead tr {
  border-bottom: 1px solid var(--border);
}

.data-table th {
  padding: 0.75rem 1rem;
  text-align: left;
  font-weight: 600;
  color: var(--muted-foreground);
  font-size: 0.8125rem;
}

.data-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.02);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
  gap: 0.75rem;
}

.empty-state-icon {
  color: var(--muted-foreground);
  opacity: 0.5;
}

.empty-state-title {
  color: var(--primary);
  font-size: 1rem;
  font-weight: 500;
}

.empty-state-desc {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Divider */
.divider {
  height: 1px;
  background-color: var(--border);
  margin: 1rem 0;
}

/* Toast notification */
.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
  background-color: var(--card);
  border: 1px solid var(--border);
  color: var(--foreground);
  font-size: 0.875rem;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
  pointer-events: all;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 200px;
  max-width: 360px;
  animation: slideIn 0.3s ease;
}

.toast-success {
  border-color: var(--primary);
}

.toast-error {
  border-color: var(--destructive);
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }

  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Modal/Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  width: 100%;
  max-width: 32rem;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.2);
}

.modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.modal-desc {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 1.5rem;
}

.modal-footer {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* ============ NAVIGATION ============ */

/* Top bar (always visible at the top) */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background-color: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 0.75rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.navbar-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 0;
}

/* Hamburger button: always visible */
.mobile-menu-btn {
  display: inline-flex;
  flex-shrink: 0;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--foreground);
  text-decoration: none;
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
}

.navbar-logo img {
  height: 2rem;
  width: auto;
  max-width: 150px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .navbar-logo img {
    height: 1.75rem;
    max-width: 110px;
  }
}

@media (max-width: 360px) {
  .navbar-logo img {
    height: 1.5rem;
    max-width: 90px;
  }
}

/* Sidebar: always a fixed left panel */
.navbar-nav {
  position: fixed;
  top: 4rem; /* below topbar */
  left: -260px;
  width: 240px;
  height: calc(100vh - 4rem);
  background-color: var(--card);
  border-right: 1px solid var(--border);
  flex-direction: column;
  align-items: stretch;
  padding: 1rem 0.5rem;
  overflow-y: auto;
  transition: left 0.3s ease;
  z-index: 150;
  display: flex;
  gap: 0.15rem;
}

/* Open state (toggled by JS) */
.navbar-nav.open {
  left: 0;
}

/* On desktop (≥769px), sidebar is visible by default */
@media (min-width: 769px) {
  .navbar-nav {
    left: 0;
  }
}

/* Sidebar header (close button) – only visible on mobile */
.sidebar-header {
  display: none;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 768px) {
  .sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
}

/* Sidebar logo: visible only on mobile when sidebar opens */
.sidebar-logo {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-logo {
    display: flex;
  }
}

/* Dashboard wrapper - pushes content right of sidebar on desktop */
.dashboard-page {
  padding-top: 4rem; /* below fixed topbar */
}

@media (min-width: 769px) {
  .dashboard-page {
    padding-left: 240px;
  }
}

/* Overlay behind sidebar on mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 140;
}

.sidebar-overlay.active {
  display: block;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted-foreground);
  text-decoration: none;
  transition: all 0.15s ease;
  width: 100%;
}

.nav-link span {
  display: inline !important;
}

.nav-link:hover {
  background-color: var(--secondary);
  color: var(--foreground);
}

.nav-link.active {
  background-color: var(--primary);
  color: var(--primary-foreground);
}

.navbar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* Hide logout text on small screens */
@media (max-width: 480px) {
  .navbar-right .btn span, 
  .navbar-right .btn-sm span {
    display: none !important;
  }
  
  /* If logout button doesn't have a span around text, we might need to wrap it in PHP or use this trick */
  .navbar-right a.btn-sm {
    padding: 0.5rem !important;
    width: 2.25rem;
    height: 2.25rem;
  }
}

  /* Hide non-critical badges on small screens to prevent overflow */
  @media (max-width: 500px) {
    .user-badge {
      display: none !important;
    }
    .balance-badge {
      display: none !important;
    }
  }


.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.5rem;
  background-color: var(--secondary);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8rem;
  color: var(--foreground);
  white-space: nowrap;
}

.balance-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.5rem;
  background-color: var(--primary);
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}



/* ============ AUTH PAGES ============ */
.auth-page {
  min-height: 100vh;
  background-color: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-image: radial-gradient(circle at 20% 50%, rgba(253, 190, 21, 0.08) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(253, 190, 21, 0.08) 0%, transparent 50%);
}

.auth-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 2rem;
  width: 100%;
  max-width: 28rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
}

.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.auth-title {
  color: var(--primary);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 0.25rem;
}

.auth-subtitle {
  color: var(--foreground);
  font-size: 1rem;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-submit {
  width: 100%;
  padding: 0.625rem 1rem;
  background-color: var(--primary);
  color: #fff;
  border: none;
  border-radius: calc(var(--radius) - 2px);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: background-color 0.15s ease;
  margin-top: 0.5rem;
}

.auth-submit:hover {
  background-color: var(--primary-hover);
}

.auth-links {
  text-align: center;
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.auth-links a {
  color: var(--primary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.auth-links a:hover {
  text-decoration: underline;
}

/* ============ DASHBOARD LAYOUT ============ */
.dashboard-page {
  min-height: 100vh;
  background-color: var(--background);
  /* padding-top and padding-left are set in the nav section above */
}

.dashboard-content {
  padding: 1.5rem;
  max-width: 1400px;
}

.page-header {
  margin-bottom: 1.5rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.25rem;
}

.page-subtitle {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.page-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.stat-info {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stat-label {
  font-size: 1rem;
  font-weight: 500;
  color: var(--foreground);
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
}

.stat-desc {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: -0.25rem;
}

.stat-icon {
  color: var(--primary);
  opacity: 0.8;
}

/* Content Sections */
.content-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.content-card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.content-card-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary);
}

.content-card-subtitle {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin-top: 0.125rem;
}

.content-card-body {
  padding: 1.5rem;
}

/* Filter bar */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
  min-width: 200px;
  max-width: 360px;
}

.search-input-wrapper svg {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted-foreground);
  width: 1rem;
  height: 1rem;
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.25rem;
  background-color: var(--input);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) - 2px);
  color: var(--foreground);
  font-size: 0.875rem;
  outline: none;
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(23, 147, 78, 0.2);
}

.search-input::placeholder {
  color: var(--muted-foreground);
}

/* Action buttons */
.action-btns {
  display: flex;
  gap: 0.375rem;
}

/* Lottery card */
.lottery-card {
  background-color: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.lottery-card:hover {
  border-color: var(--primary);
}

.lottery-card-header {
  padding: 1rem 1.25rem;
  background: linear-gradient(135deg, rgba(23, 147, 78, 0.15) 0%, rgba(23, 147, 78, 0.05) 100%);
  border-bottom: 1px solid var(--border);
}

.lottery-card-body {
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.lottery-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
}

.lottery-card-label {
  color: var(--muted-foreground);
}

.lottery-card-value {
  font-weight: 500;
  color: var(--foreground);
}

.lottery-card-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--border);
  margin-top: auto;
}

/* Quiz Cards - Inspired by reference */
.qz-card {
    background: var(--card);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.qz-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.qz-header {
    background-color: #1a1a1a;
    color: #fff;
    position: relative;
    overflow: hidden; /* Added to contain absolute children like the badge */
}

.qz-header img {
    position: relative;
    display: block;
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    opacity: 1; /* Was 0.4 when text overlaid it */
}

.qz-header-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

/* Video wrapper inside qz-header */
.qz-video-wrapper {
    position: relative;
    width: 100%;
    height: auto;
    display: block;
    overflow: hidden;
}

.qz-video {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    opacity: 1;
    display: block;
}

/* Middle Play button floating on top of the video */
.qz-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.65);
    border: none;
    border-radius: 50%;
    width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    transition: background 0.2s ease, transform 0.15s ease;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.qz-play-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: translate(-50%, -50%) scale(1.1);
}

.qz-play-btn svg {
    margin-left: 4px; /* visually center the play icon triangle */
}

.qz-badge {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--primary);
    color: var(--primary-foreground);
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    z-index: 3;
}

.qz-body {
    background-color: #FDBE15; /* Specific Vibrant Yellow */
    padding: 1.25rem;
    color: #000;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1; /* Fills remaining space */
}

[data-theme="dark"] .qz-body {
    background-color: #D49D00;
}

.qz-title {
    font-size: 1.25rem;
    font-weight: 800;
    text-transform: uppercase;
    margin-bottom: 0.25rem;
}

.qz-prize {
    font-size: 0.875rem;
    font-weight: 600;
}

.qz-question {
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: rgba(0,0,0,0.05);
    border-radius: 4px;
    word-break: break-word; /* Added */
}

.qz-rules-header {
    background-color: #ff0000 !important;
    color: #ffffff !important;
    font-size: 0.9rem !important;
    font-weight: 900 !important;
    padding: 8px 20px !important;
    border-radius: 0 !important; /* Strict Rectangle */
    margin: 15px auto !important;
    width: fit-content !important;
    display: inline-block !important; /* Better for centering in flex with width:fit-content */
    text-align: center !important;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3) !important;
    border: none !important;
    line-height: 1 !important;
}

.qz-rules-list {
    font-size: 0.8rem;
    line-height: 1.4;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    margin-top: 0.25rem;
}

.qz-rules-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    padding: 0.4rem 0;
}

.qz-point-bullet {
    width: 10px;
    height: 10px;
    background-color: #ff0000;
    border-radius: 50%;
    margin-top: 0.3rem;
    flex-shrink: 0;
    box-shadow: 0 0 4px rgba(255,0,0,0.5), inset 0 0 2px rgba(255,255,255,0.5);
    border: 1px solid rgba(0,0,0,0.1);
}

.qz-rules-item:last-child {
    border-bottom: none;
}

.qz-footer {
    padding: 1rem;
    background: var(--card);
    margin-top: auto; /* Ensures it stays at bottom */
}

/* Grid for quizzes */
.quiz-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

@media (max-width: 480px) {
    .quiz-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

.qz-countdown {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.25rem;
    width: 100%;
    margin-bottom: 1rem;
}

.qz-timer-item {
    text-align: center;
}

.qz-timer-val {
    font-size: 1rem;
    font-weight: 800;
}

.qz-timer-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    opacity: 0.7;
}

/* WINPKU Logo */
.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1;
  min-width: max-content;
}

.logo-main {
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(135deg, #f59e0b, #ef4444, #17934e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

@media (max-width: 480px) {
  .logo-main {
    font-size: 1.1rem;
  }
}

.logo-sub {
  font-size: 0.55rem;
  color: var(--muted-foreground);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.logo-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: radial-gradient(circle, #f59e0b, #ef4444);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: white;
  font-weight: 900;
}

/* Activation pending badge */
.activation-pending {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  background-color: var(--destructive);
  color: #fff;
  border-radius: calc(var(--radius) - 2px);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* System info list */
.system-info-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.system-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.system-info-row:last-child {
  border-bottom: none;
}

.system-info-label {
  color: var(--muted-foreground);
}

.system-info-value {
  font-weight: 500;
  color: var(--primary);
}

/* Profile NID upload */
.nid-upload-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.nid-upload-box {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.nid-upload-box:hover {
  border-color: var(--primary);
}

.nid-upload-icon {
  color: var(--muted-foreground);
  font-size: 2rem;
}

.nid-upload-label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.nid-upload-hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Withdrawal dialog */
.withdrawal-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.withdrawal-method-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.875rem;
  background-color: var(--secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.15s ease;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--foreground);
}

.withdrawal-method-btn:hover,
.withdrawal-method-btn.selected {
  border-color: var(--primary);
  background-color: rgba(23, 147, 78, 0.1);
  color: var(--primary);
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}

/* Loading spinner */
.spinner {
  width: 1.25rem;
  height: 1.25rem;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .navbar {
    padding: 0 1rem;
    gap: 0.75rem;
  }

  .nav-link span {
    display: none;
  }

  .dashboard-content {
    padding: 1rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .nid-upload-area {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .withdrawal-methods {
    grid-template-columns: 1fr;
  }
}