/* Shared Theme Styles for All Pages */

/* CSS Custom Properties with Responsive Design Tokens */
:root {
  /* Container Widths */
  --container-xs: 100%;
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1280px;
  --container-2xl: 1536px;

  /* Color System - Semantic naming */
  --primary-blue: #fe2c55;
  --secondary-purple: #25f4ee;
  --accent-green: #25f4ee;
  --accent-cyan: #fe2c55;
  --accent-yellow: #fcd34d;
  --accent-orange: #fb923c;

  /* Background System */
  --bg-dark: #000000;
  --bg-card: rgba(0, 0, 0, 0.3);
  --bg-primary: var(--bg-dark);
  --bg-secondary: var(--bg-dark);
  --bg-surface: var(--bg-card);
  --bg-surface-hover: rgba(0, 0, 0, 0.4);
  --bg-surface-pressed: rgba(0, 0, 0, 0.5);
  --bg-overlay: rgba(0, 0, 0, 0.95);

  /* Text System */
  --text-primary: #ffffff;
  --text-secondary: #94a3b8;
  --text-tertiary: #94a3b8;
  --text-muted: #64748b;
  --text-inverse: #0f172a;
  --text-accent: #fe2c55;

  /* Border System */
  --border-color: #2c4c54;
  --border-subtle: var(--border-color);
  --border-default: var(--border-color);
  --border-strong: var(--border-color);
  --border-accent: #fe2c55;
  --border-focus: #fe2c55;

  /* Shadow System */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07), 0 2px 4px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1), 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.1), 0 10px 10px rgba(0, 0, 0, 0.04);
  --shadow-accent: 0 10px 30px rgba(255, 107, 107, 0.1);

  /* Spacing System (8px base) */
  --space-0: 0;
  --space-1: 0.25rem; /* 4px */
  --space-2: 0.5rem; /* 8px */
  --space-3: 0.75rem; /* 12px */
  --space-4: 1rem; /* 16px */
  --space-5: 1.25rem; /* 20px */
  --space-6: 1.5rem; /* 24px */
  --space-8: 2rem; /* 32px */
  --space-10: 2.5rem; /* 40px */
  --space-12: 3rem; /* 48px */
  --space-16: 4rem; /* 64px */
  --space-20: 5rem; /* 80px */

  /* Border Radius System */
  --radius-none: 0;
  --radius-sm: 0.25rem;
  --radius-md: 0.375rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-2xl: 1rem;
  --radius-3xl: 1.5rem;
  --radius-full: 9999px;

  /* Fluid Typography System */
  --font-family-sans: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont,
    sans-serif;
  --font-family-mono: "Cascadia Code", "Fira Code", "SF Mono", Consolas,
    monospace;

  --font-size-xs: 0.75rem; /* 12px */
  --font-size-sm: 0.875rem; /* 14px */
  --font-size-base: 1rem; /* 16px */
  --font-size-lg: 1.125rem; /* 18px */
  --font-size-xl: 1.25rem; /* 20px */
  --font-size-2xl: 1.5rem; /* 24px */
  --font-size-3xl: 1.875rem; /* 30px */
  --font-size-4xl: 2.25rem; /* 36px */

  --font-weight-light: 300;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;

  --line-height-tight: 1.25;
  --line-height-normal: 1.5;
  --line-height-relaxed: 1.75;

  /* Enhanced Animation System */
  --duration-75: 75ms;
  --duration-100: 100ms;
  --duration-150: 150ms;
  --duration-200: 200ms;
  --duration-300: 300ms;
  --duration-500: 500ms;
  --duration-700: 700ms;
  --duration-1000: 1000ms;
  --duration-1200: 1200ms;
  --duration-1500: 1500ms;

  --ease-linear: linear;
  --ease-in: cubic-bezier(0.4, 0, 1, 1);
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-bounce: cubic-bezier(0.68, -0.55, 0.265, 1.55);
  --ease-elastic: cubic-bezier(0.175, 0.885, 0.32, 1.275);
  --ease-smooth: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --ease-dramatic: cubic-bezier(0.19, 1, 0.22, 1);

  /* Z-Index System */
  --z-dropdown: 1000;
  --z-sticky: 1020;
  --z-fixed: 1030;
  --z-modal-backdrop: 1040;
  --z-modal: 1050;
  --z-popover: 1060;
  --z-tooltip: 1070;

  /* Gradients */
  --gradient-primary: linear-gradient(
    135deg,
    var(--primary-blue),
    var(--secondary-purple)
  );
  --gradient-accent: linear-gradient(
    135deg,
    var(--accent-green),
    var(--accent-cyan)
  );
  --gradient-brand: linear-gradient(
    135deg,
    var(--primary-blue),
    var(--accent-yellow)
  );
}

