/* ================================
   ROOT VARIABLES
================================ */
:root {
  /* Normal mode colors */
  --primary: #00aaff;   /* Sky Blue */
  --secondary: #87ceeb; /* Light Sky Blue */
  --accent: #4cc9f0;
  --light: #f8f9fa;
  --dark: #212529;
  --success: #2ecc71;
  --danger: #e74c3c;
  --warning: #f39c12;
  --info: #3498db;

  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-800: #343a40;
  --gray-900: #212529;

  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px rgba(0,0,0,0.1);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;

  color-scheme: light dark;
}

/* Dark mode overrides */
body.dark-mode {
  --primary: #4361ee;   /* Keep your previous dark mode colors */
  --secondary: #3a0ca3;
}


/* ================================
   BASE
================================ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  background: linear-gradient(135deg, #f5f7fa, #e4edf5);
  color: var(--dark);
  min-height: 100vh;
  transition: background 0.3s, color 0.3s;
}

body.dark-mode {
  background: linear-gradient(135deg, #121212, #1a1a1a);
  color: #eaeaea;
}

/* ================================
   CONTAINER & HEADER
================================ */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 1.5rem;
}

header {
  text-align: center;
  margin-bottom: 2rem;
}

h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  margin-bottom: 1rem;
}

/* ================================
   CONTROLS
================================ */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin: 2rem 0;
}

button,
a.action-btn,
a.action-btn1 {
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.action-btn {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
  min-height: 44px;
  transition: transform 0.3s, box-shadow 0.3s;
}

.action-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.action-btn1 {
  background: linear-gradient(135deg, var(--success), #27ae60);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-sm);
}

body.dark-mode .action-btn,
body.dark-mode .action-btn1 {
  filter: brightness(1.1);
}

/* ================================
   COUNTDOWN
================================ */
.countdown-container {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: var(--radius-lg);
  padding: 2rem;
  margin: 2rem 0;
  text-align: center;
  box-shadow: var(--shadow-lg);
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.countdown-item {
  background: rgba(255,255,255,0.15);
  padding: 1rem;
  border-radius: var(--radius-md);
  min-width: 80px;
}

.countdown-item span:first-child {
  font-size: 1.8rem;
  font-weight: 700;
}

.countdown-item span:last-child {
  font-size: 0.9rem;
}

/* ================================
   TABLE
================================ */
.table-container {
  overflow-x: auto;
  margin-bottom: 2rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

th {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 1rem;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--gray-200);
}

tbody tr:hover {
  background: rgba(67,97,238,0.05);
}

body.dark-mode th {
  background: linear-gradient(135deg, #4c51bf, #2d3748);
}

body.dark-mode td {
  border-color: rgba(255,255,255,0.1);
}

/* ================================
   RESPONSIVE
================================ */
@media (max-width: 768px) {
  .countdown-item {
    min-width: 70px;
  }

  table {
    font-size: 0.85rem;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 2rem;
  }

  .controls {
    flex-direction: column;
    gap: 1rem;
  }
}
@media print {
  /* Hide controls/buttons/inputs when printing */
  .controls, #searchInput, #darkModeBtn, #printBtn, #visitorCount {
    display: none !important;
  }
  
  /* Simplify the background for printing */
  body {
    background: white !important;
    color: black !important;
  }

  /* Make table full width and with borders for print clarity */
  table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  
  th, td {
    border: 1px solid #000 !important;
    padding: 8px !important;
    color: black !important;
  }

  /* Remove shadows and rounded corners */
  .countdown-container, .container, table, tbody tr {
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Ensure all text is visible and big enough */
  body, h1, h2, p, table, th, td {
    font-size: 12pt !important;
    color: black !important;
  }
}
