/* Homelab Page Styles */
/* Extends the main site theme: #0a0a0a bg, #0ff primary, #ff4081 secondary */

/* ========== Hero Section ========== */
.homelab-hero {
  position: relative;
  padding: 100px 20px 80px;
  text-align: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(0, 255, 255, 0.08) 0%, transparent 60%),
              linear-gradient(180deg, #0a0a0a 0%, #111 100%);
  overflow: hidden;
}

.homelab-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 50px, rgba(0, 255, 255, 0.02) 50px, rgba(0, 255, 255, 0.02) 51px),
    repeating-linear-gradient(90deg, transparent, transparent 50px, rgba(0, 255, 255, 0.02) 50px, rgba(0, 255, 255, 0.02) 51px);
  pointer-events: none;
}

.homelab-hero h1 {
  font-family: 'Orbitron', sans-serif;
  font-size: 3rem;
  color: #0ff;
  text-shadow: 0 0 30px rgba(0, 255, 255, 0.5);
  margin-bottom: 15px;
  position: relative;
}

.homelab-hero .hero-subtitle {
  font-size: 1.3rem;
  color: #e0e0e0;
  opacity: 0.8;
  max-width: 700px;
  margin: 0 auto 30px;
}

.hero-stats-row {
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: wrap;
  margin-top: 40px;
}

.hero-stat {
  text-align: center;
}

.hero-stat .stat-value {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #0ff;
  text-shadow: 0 0 15px rgba(0, 255, 255, 0.4);
  display: block;
  line-height: 1;
}

.hero-stat .stat-label {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-top: 5px;
}

/* ========== Section Navigation (In-Page) ========== */
.homelab-subnav {
  background: rgba(15, 15, 15, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0, 255, 255, 0.15);
  padding: 10px 0;
  position: sticky;
  top: 50px;
  z-index: 999;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.homelab-subnav::-webkit-scrollbar {
  height: 3px;
}

.homelab-subnav::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 255, 0.3);
  border-radius: 2px;
}

.subnav-links {
  display: flex;
  justify-content: center;
  gap: 5px;
  list-style: none;
  margin: 0;
  padding: 0;
  white-space: nowrap;
}

.subnav-links a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.subnav-links a:hover,
.subnav-links a.active {
  color: #0ff;
  border-color: rgba(0, 255, 255, 0.3);
  background: rgba(0, 255, 255, 0.05);
}

/* ========== Homelab Sections ========== */
.homelab-section {
  padding: 80px 20px;
  background: linear-gradient(135deg, #1f1f1f, #2c2c2c);
  border-top: 4px solid #ff4081;
  margin-bottom: 20px;
  scroll-margin-top: 110px;
}

.homelab-section:nth-child(even) {
  background: linear-gradient(135deg, #181818, #222);
}

.homelab-section h2 {
  font-family: 'Orbitron', sans-serif;
  color: #ff4081;
  margin-bottom: 10px;
  text-shadow: 0 0 10px rgba(255, 64, 129, 0.3);
  font-size: 2rem;
}

.homelab-section h2::after {
  content: '';
  display: block;
  width: 80px;
  height: 3px;
  background: #0ff;
  margin-top: 10px;
}

.homelab-section.text-center h2::after {
  margin-left: auto;
  margin-right: auto;
}

.section-lead {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  margin-bottom: 40px;
  max-width: 800px;
}

.homelab-section.text-center .section-lead {
  margin-left: auto;
  margin-right: auto;
}

/* ========== Infrastructure Cards ========== */
.infra-card {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 30px;
  height: 100%;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.infra-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #0ff, #ff4081);
  opacity: 0;
  transition: opacity 0.3s;
}

.infra-card:hover {
  border-color: rgba(0, 255, 255, 0.2);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}

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

.infra-card .card-icon {
  font-size: 2.5rem;
  color: #0ff;
  margin-bottom: 15px;
  display: block;
}

.infra-card h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.1rem;
  color: #fff;
  margin-bottom: 12px;
}

.infra-card p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
  line-height: 1.6;
}

.infra-card .spec-list {
  list-style: none;
  padding: 0;
  margin: 15px 0 0;
}

.infra-card .spec-list li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.infra-card .spec-list li:last-child {
  border-bottom: none;
}

.infra-card .spec-list li i {
  color: #0ff;
  font-size: 0.75rem;
  flex-shrink: 0;
}

/* ========== VLAN Visualization ========== */
.vlan-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

.vlan-card {
  background: rgba(15, 15, 15, 0.9);
  border-radius: 10px;
  padding: 24px;
  border-left: 4px solid var(--vlan-color, #0ff);
  transition: all 0.3s ease;
  position: relative;
}

.vlan-card:hover {
  transform: translateX(4px);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.3);
}

