/**
 * SmartTrader Home Page Styles
 * Feature navigation dashboard with dark theme and animations
 */

/* Variables - matching sessions.css */
:root {
  --color-bg-primary: #0a0e1a;
  --color-bg-secondary: #111827;
  --color-bg-card: rgba(17, 24, 39, 0.8);
  --color-bg-card-hover: rgba(31, 41, 55, 0.9);
  --color-accent-primary: #06b6d4;
  --color-accent-secondary: #8b5cf6;
  --color-accent-gradient-start: #06b6d4;
  --color-accent-gradient-end: #8b5cf6;
  --color-text-primary: #f9fafb;
  --color-text-secondary: #9ca3af;
  --color-text-muted: #6b7280;
  --color-border: rgba(75, 85, 99, 0.4);
  --color-border-hover: rgba(6, 182, 212, 0.4);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(6, 182, 212, 0.3);

  --transition-fast: 150ms ease;
  --transition-normal: 250ms ease;
  --transition-slow: 350ms ease;
}

/* Layout */
.home-container {
  min-height: 100vh;
  background-color: var(--color-bg-primary);
  color: var(--color-text-primary);
  position: relative;
  overflow-x: hidden;
}

/* Animated Background */
.home-background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.home-background__gradient {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 15% 10%, rgba(6, 182, 212, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 85% 90%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 50% 50%, rgba(6, 182, 212, 0.03) 0%, transparent 60%);
}

.home-background__grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    linear-gradient(rgba(6, 182, 212, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(6, 182, 212, 0.02) 1px, transparent 1px);
  background-size: 60px 60px;
  opacity: 0.5;
}

/* Header */
.home-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: rgba(10, 14, 26, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-border);
}

.home-header__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.home-logo {
  width: 40px;
  height: 40px;
}

.home-logo svg {
  width: 100%;
  height: 100%;
}

.home-logo svg path {
  stroke: var(--color-accent-primary);
}

.home-header__title {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.home-header__right {
  display: flex;
  align-items: center;
}

/* User Profile */
.user-profile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.5rem 1rem;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  transition: all var(--transition-normal);
}

.user-profile:hover {
  border-color: var(--color-border-hover);
  box-shadow: var(--shadow-glow);
}

.user-profile__avatar {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--color-accent-gradient-start), var(--color-accent-gradient-end));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.875rem;
}

.user-profile__name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-text-primary);
}

.logout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition-fast);
  padding: 0;
}

.logout-btn:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.logout-btn svg {
  width: 16px;
  height: 16px;
}

/* Welcome Section */
.welcome-section {
  padding: 4rem 2rem 2rem;
  text-align: center;
  max-width: 1200px;
  margin: 0 auto;
}

.welcome-section__content {
  animation: fadeInUp 0.6s ease-out;
}

.welcome-section__title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(135deg, var(--color-text-primary) 0%, var(--color-accent-primary) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.welcome-section__subtitle {
  font-size: 1.125rem;
  color: var(--color-text-secondary);
  margin-bottom: 2rem;
}

.welcome-section__stats {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.stat-card {
  padding: 1rem 2rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.stat-card__value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-accent-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card__label {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* Modules Section */
.modules-section {
  padding: 3rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.modules-section--priority-low {
  padding-top: 0;
}

.modules-section__header {
  text-align: center;
  margin-bottom: 3rem;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.modules-section__title {
  font-size: 1.75rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--color-text-primary);
}

.modules-section__subtitle {
  color: var(--color-text-muted);
  font-size: 0.875rem;
}

/* Modules Grid */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.5rem;
}

.modules-grid--compact {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

/* Module Card */
.module-card {
  position: relative;
  padding: 1.75rem;
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: 20px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all var(--transition-normal);
  overflow: hidden;
  animation: fadeInUp 0.6s ease-out both;
}

.module-card:nth-child(1) { animation-delay: 0.1s; }
.module-card:nth-child(2) { animation-delay: 0.15s; }
.module-card:nth-child(3) { animation-delay: 0.2s; }
.module-card:nth-child(4) { animation-delay: 0.25s; }
.module-card:nth-child(5) { animation-delay: 0.3s; }
.module-card:nth-child(6) { animation-delay: 0.35s; }
.module-card:nth-child(7) { animation-delay: 0.4s; }
.module-card:nth-child(8) { animation-delay: 0.45s; }
.module-card:nth-child(9) { animation-delay: 0.5s; }

.module-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(6, 182, 212, 0.3),
    transparent
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-border-hover);
  box-shadow:
    var(--shadow-lg),
    0 0 30px rgba(6, 182, 212, 0.1);
}

.module-card:hover::before {
  opacity: 1;
}

.module-card.highlight {
  border-color: rgba(6, 182, 212, 0.5);
  background: linear-gradient(135deg,
    rgba(6, 182, 212, 0.08) 0%,
    rgba(17, 24, 39, 0.8) 100%
  );
}

.module-card.highlight:hover {
  border-color: rgba(6, 182, 212, 0.7);
  box-shadow:
    var(--shadow-lg),
    0 0 40px rgba(6, 182, 212, 0.2);
}

.module-card.compact {
  padding: 1.25rem;
}

/* Module Card Header */
.module-card__header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.module-card__icon {
  width: 48px;
  height: 48px;
  padding: 0.75rem;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.1), rgba(139, 92, 246, 0.1));
  border: 1px solid rgba(6, 182, 212, 0.2);
  border-radius: 12px;
  color: var(--color-accent-primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.module-card__icon svg {
  width: 24px;
  height: 24px;
}

.module-card.highlight .module-card__icon {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
}

.module-card.compact .module-card__icon {
  width: 40px;
  height: 40px;
  padding: 0.5rem;
}

.module-card__icon.highlight-shine {
  position: relative;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(139, 92, 246, 0.25));
  animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.3);
  }
  50% {
    box-shadow: 0 0 20px rgba(6, 182, 212, 0.6);
  }
}

