/* Theme CSS Variables */
:root {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-primary: #38bdf8;
  --accent-secondary: #818cf8;
  --accent-tertiary: #f472b6;
  --border-color: #475569;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #f87171;
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* Background Animation */
.bg-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
  animation: orbFloat 20s ease-in-out infinite;
}

.bg-orb.orb-1 {
  width: 400px;
  height: 400px;
  background: var(--accent-primary);
  top: -100px;
  left: -100px;
  animation-delay: 0s;
}

.bg-orb.orb-2 {
  width: 300px;
  height: 300px;
  background: var(--accent-secondary);
  bottom: -50px;
  right: -50px;
  animation-delay: -7s;
}

.bg-orb.orb-3 {
  width: 250px;
  height: 250px;
  background: var(--accent-tertiary);
  top: 50%;
  left: 50%;
  animation-delay: -14s;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.1); }
  50% { transform: translate(-30px, 50px) scale(0.9); }
  75% { transform: translate(-50px, -20px) scale(1.05); }
}

/* Cursor Trail */
.cursor-dot,
.cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.cursor-dot {
  width: 8px;
  height: 8px;
  background: var(--accent-primary);
}

.cursor-ring {
  width: 32px;
  height: 32px;
  border: 2px solid var(--accent-primary);
  opacity: 0.5;
  transition: width 0.2s, height 0.2s, opacity 0.2s;
}

/* Header */
header {
  padding: 24px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(15, 23, 42, 0.8);
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.logo span {
  color: var(--accent-primary);
}

/* Theme Selector */
.theme-controls {
  display: flex;
  align-items: center;
  gap: 16px;
}

.theme-dropdown {
  position: relative;
}

.theme-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 18px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-secondary);
  color: var(--text-primary);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
}

.theme-btn:hover {
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.2);
}

.theme-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 260px;
  max-height: 400px;
  overflow-y: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all var(--transition);
  z-index: 200;
}

.theme-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.theme-category {
  padding: 8px 0;
  border-bottom: 1px solid var(--border-color);
}

.theme-category:last-child {
  border-bottom: none;
}

.theme-category-label {
  padding: 8px 16px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  font-weight: 600;
}

.theme-option {
  padding: 10px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: background var(--transition);
}

.theme-option:hover {
  background: var(--bg-tertiary);
}

.theme-option.active {
  background: rgba(56, 189, 248, 0.15);
  border-left: 3px solid var(--accent-primary);
}

.theme-preview {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

/* Loading Animation */
.loader-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  transition: opacity 0.5s, visibility 0.5s;
}

.loader-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.loader {
  width: 60px;
  height: 60px;
  border: 4px solid var(--bg-tertiary);
  border-top-color: var(--accent-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

/* Main Content */
main {
  padding: 40px;
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  font-size: 2rem;
  margin-bottom: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.section-subtitle {
  color: var(--text-secondary);
  margin-bottom: 40px;
  font-size: 1.1rem;
}

/* Dashboard Grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform var(--transition), box-shadow var(--transition);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.card h3 {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.metric-change {
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 6px;
}

.metric-change.up { color: var(--success); }
.metric-change.down { color: var(--danger); }

/* Charts */
.chart-container {
  position: relative;
  height: 240px;
  margin-top: 16px;
}

.chart-bar,
.chart-line {
  width: 100%;
  height: 100%;
}

/* Tables */
.table-card {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th,
.data-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.data-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  font-weight: 600;
}

.data-table tr {
  transition: background var(--transition);
}

.data-table tbody tr:hover {
  background: var(--bg-tertiary);
}

.status {
  display: inline-flex;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}

.status.active { background: rgba(74, 222, 128, 0.15); color: var(--success); }
.status.pending { background: rgba(251, 191, 36, 0.15); color: var(--warning); }
.status.inactive { background: rgba(248, 113, 113, 0.15); color: var(--danger); }

/* Buttons */
.btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.btn:active {
  transform: translateY(0);
}

/* Progress Bars */
.progress-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.progress-item {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

.progress-bar {
  height: 8px;
  background: var(--bg-tertiary);
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  animation: progressGrow 1.5s ease-out forwards;
  transform-origin: left;
}

@keyframes progressGrow {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

/* Animations Demo */
.animations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.anim-box {
  height: 120px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  border: 1px solid var(--border-color);
}

.pulse { animation: pulse 2s ease-in-out infinite; }
.bounce { animation: bounce 1.5s ease-in-out infinite; }
.shake { animation: shake 0.8s ease-in-out infinite; }
.flip { animation: flip 2s ease-in-out infinite; }
.glow { animation: glow 2s ease-in-out infinite; }
.float { animation: float 3s ease-in-out infinite; }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-20px); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-8px); }
  75% { transform: translateX(8px); }
}

@keyframes flip {
  0%, 100% { transform: rotateY(0); }
  50% { transform: rotateY(180deg); }
}

@keyframes glow {
  0%, 100% { box-shadow: 0 0 5px var(--accent-primary); }
  50% { box-shadow: 0 0 30px var(--accent-primary), 0 0 60px var(--accent-secondary); }
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-15px) rotate(5deg); }
}

/* Mouse Effects */
.mouse-demo {
  height: 200px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  position: relative;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.mouse-spotlight {
  position: absolute;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(56, 189, 248, 0.3) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 0.3s;
}

.mouse-demo:hover .mouse-spotlight {
  opacity: 1;
}

/* Footer */
footer {
  text-align: center;
  padding: 40px;
  color: var(--text-secondary);
  border-top: 1px solid var(--border-color);
  margin-top: 60px;
}

/* Responsive */
@media (max-width: 768px) {
  header {
    flex-direction: column;
    gap: 16px;
    padding: 16px 20px;
  }
  main { padding: 20px; }
  .dashboard-grid { grid-template-columns: 1fr; }
}