.vlan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.vlan-name {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  color: #fff;
}

.vlan-id {
  font-family: 'Orbitron', sans-serif;
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--vlan-color, #0ff);
  border: 1px solid var(--vlan-color, #0ff);
}

.vlan-cidr {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.5);
  margin-bottom: 10px;
}

.vlan-description {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 12px;
  line-height: 1.5;
}

.vlan-security {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vlan-security .badge {
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.7);
  font-weight: 400;
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ========== Service Cards ========== */
.service-category {
  margin-bottom: 50px;
}

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 25px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.category-header i {
  font-size: 1.5rem;
  color: var(--cat-color, #0ff);
}

.category-header h3 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1.2rem;
  color: #fff;
  margin: 0;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.service-card {
  background: rgba(20, 20, 20, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  transition: all 0.3s;
}

.service-card:hover {
  border-color: rgba(0, 255, 255, 0.2);
  background: rgba(25, 25, 25, 0.9);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.service-card .service-icon {
  font-size: 1.5rem;
  color: var(--cat-color, #0ff);
  flex-shrink: 0;
  margin-top: 2px;
}

.service-card .service-info h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 4px;
  font-weight: 500;
}

.service-card .service-info p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin: 0;
  line-height: 1.4;
}

/* ========== Stats Section ========== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 30px;
  text-align: center;
}

.stat-block {
  padding: 30px 20px;
  background: rgba(15, 15, 15, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  transition: all 0.3s;
}

.stat-block:hover {
  border-color: rgba(0, 255, 255, 0.2);
  transform: translateY(-3px);
}

.stat-block .stat-number {
  font-family: 'Orbitron', sans-serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: #0ff;
  text-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-block .stat-label {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-block .stat-detail {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.4);
  margin-top: 5px;
}

/* ========== Maker Space ========== */
.maker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.maker-card {
  background: rgba(20, 20, 20, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
  transition: all 0.3s;
}

.maker-card:hover {
  border-color: rgba(255, 64, 129, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.maker-card .maker-icon {
  font-size: 2.5rem;
  color: #ff4081;
  margin-bottom: 15px;
}

.maker-card h4 {
  font-family: 'Orbitron', sans-serif;
  font-size: 1rem;
  color: #fff;
  margin-bottom: 6px;
}

.maker-card .maker-model {
  color: #0ff;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.maker-card p {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.85rem;
  margin: 0;
}

/* ========== Architecture Diagram (CSS-drawn) ========== */
.arch-diagram {
  background: rgba(10, 10, 10, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 40px;
  position: relative;
  overflow: hidden;
}

.arch-diagram::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background:
    repeating-linear-gradient(0deg, transparent, transparent 30px, rgba(0, 255, 255, 0.015) 30px, rgba(0, 255, 255, 0.015) 31px),
    repeating-linear-gradient(90deg, transparent, transparent 30px, rgba(0, 255, 255, 0.015) 30px, rgba(0, 255, 255, 0.015) 31px);
  pointer-events: none;
}

.arch-layer {
  border: 1px dashed rgba(0, 255, 255, 0.2);
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
  position: relative;
}

.arch-layer:last-child {
  margin-bottom: 0;
}

.arch-layer-label {
  position: absolute;
  top: -10px;
  left: 20px;
  background: #0a0a0a;
  padding: 0 10px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.7rem;
  color: rgba(0, 255, 255, 0.6);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.arch-nodes {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}

.arch-node {
  background: rgba(0, 255, 255, 0.05);
  border: 1px solid rgba(0, 255, 255, 0.15);
  border-radius: 6px;
  padding: 10px 16px;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.7);
  text-align: center;
  min-width: 100px;
  transition: all 0.3s;
}

.arch-node:hover {
  background: rgba(0, 255, 255, 0.1);
  border-color: rgba(0, 255, 255, 0.4);
  color: #fff;
}

.arch-node.primary {
  border-color: rgba(0, 255, 255, 0.4);
  background: rgba(0, 255, 255, 0.08);
  color: #0ff;
}

.arch-node.secondary {
  border-color: rgba(255, 64, 129, 0.3);
  background: rgba(255, 64, 129, 0.05);
  color: #ff4081;
}

.arch-connector {
  text-align: center;
  color: rgba(0, 255, 255, 0.3);
  font-size: 1.2rem;
  margin: 8px 0;
}

/* ========== K3s Node Grid ========== */
.node-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.node-card {
  background: rgba(15, 15, 15, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 16px;
  text-align: center;
  transition: all 0.3s;
}

.node-card:hover {
  border-color: rgba(0, 255, 255, 0.3);
}

.node-card.control-plane {
  border-color: rgba(0, 255, 255, 0.2);
  background: rgba(0, 255, 255, 0.03);
}

.node-card.worker {
  border-color: rgba(255, 64, 129, 0.15);
  background: rgba(255, 64, 129, 0.02);
}

.node-role {
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 2px 8px;
  border-radius: 10px;
  display: inline-block;
  margin-bottom: 8px;
}

.node-card.control-plane .node-role {
  background: rgba(0, 255, 255, 0.15);
  color: #0ff;
}

.node-card.worker .node-role {
  background: rgba(255, 64, 129, 0.15);
  color: #ff4081;
}

.node-name {
  font-family: 'Roboto Mono', monospace;
  font-size: 0.85rem;
  color: #fff;
  margin-bottom: 4px;
}

.node-ip {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

/* ========== Security Stack ========== */
.security-feature {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  padding: 20px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.security-feature:last-child {
  border-bottom: none;
}

.security-feature .feature-icon {
  font-size: 2rem;
  color: #ff4081;
  flex-shrink: 0;
  width: 50px;
  text-align: center;
}

.security-feature h4 {
  font-size: 1rem;
  color: #fff;
  margin-bottom: 5px;
}

.security-feature p {
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.security-feature .feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.security-feature .feature-tags .badge {
  background: rgba(255, 64, 129, 0.1);
  color: #ff4081;
  font-weight: 400;
  font-size: 0.7rem;
  padding: 3px 8px;
  border-radius: 10px;
  border: 1px solid rgba(255, 64, 129, 0.2);
}

/* ========== GitOps Flow ========== */
.gitops-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
  padding: 30px 0;
}

.gitops-step {
  background: rgba(15, 15, 15, 0.9);
  border: 1px solid rgba(0, 255, 255, 0.15);
  border-radius: 10px;
  padding: 20px;
  text-align: center;
  min-width: 140px;
  max-width: 180px;
  transition: all 0.3s;
}

.gitops-step:hover {
  border-color: rgba(0, 255, 255, 0.4);
  transform: translateY(-3px);
}

.gitops-step i {
  font-size: 1.8rem;
  color: #0ff;
  display: block;
  margin-bottom: 8px;
}

.gitops-step span {
  font-size: 0.85rem;
  color: rgba(255, 255, 255, 0.7);
}

.gitops-arrow {
  color: rgba(0, 255, 255, 0.4);
  font-size: 1.5rem;
  padding: 0 8px;
  flex-shrink: 0;
}

/* ========== Back to Top & CTA ========== */
.homelab-cta {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, #0a0a0a, #1a1a1a);
}

.homelab-cta h2 {
  font-family: 'Orbitron', sans-serif;
  color: #0ff;
  margin-bottom: 15px;
}

.homelab-cta p {
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 30px;
}

.btn-cyan {
  background: linear-gradient(135deg, #0ff, #00b3b3);
  color: #000;
  border: none;
  padding: 12px 30px;
  border-radius: 30px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

.btn-cyan:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 255, 255, 0.4);
  color: #000;
}

.btn-outline-cyan {
  background: transparent;
  color: #0ff;
  border: 2px solid #0ff;
  padding: 10px 28px;
  border-radius: 30px;
  font-family: 'Orbitron', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  transition: all 0.3s;
  text-decoration: none;
  display: inline-block;
}

.btn-outline-cyan:hover {
  background: rgba(0, 255, 255, 0.1);
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(0, 255, 255, 0.2);
  color: #0ff;
}

/* ========== Responsive ========== */
@media (max-width: 992px) {
  .homelab-hero h1 {
    font-size: 2.2rem;
  }

  .hero-stats-row {
    gap: 25px;
  }

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

  .gitops-flow {
    flex-direction: column;
    gap: 10px;
  }

  .gitops-arrow {
    transform: rotate(90deg);
    padding: 0;
  }
}

@media (max-width: 768px) {
  .homelab-hero {
    padding: 70px 15px 50px;
  }

  .homelab-hero h1 {
    font-size: 1.8rem;
  }

  .hero-stat .stat-value {
    font-size: 2rem;
  }

  .homelab-section {
    padding: 50px 15px;
  }

  .homelab-section h2 {
    font-size: 1.6rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }

  .stat-block .stat-number {
    font-size: 2rem;
  }

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

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

  .node-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .arch-diagram {
    padding: 20px;
  }

  .subnav-links {
    justify-content: flex-start;
    padding: 0 10px;
  }
}

@media (max-width: 576px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .node-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .hero-stats-row {
    gap: 15px;
  }

  .hero-stat .stat-value {
    font-size: 1.6rem;
  }
}

/* ========== Animate on scroll ========== */
.homelab-section {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.homelab-section.appear {
  opacity: 1;
  transform: translateY(0);
}

/* Counter animation */
.count-up {
  transition: all 0.3s;
}
