/* CSS Variables - Dark Theme */
:root {
  --background: hsl(222, 47%, 11%);
  --foreground: hsl(0, 0%, 98%);
  --card: hsl(217, 32%, 17%);
  --card-foreground: hsl(0, 0%, 98%);
  --popover: hsl(222, 47%, 11%);
  --popover-foreground: hsl(0, 0%, 98%);
  --primary: hsl(218, 91%, 60%);
  --primary-foreground: hsl(0, 0%, 98%);
  --secondary: hsl(217, 32%, 17%);
  --secondary-foreground: hsl(0, 0%, 98%);
  --muted: hsl(217, 32%, 17%);
  --muted-foreground: hsl(215, 20.2%, 65.1%);
  --accent: hsl(217, 32%, 17%);
  --accent-foreground: hsl(0, 0%, 98%);
  --destructive: hsl(0, 62.8%, 30.6%);
  --destructive-foreground: hsl(0, 0%, 98%);
  --border: hsl(217, 32%, 17%);
  --input: hsl(217, 32%, 17%);
  --ring: hsl(224, 76.3%, 48%);
  --radius: 1rem;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  border-color: var(--border);
}

html {
  overflow-x: hidden;
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: 'Inter', sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Utility Classes */
.min-h-screen { min-height: 100vh; }
.flex { display: flex; }
.w-full { width: 100%; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-between: space-between; }
.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-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.px-4 { padding: 0 1rem; }
.py-2 { padding: 0.5rem 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mr-1 { margin-right: 0.25rem; }
.rounded-lg { border-radius: 0.5rem; }
.text-sm { font-size: 0.875rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.text-center { text-align: center; }
.text-right { text-right: right; }
.overflow-hidden { overflow: hidden; }
.overflow-x-hidden { overflow-x: hidden; }
.max-w-full { max-width: 100%; }
.whitespace-nowrap { white-space: nowrap; }
.relative { position: relative; }
.absolute { position: absolute; }
.cursor-pointer { cursor: pointer; }
.pointer-events-none { pointer-events: none; }
.opacity-50 { opacity: 0.5; }

/* Background Gradient */
.bg-gradient {
  background: linear-gradient(to bottom right, var(--background), hsl(222, 47%, 11%, 0.8));
}

/* Glass Morphism */
.glass {
  backdrop-filter: blur(16px);
  background: linear-gradient(to bottom right, 
    rgba(255, 255, 255, 0.05), 
    rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.glass-hover {
  transition: background-color 200ms;
}

.glass-hover:hover {
  background: rgba(255, 255, 255, 0.1);
}

.glass-gradient {
  background: linear-gradient(to bottom right, 
    rgba(255, 255, 255, 0.1), 
    rgba(255, 255, 255, 0.05));
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Grid Layouts */
.grid {
  display: grid;
}

.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}

/* Colors */
.text-primary {
  color: var(--primary);
}

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

.text-green-400 {
  color: rgb(74 222 128);
}

.text-red-400 {
  color: rgb(248 113 113);
}

.text-green-500 {
  color: rgb(34 197 94);
}

.bg-primary {
  background-color: var(--primary);
}

.bg-accent {
  background-color: var(--accent);
}

.border-green-500 {
  border-color: rgb(34 197 94);
}

/* Animations */
.hover-scale {
  transition: transform 200ms;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.animate-fade-in {
  animation: fade-in 0.3s ease-out;
}

@keyframes fade-in {
  0% {
    opacity: 0;
    transform: translateY(10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes marquee {
  0% {
    transform: translateX(100%);
  }
  100% {
    transform: translateX(-100%);
  }
}

.animate-marquee {
  animation: marquee 25s linear infinite;
  display: inline-block;
}

/* Sidebar */
.sidebar {
  width: 256px;
  background: var(--card);
  border-right: 1px solid var(--border);
  transition: margin-left 300ms;
}

.sidebar.hidden {
  margin-left: -256px;
}

.sidebar-content {
  padding: 1rem;
}

.sidebar-menu {
  list-style: none;
}

.sidebar-menu-item {
  margin-bottom: 0.5rem;
}

.sidebar-menu-button {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 1rem;
  width: 100%;
  text-decoration: none;
  color: var(--foreground);
  border-radius: 0.5rem;
  transition: background-color 200ms;
}

.sidebar-menu-button:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Table Styles */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 0.75rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.table th {
  font-weight: 500;
  font-size: 0.875rem;
}

.table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

/* Calendar Styles */
.calendar {
  width: 100%;
}

.calendar-month {
  width: 100%;
}

.calendar-week {
  display: flex;
  justify-content: space-between;
  width: 100%;
}

.calendar-day {
  height: 2rem;
  width: 2rem;
  padding: 0;
  font-weight: normal;
  border: none;
  background: transparent;
  color: var(--foreground);
  border-radius: 50%;
  cursor: pointer;
  position: relative;
  transition: background-color 200ms;
}

.calendar-day:hover {
  background: rgba(255, 255, 255, 0.1);
}

.calendar-day.selected {
  background: var(--primary);
  color: var(--primary-foreground);
}

.calendar-day.today {
  background: var(--accent);
  color: var(--accent-foreground);
}

.calendar-day.highlighted {
  color: rgb(34 197 94);
}

.calendar-day.highlighted::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 2px solid rgb(34 197 94);
  border-radius: 50%;
  background: linear-gradient(to bottom right, 
    rgba(34, 197, 94, 0.1), 
    rgba(34, 197, 94, 0.05));
  opacity: 0.7;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 0.5rem;
  padding: 1rem;
  justify-content: center;
}

.pagination-item {
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: var(--foreground);
  transition: background-color 200ms;
}

.pagination-item:hover {
  background: rgba(255, 255, 255, 0.1);
}

.pagination-item.active {
  background: var(--primary);
  color: var(--primary-foreground);
}

/* Responsive Design */
@media (min-width: 768px) {
  .md\:grid-cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .lg\:grid-cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .animate-marquee {
    animation-duration: 15s;
  }
}

/* Chart Container */
.chart-container {
  position: relative;
  height: 200px;
  width: 100%;
}

/* Tooltip */
.tooltip {
  position: absolute;
  z-index: 1000;
  padding: 0.5rem;
  background: rgba(0, 0, 0, 0.9);
  color: white;
  border-radius: 0.375rem;
  font-size: 0.875rem;
  pointer-events: none;
  opacity: 0;
  transition: opacity 200ms;
}

.tooltip.show {
  opacity: 1;
}

/* Range Indicator */
.range-indicator {
  position: relative;
  flex: 1;
  height: 0.25rem;
  background: var(--secondary);
  border-radius: 9999px;
}

.range-dot {
  position: absolute;
  height: 0.75rem;
  width: 0.75rem;
  border-radius: 50%;
  background: var(--primary);
  transform: translateY(-25%);
}

/* Sparkline Container */
.sparkline {
  height: 2.5rem;
  width: 100%;
}

/* Button Styles */
button {
  border: none;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

/* Flex wrap for responsive design */
.flex-wrap {
  flex-wrap: wrap;
}

.min-w-200 {
  min-width: 200px;
}

/* Icon sizing */
.h-3 { height: 0.75rem; }
.w-3 { width: 0.75rem; }
.h-4 { height: 1rem; }
.w-4 { width: 1rem; }
.h-5 { height: 1.25rem; }
.w-5 { width: 1.25rem; }
.h-6 { height: 1.5rem; }
.w-6 { width: 1.5rem; }