/* Global Body Styles */
body {
  font-family: var(--font-family-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  animation: backgroundShift 20s ease-in-out infinite;
}

@keyframes backgroundShift {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

/* Header Container */
.header-container {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}

/* Keyword Ticker Styles */
.ticker-container {
  height: 50px;
  background: #ffffff;
  border-bottom: 1px solid rgba(254, 44, 85, 0.2);
  overflow: hidden;
  display: flex;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.ticker-content {
  display: flex;
  align-items: center;
  white-space: nowrap;
  animation: tickerScroll 60s linear infinite;
  gap: 0;
}

.ticker-item {
  display: flex;
  align-items: center;
  margin-right: 2rem;
  flex-shrink: 0;
}

.ticker-keyword {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-full);
  background: linear-gradient(
    135deg,
    rgba(254, 44, 85, 0.1),
    rgba(37, 244, 238, 0.1)
  );
  border: 1px solid rgba(254, 44, 85, 0.3);
  color: #000000;
  text-decoration: none;
  transition: all var(--duration-300) var(--ease-smooth);
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ticker-keyword:hover {
  transform: translateY(-2px) scale(1.05);
  background: linear-gradient(
    135deg,
    rgba(254, 44, 85, 0.2),
    rgba(37, 244, 238, 0.2)
  );
  border-color: rgba(254, 44, 85, 0.6);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  color: #000000;
}

.ticker-separator {
  color: rgba(254, 44, 85, 0.8);
  font-size: var(--font-size-lg);
  margin-left: 1rem;
  font-weight: bold;
  animation: separatorPulse 2s ease-in-out infinite;
}

@keyframes tickerScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@keyframes separatorPulse {
  0%,
  100% {
    opacity: 0.6;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1.2);
  }
}

/* Navigation Styles */
.nav {
  position: relative;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1;
  background: rgba(23, 29, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(254, 44, 85, 0.2);
  padding: 1rem 0;
  transition: all var(--duration-300) var(--ease-smooth);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  animation: navSlideDown 0.8s var(--ease-out);
}

@keyframes navSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
  height: 50px;
  overflow: hidden;
}

.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  justify-content: center;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logo-img {
  height: 100%;
  width: auto;
  object-fit: contain;
  flex-shrink: 0;
}

.logo-text {
  text-decoration: none;
  background: linear-gradient(to right, #fe2c55, #25f4ee);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Navigation Actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* Credit Display Styles */
.credit-display {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-2xl);
  font-weight: 600;
  font-size: var(--font-size-sm);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  transition: all 0.2s ease;
  margin-right: var(--space-3);
  position: relative;
  overflow: hidden;
}

.credit-display:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

.credit-icon {
  color: #fbbf24;
  font-size: var(--font-size-base);
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.5);
}

.credit-amount {
  font-family: var(--font-family-mono);
  font-weight: 700;
  color: #fbbf24;
  text-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}

.credit-separator {
  width: 1px;
  height: 16px;
  background: rgba(255, 255, 255, 0.3);
  margin: 0 var(--space-1);
}

.credit-tier {
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  padding: 2px 8px;
  margin-left: var(--space-1);
}

.tier-label {
  color: #374151;
  font-size: var(--font-size-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Profile Button Styles */
.profile-container {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 40px;
  min-height: 40px;
}

.profile-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.2);
  background: linear-gradient(135deg, #FE2C55, #25F4EE);
  color: white;
  cursor: pointer;
  transition: all var(--duration-300) var(--ease-smooth);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  z-index: 1000;
  flex-shrink: 0;
}

.profile-btn:hover {
  transform: scale(1.05);
  border-color: rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 12px rgba(254, 44, 85, 0.3);
}

.profile-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-base);
}

/* Sidebar Styles */
.sidebar {
  width: 280px;
  background: rgba(23, 29, 42, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: var(--space-6);
  height: calc(
    100vh - var(--space-20) - var(--space-4) - 40px
  );
  max-height: calc(100vh - var(--space-20) - var(--space-4) - 40px);
  overflow-y: auto;
  position: fixed;
  left: 0;
  top: calc(
    var(--space-20) + var(--space-4) + 40px
  );
  z-index: 10;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  transition: all var(--duration-300) var(--ease-smooth);
  animation: sidebarSlideIn 0.8s var(--ease-out) 0.5s both;
}

/* Custom scrollbar for sidebar */
.sidebar::-webkit-scrollbar {
  width: 6px;
}

.sidebar::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(254, 44, 85, 0.6);
  border-radius: 3px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
  background: rgba(254, 44, 85, 0.8);
}

.sidebar:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.2);
}

