/* CSS Custom Properties for Theme Management */
:root {
  /* Light Theme Colors */
  --primary-red: #dc2626;
  --secondary-red: #ef4444;
  --dark-red: #991b1b;
  --light-red: #fecaca;

  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-tertiary: #f1f5f9;
  --bg-card: #ffffff;

  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --text-muted: #9ca3af;

  --border-color: #e5e7eb;
  --shadow-color: rgba(0, 0, 0, 0.1);

  /* Portal Colors */
  --discord-bg: #5865f2;
  --steam-bg: #1b2838;
  --n8n-bg: #ff6b35;
  --it-bg: #059669;
  --forum-bg: #7c3aed;
  --bridge-bg: #0891b2;

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

/* Dark Theme */
[data-theme="dark"] {
  --bg-primary: #0f172a;
  --bg-secondary: #1e293b;
  --bg-tertiary: #334155;
  --bg-card: #1e293b;

  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --border-color: #334155;
  --shadow-color: rgba(0, 0, 0, 0.3);
}

/* Scroll Progress Bar */
#scrollProgress {
  position: fixed;
  top: 0;
  left: 0;
  width: 0%;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-red), var(--secondary-red));
  z-index: 1001;
  transition: width 0.1s ease;
}

/* Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background-color var(--transition-normal),
    color var(--transition-normal);
  overflow-x: hidden;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 1000;
  box-shadow: 0 4px 12px var(--shadow-color);
  transition: all var(--transition-normal);
  overflow: hidden;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  outline: none;
  padding: 0;
  font: inherit;
}

.theme-toggle:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px var(--shadow-color);
}

.theme-toggle i {
  font-size: 20px;
  transition: all var(--transition-normal);
  position: absolute;
}

.theme-toggle .fa-sun {
  color: var(--primary-red);
  opacity: 1;
  transform: rotate(0deg);
}

.theme-toggle .fa-moon {
  color: var(--text-muted);
  opacity: 0;
  transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle .fa-sun {
  opacity: 0;
  transform: rotate(180deg);
}

[data-theme="dark"] .theme-toggle .fa-moon {
  opacity: 1;
  transform: rotate(0deg);
  color: var(--secondary-red);
}

/* Header */
.header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  transition: all var(--transition-normal);
  transform: translateY(0);
}

.header.hidden {
  transform: translateY(-100%);
}

.header .container {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 8px;
}

.logo-text {
  font-size: 1.8rem;
  font-weight: bold;
  color: var(--primary-red);
  letter-spacing: 2px;
}

/* User Footprint in Hero */
.hero .footprint-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  max-width: 600px;
  margin: 0 auto 2rem;
  position: relative;
  z-index: 4;
}

.footprint-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-card);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.footprint-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--shadow-color);
  border-color: var(--primary-red);
}

.footprint-item i {
  font-size: 1.5rem;
  color: var(--primary-red);
  min-width: 24px;
  text-align: center;
}

.footprint-item span {
  font-size: 0.9rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.footprint-item span:first-of-type {
  color: var(--text-primary);
  font-weight: 600;
}

/* Hero Section */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  background: linear-gradient(
    135deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 100%
  );
  position: relative;
  overflow: hidden;
}

@keyframes networkPulse {
  0%,
  100% {
    opacity: 0.8;
  }
  50% {
    opacity: 1;
  }
}

.network-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
  z-index: 2;
  pointer-events: none;
  transition: opacity var(--transition-normal);
  background: rgba(220, 38, 38, 0.02);
}

[data-theme="dark"] .network-background {
  opacity: 0.8;
}

[data-theme="dark"] #scrollProgress {
  background: linear-gradient(90deg, #ffffff, #e5e7eb);
}

.hero-content {
  text-align: center;
  z-index: 3;
  position: relative;
  max-width: 800px;
  margin: 0 auto;
  padding-top: 2rem;
}

.hero-title {
  font-size: clamp(1.5rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-shadow: 2px 2px 4px var(--shadow-color);
  letter-spacing: 1px;
  line-height: 1.2;
  text-align: center;
}
.hero-subtitle {
  font-size: clamp(1.2rem, 2.5vw, 1.8rem);
  color: var(--primary-red);
  margin-bottom: 2rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 3px;
}

.hero-description {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 3rem;
  line-height: 1.8;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* Portal Section */
.portal {
  padding: 5rem 0;
  background: var(--bg-secondary);
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 1rem;
  color: var(--text-primary);
  font-weight: 700;
}

.section-subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 1.2rem;
  margin-bottom: 3rem;
}

.portal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}

.portal-card {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 2rem;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
}

.portal-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    transparent 0%,
    rgba(220, 38, 38, 0.05) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.portal-card:hover::before {
  opacity: 1;
}

.portal-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 40px var(--shadow-color);
  border-color: var(--primary-red);
}