.module-card__number {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-text-muted);
  padding: 0.25rem 0.625rem;
  background: rgba(75, 85, 99, 0.2);
  border-radius: 6px;
}

.module-card__number.featured {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
  color: var(--color-accent-primary);
}

/* Badge */
.badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  font-size: 0.625rem;
  font-weight: 600;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-featured {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: white;
}

/* Module Card Title */
.module-card__title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-text-primary);
  margin-bottom: 0.25rem;
}

.module-card.compact .module-card__title {
  font-size: 1rem;
  font-weight: 500;
}

.module-card__subtitle {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  margin-bottom: 0.75rem;
}

/* Tech Badges */
.module-card__tech {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.tech-badge {
  font-size: 0.6875rem;
  font-weight: 500;
  padding: 0.25rem 0.5rem;
  background: rgba(6, 182, 212, 0.1);
  color: var(--color-accent-primary);
  border-radius: 4px;
}

.module-card.highlight .tech-badge {
  background: rgba(6, 182, 212, 0.15);
}

/* Complexity */
.module-card__complexity {
  display: flex;
  gap: 3px;
  height: 4px;
  margin-bottom: 1rem;
}

.complexity-1::after { content: •••••; color: rgba(255,255,255,0.1); }
.complexity-1::before { content: •; color: var(--color-accent-secondary); }

.complexity-2::after { content: ••••; color: rgba(255,255,255,0.1); }
.complexity-2::before { content: ••; color: var(--color-accent-secondary); }

.complexity-3::after { content: •••; color: rgba(255,255,255,0.1); }
.complexity-3::before { content: •••; color: var(--color-accent-secondary); }

.complexity-4::after { content: ••; color: rgba(255,255,255,0.1); }
.complexity-4::before { content: ••••; color: var(--color-accent-secondary); }

.complexity-5::before { content: •••••; color: var(--color-accent-secondary); }

.module-card.highlight .complexity-5::before {
  background: linear-gradient(90deg, var(--color-accent-primary), var(--color-accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Description */
.module-card__description {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

.module-card.compact .module-card__description {
  display: none;
}

/* Features */
.module-card__features {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.feature-tag {
  font-size: 0.6875rem;
  padding: 0.1875rem 0.5rem;
  background: rgba(75, 85, 99, 0.2);
  color: var(--color-text-muted);
  border-radius: 4px;
}

/* Action Button */
.module-card__action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(17, 24, 39, 0.5);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  color: var(--color-text-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  cursor: not-allowed;
  transition: all var(--transition-fast);
  text-decoration: none;
}

.module-card__action--active {
  cursor: pointer;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(139, 92, 246, 0.15));
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--color-accent-primary);
}

.module-card__action--active:hover {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.25), rgba(139, 92, 246, 0.25));
  border-color: rgba(6, 182, 212, 0.5);
  transform: translateY(-1px);
}

.module-card__action--active:hover svg {
  transform: translateX(4px);
}

.module-card__action svg {
  width: 14px;
  height: 14px;
  transition: transform var(--transition-fast);
}

.module-card__action.highlighted {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.2), rgba(139, 92, 246, 0.2));
  border-color: rgba(6, 182, 212, 0.3);
  color: var(--color-accent-primary);
}

.module-card.compact .module-card__action {
  display: none;
}

/* Footer */
.home-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
}

.home-footer__text {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
}

.home-footer__links {
  display: flex;
  gap: 1.5rem;
}

.home-footer__link {
  font-size: 0.8125rem;
  color: var(--color-text-secondary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.home-footer__link:hover {
  color: var(--color-accent-primary);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% center;
  }
  100% {
    background-position: 200% center;
  }
}

/* Responsive */
@media (max-width: 768px) {
  .home-header {
    padding: 1rem;
  }

  .home-header__title {
    font-size: 1.25rem;
  }

  .user-profile__name {
    display: none;
  }

  .welcome-section__title {
    font-size: 1.75rem;
  }

  .welcome-section__stats {
    gap: 1rem;
  }

  .modules-grid {
    grid-template-columns: 1fr;
  }

  .home-footer {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }
}

/* Focus states for accessibility */
.module-card__action:focus,
.home-footer__link:focus,
.logout-btn:focus {
  outline: 2px solid var(--color-accent-primary);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
