/**
 * Commerce Learning Hub - Theme Definitions
 * 
 * Contains: Theme-specific overrides, animations, special effects
 */

/* ============================================
   THEME TOGGLE BUTTON
   ============================================ */
.theme-toggle {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-md);
  background: var(--color-surface-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
  border: 1px solid var(--color-border);
}

.theme-toggle:hover {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.theme-toggle__icon {
  font-size: var(--text-lg);
  transition: transform var(--transition-base);
}

[data-theme="dark"] .theme-toggle__icon {
  transform: rotate(180deg);
}

/* ============================================
   GRADIENT BACKGROUNDS
   ============================================ */
.gradient-primary {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
}

.gradient-accent {
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
}

.gradient-mesh {
  background: 
    radial-gradient(at 0% 0%, rgba(37, 99, 235, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 0%, rgba(124, 58, 237, 0.15) 0px, transparent 50%),
    radial-gradient(at 100% 100%, rgba(6, 182, 212, 0.15) 0px, transparent 50%),
    radial-gradient(at 0% 100%, rgba(37, 99, 235, 0.15) 0px, transparent 50%);
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

@keyframes shimmer {
  0% { background-position: -1000px 0; }
  100% { background-position: 1000px 0; }
}

.animate-fade-in { animation: fadeIn 0.3s ease; }
.animate-fade-in-up { animation: fadeInUp 0.4s ease; }
.animate-fade-in-down { animation: fadeInDown 0.4s ease; }
.animate-scale-in { animation: scaleIn 0.3s ease; }
.animate-pulse { animation: pulse 2s ease-in-out infinite; }

/* ============================================
   SKELETON LOADING
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--color-surface-elevated) 0%,
    var(--color-border) 50%,
    var(--color-surface-elevated) 100%
  );
  background-size: 1000px 100%;
  animation: shimmer 2s infinite;
  border-radius: var(--radius-md);
}

.skeleton--text {
  height: 1rem;
  margin-bottom: var(--space-2);
}

.skeleton--title {
  height: 1.5rem;
  width: 60%;
  margin-bottom: var(--space-4);
}

.skeleton--card {
  height: 200px;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */
.hover-lift {
  transition: transform var(--transition-base), box-shadow var(--transition-base);
}

.hover-lift:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.hover-scale {
  transition: transform var(--transition-base);
}

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

.hover-glow {
  transition: box-shadow var(--transition-base);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(37, 99, 235, 0.3);
}

/* ============================================
   SPECIAL COMPONENTS
   ============================================ */

/* Glass panel */
.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur));
  -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
}

/* Stat card */
.stat-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
}

.stat-card:hover {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

.stat-card__label {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}

.stat-card__value {
  font-size: var(--text-3xl);
  font-weight: var(--font-bold);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}

.stat-card__change {
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-1);
}

.stat-card__change--up {
  color: var(--color-success);
}

.stat-card__change--down {
  color: var(--color-error);
}

/* Module card */
.module-card {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  transition: all var(--transition-base);
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.module-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.module-card__icon {
  width: 3rem;
  height: 3rem;
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-2xl);
}

.module-card__title {
  font-size: var(--text-lg);
  font-weight: var(--font-semibold);
  color: var(--color-text);
}

.module-card__description {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  flex: 1;
}

.module-card__meta {
  display: flex;
  gap: var(--space-2);
  margin-top: var(--space-2);
}

/* ============================================
   PHASE 2 ANIMATIONS (added)
   ============================================ */
@keyframes slideInRight {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInLeft {
  from { transform: translateX(-20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

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

.animate-slide-in-right { animation: slideInRight 0.4s ease; }
.animate-slide-in-left { animation: slideInLeft 0.4s ease; }
.animate-bounce-in { animation: bounceIn 0.6s ease; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Staggered entrance for grid items */
.stagger-in > * {
  opacity: 0;
  animation: fadeInUp 0.5s ease forwards;
}

.stagger-in > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-in > *:nth-child(2) { animation-delay: 0.10s; }
.stagger-in > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-in > *:nth-child(4) { animation-delay: 0.20s; }
.stagger-in > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-in > *:nth-child(6) { animation-delay: 0.30s; }
.stagger-in > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-in > *:nth-child(8) { animation-delay: 0.40s; }

/* Focus ring enhancement */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* Smooth theme transition */
body.theme-transitioning,
body.theme-transitioning * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease !important;
}

/* ============================================
   THEME SWITCHER (Phase 3)
   ============================================ */
.theme-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface-elevated);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px;
  gap: 2px;
}

.theme-switcher__option {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: transparent;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: all var(--transition-fast);
}

.theme-switcher__option:hover {
  color: var(--color-text);
  background: var(--color-surface);
}

.theme-switcher__option--active {
  background: var(--color-primary);
  color: var(--color-text-inverse);
}

.theme-switcher__option:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