.portal-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: white;
  position: relative;
  transition: all var(--transition-normal);
}

.portal-icon::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: linear-gradient(
    45deg,
    var(--primary-red),
    var(--secondary-red),
    var(--primary-red)
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
  z-index: -1;
}

.portal-card:hover .portal-icon::after {
  opacity: 1;
}

.portal-card:hover .portal-icon {
  transform: scale(1.1);
}

.portal-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 600;
}

.portal-card p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.portal-arrow {
  opacity: 0;
  transform: translateX(-10px);
  transition: all var(--transition-normal);
  color: var(--primary-red);
  font-size: 1.2rem;
}

.portal-card:hover .portal-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Specific Portal Colors */
.discord {
  background: var(--discord-bg);
}
.steam {
  background: var(--steam-bg);
}
.n8n {
  background: var(--n8n-bg);
}
.it {
  background: var(--it-bg);
}
.forum {
  background: var(--forum-bg);
}
.bridge {
  background: var(--bridge-bg);
}

/* About Section */
.about {
  padding: 5rem 0;
  background: linear-gradient(
    135deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 100%
  );
  position: relative;
  overflow: hidden;
}

.about::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(
      circle at 20% 30%,
      rgba(220, 38, 38, 0.1) 0%,
      transparent 50%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(220, 38, 38, 0.05) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.about-header {
  text-align: center;
  margin-bottom: 4rem;
  position: relative;
  z-index: 2;
}

.about-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  position: relative;
}

.about-title::after {
  content: "";
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-red), var(--secondary-red));
  border-radius: 2px;
}

.about-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  margin-top: 2rem;
}

.divider-line {
  width: 100px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    var(--primary-red),
    transparent
  );
}

.divider-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.5rem;
  box-shadow: 0 4px 20px rgba(220, 38, 38, 0.3);
  animation: rotate 10s linear infinite;
}

@keyframes rotate {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.about-content {
  position: relative;
  z-index: 2;
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.about-card {
  background: var(--bg-card);
  border-radius: 20px;
  padding: 2.5rem;
  text-align: center;
  border: 1px solid var(--border-color);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
}

.about-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    135deg,
    rgba(220, 38, 38, 0.05) 0%,
    rgba(239, 68, 68, 0.1) 50%,
    transparent 100%
  );
  opacity: 0;
  transition: opacity var(--transition-normal);
}

.about-card:hover::before {
  opacity: 1;
}

.about-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 20px 40px var(--shadow-color);
  border-color: var(--primary-red);
}

.card-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  font-size: 2rem;
  color: white;
  position: relative;
  transition: all var(--transition-normal);
}

.about-card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
  box-shadow: 0 8px 25px rgba(220, 38, 38, 0.4);
}

.about-card h3 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.about-card p {
  color: var(--text-secondary);
  line-height: 1.8;
  font-size: 1rem;
}

.about-showcase {
  background: linear-gradient(135deg, var(--bg-card), var(--bg-tertiary));
  border-radius: 25px;
  padding: 3rem;
  border: 1px solid var(--border-color);
  box-shadow: 0 10px 30px var(--shadow-color);
}

.showcase-stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
  position: relative;
}

.stat-number {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  color: var(--primary-red);
  line-height: 1;
  margin-bottom: 0.5rem;
  text-shadow: 2px 2px 4px var(--shadow-color);
}

.stat-label {
  font-size: 1rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
}

/* Footer */
.footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-color);
  padding: 1rem 0;
}

.footer-bottom {
  text-align: center;
  color: var(--text-muted);
}

/* Responsive Design */
@media (max-width: 768px) {
  .hero .footprint-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }

  .footprint-item {
    padding: 0.75rem 1rem;
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .footprint-item i {
    font-size: 1.2rem;
  }

  .footprint-item span {
    font-size: 0.8rem;
  }

  .portal-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .about-card {
    padding: 2rem;
  }

  .showcase-stats {
    gap: 2rem;
  }

  .about-divider {
    gap: 1rem;
  }

  .divider-line {
    width: 50px;
  }

  .theme-toggle {
    width: 50px;
    height: 50px;
    bottom: 15px;
    right: 15px;
  }

  .theme-toggle i {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .hero .footprint-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
  }

  .footprint-item {
    padding: 0.5rem 0.75rem;
  }

  .container {
    padding: 0 15px;
  }

  .hero {
    padding: 2rem 0;
  }

  .hero-title {
    font-size: 2rem;
    line-height: 1.3;
    padding: 0 1rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .portal {
    padding: 3rem 0;
  }

  .portal-card {
    padding: 1.5rem;
  }

  .about-showcase {
    padding: 2rem;
  }

  .showcase-stats {
    gap: 1.5rem;
  }

  .about-title {
    font-size: 2rem;
  }

  .divider-icon {
    width: 50px;
    height: 50px;
    font-size: 1.2rem;
  }
}
