:root {
  --bg-dark: #0f172a;
  --bg-light: #f8fafc;
  --text-dark: #f1f5f9;
  --text-light: #1e293b;
  --primary: #3b82f6;
  --secondary: #8b5cf6;
  --accent: #10b981;
  --neon-glow: 0 0 10px rgba(59, 130, 246, 0.5), 0 0 20px rgba(139, 92, 246, 0.3);

  --easy-color: #10b981;
  --medium-color: #f59e0b;
  --hard-color: #ef4444;

  --glass-bg: rgba(30, 41, 59, 0.7);
  --glass-border: rgba(255, 255, 255, 0.1);
  --card-hover: rgba(51, 65, 85, 0.8);
}

body.light-theme {
  --bg-dark: #f8fafc;
  --text-dark: #1e293b;
  --glass-bg: rgba(255, 255, 255, 0.8);
  --glass-border: rgba(0, 0, 0, 0.1);
  --card-hover: rgba(241, 245, 249, 0.9);
  --neon-glow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Inter', sans-serif;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-dark);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
  transition: background-color 0.3s, color 0.3s;
}

/* Striped Background */
.glow-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: repeating-linear-gradient(45deg,
      #000000,
      #000000 20px,
      #ffffff 20px,
      #ffffff 40px);
  opacity: 0.15;
  /* Added opacity to make the UI readable */
  z-index: -1;
  pointer-events: none;
}

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

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(8px);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
}

.glass-card:hover {
  background: var(--card-hover);
  transform: translateY(-2px);
  box-shadow: var(--neon-glow);
}

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--glass-border);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.search-container {
  position: relative;
  width: 40%;
  max-width: 500px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
}

.search-container input {
  width: 100%;
  padding: 0.75rem 1rem 0.75rem 2.5rem;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--glass-border);
  color: var(--text-dark);
  outline: none;
  transition: all 0.3s;
}

body.light-theme .search-container input {
  background: #fff;
  color: var(--text-light);
}

.search-container input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--primary);
}

.theme-toggle {
  background: transparent;
  border: none;
  color: var(--text-dark);
  cursor: pointer;
  font-size: 1.2rem;
  transition: transform 0.3s;
}

.theme-toggle:hover {
  transform: rotate(30deg);
  color: #f59e0b;
}

/* Layout */
.main-container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem;
  gap: 2rem;
  min-height: calc(100vh - 70px);
}

/* Sidebar */
.sidebar {
  width: 280px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.filter-section {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1.25rem;
}

.filter-section h3 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sidebar-search {
  width: 100%;
  padding: 0.5rem;
  margin-bottom: 1rem;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-dark);
  outline: none;
}

body.light-theme .sidebar-search {
  background: #f1f5f9;
  color: var(--text-light);
}

.filter-list {
  list-style: none;
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

.filter-list::-webkit-scrollbar {
  width: 4px;
}

.filter-list::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 4px;
}

.filter-list li {
  padding: 0.4rem 0;
}

/* Custom Checkbox */
.checkbox-container {
  display: flex;
  align-items: center;
  position: relative;
  padding-left: 28px;
  cursor: pointer;
  user-select: none;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.checkbox-container:hover {
  color: var(--primary);
}

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

.checkmark {
  position: absolute;
  top: 0;
  left: 0;
  height: 18px;
  width: 18px;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--glass-border);
  border-radius: 4px;
  transition: all 0.2s;
}

.checkbox-container:hover input~.checkmark {
  background-color: rgba(255, 255, 255, 0.2);
}

.checkbox-container input:checked~.checkmark {
  background-color: var(--primary);
  border-color: var(--primary);
}

.checkbox-container input:checked~.checkmark.easy-check {
  background-color: var(--easy-color);
  border-color: var(--easy-color);
}

.checkbox-container input:checked~.checkmark.medium-check {
  background-color: var(--medium-color);
  border-color: var(--medium-color);
}

.checkbox-container input:checked~.checkmark.hard-check {
  background-color: var(--hard-color);
  border-color: var(--hard-color);
}


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

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

/* Main Content */
.content-area {
  flex-grow: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.hidden {
  display: none !important;
}

/* Dashboard Stats */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.stat-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.stat-card h3 {
  color: #94a3b8;
  font-size: 1.1rem;
}

.stat-value {
  font-size: 2.5rem;
  font-weight: 700;
}

.neon-text {
  text-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.streak {
  color: var(--medium-color);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.progress-bar-bg {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 1s ease-in-out;
}

.diff-stats {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.chart-container {
  position: relative;
  height: 250px;
  width: 100%;
  margin-top: 1rem;
}

/* Question List */
.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--glass-border);
}

.glass-select {
  background: var(--glass-bg);
  color: var(--text-dark);
  border: 1px solid var(--glass-border);
  padding: 0.5rem 1rem;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

body.light-theme .glass-select {
  color: var(--text-light);
}

.questions-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.question-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem;
  border-left: 4px solid transparent;
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.question-card.status-solved {
  border-left-color: var(--accent);
  background: rgba(16, 185, 129, 0.05);
}

.q-main {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.q-status {
  cursor: pointer;
  color: #475569;
  font-size: 1.2rem;
  transition: all 0.2s;
}

.q-status:hover {
  color: var(--accent);
  transform: scale(1.1);
}

.q-status.solved {
  color: var(--accent);
}

.q-info {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.q-title {
  color: var(--text-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  transition: color 0.2s;
}

.q-title:hover {
  text-decoration: underline;
  color: var(--primary);
}

.q-meta {
  display: flex;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: #94a3b8;
  flex-wrap: wrap;
}

.diff-badge {
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.diff-badge.easy {
  color: var(--easy-color);
  background: rgba(16, 185, 129, 0.1);
}

.diff-badge.medium {
  color: var(--medium-color);
  background: rgba(245, 158, 11, 0.1);
}

.diff-badge.hard {
  color: var(--hard-color);
  background: rgba(239, 68, 68, 0.1);
}

.tag {
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 8px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
}

.q-actions {
  display: flex;
  gap: 1rem;
}

.btn-icon {
  background: transparent;
  color: var(--text-dark);
  border: 1px solid var(--glass-border);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
  transform: scale(1.05);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  margin-top: 2rem;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Confetti Container */
#confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
}

/* Responsive */
@media (max-width: 900px) {
  .main-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
  }

  .search-container {
    width: 100%;
    margin-top: 1rem;
    order: 3;
  }

  .navbar {
    flex-wrap: wrap;
  }
}