@keyframes sidebarSlideIn {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.nav-section {
  margin-bottom: var(--space-8);
}

.nav-title {
  color: var(--text-secondary);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-4);
  padding: 0 var(--space-4);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: 12px;
  cursor: pointer;
  font-size: small;
  font-weight: 400;
  color: var(--text-primary);
  transition: all var(--duration-300) var(--ease-smooth);
  margin-bottom: var(--space-2);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  transform: translateX(4px);
  border-color: rgba(255, 255, 255, 0.2);
}

.nav-item.active {
  background: rgba(255, 255, 255, 0.15);
  color: var(--text-primary);
  font-weight: 400;
  border: 1px solid transparent;
  transform: translateX(4px);
  font-size: small;
  position: relative;
}

.nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 12px;
  padding: 1px;
  background: linear-gradient(to right, #fe2c55, #25f4ee);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  z-index: -1;
}

.nav-item i {
  transition: all var(--duration-300) var(--ease-smooth);
  color: var(--text-primary);
}

.nav-item:hover i {
  color: var(--text-primary);
}

/* Main Container */
.main-container {
  display: block;
  max-width: 1400px;
  margin: 0 auto;
  margin-left: calc(
    280px + var(--space-8)
  );
  padding: var(--space-8);
  margin-top: calc(
    var(--space-20) + var(--space-4) + 40px
  );
  animation: mainFadeIn 1s var(--ease-out) 0.3s both;
}

@keyframes mainFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Dashboard Cards */
.dashboard-card {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.02) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 24px;
  padding: var(--space-6);
  border: 1px solid rgba(204, 29, 77, 0.2);
  transition: all var(--duration-400) var(--ease-smooth);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  container-type: inline-size;
  position: relative;
  overflow: hidden;
  animation: cardFadeIn 0.8s var(--ease-out) both;
  height: fit-content;
}

.dashboard-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(204, 29, 77, 0.5),
    transparent
  );
  opacity: 0;
  transition: opacity var(--duration-300) var(--ease-out);
}

.dashboard-card:hover::before {
  opacity: 1;
}

.dashboard-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 60px rgba(204, 29, 77, 0.2);
  border-color: rgba(204, 29, 77, 0.4);
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.08) 0%,
    rgba(255, 255, 255, 0.04) 100%
  );
}

@keyframes cardFadeIn {
  from {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-title {
  color: white;
  font-size: 1.25rem;
  font-weight: 700;
  line-height: var(--line-height-tight);
  background: linear-gradient(135deg, #ffffff 0%, #f0f0f0 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  transition: all var(--duration-300) var(--ease-smooth);
  margin-bottom: 1rem;
}

.dashboard-card:hover .card-title {
  background: linear-gradient(135deg, #cc1d4d 0%, #ff6b9d 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--duration-200) var(--ease-out);
  min-height: 44px;
}

.btn-primary {
  background: linear-gradient(
    to right,
    rgba(0, 114, 255, 1),
    rgba(142, 45, 226, 1)
  );
  color: var(--text-primary);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--bg-surface-hover);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-surface-pressed);
  color: var(--text-primary);
  border-color: var(--border-default);
}

/* Responsive Design */
@media (max-width: 768px) {
  .sidebar {
    display: none;
  }

  .main-container {
    margin-left: 0;
    margin-top: calc(
      var(--space-20) + var(--space-4) + 120px
    );
  }
}

@media (max-width: 1024px) {
  .main-container {
    margin-left: 0;
  }
}

/* Accessibility Improvements */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

@media (prefers-contrast: high) {
  :root {
    --border-subtle: #64748b;
    --border-default: #94a3b8;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.2);
  }
}
