---
// src/pages/projects/tech-stack.astro
import BaseLayout from '../../layouts/BaseLayout.astro'; // Corrected path
import Header from '../../components/Header.astro'; // Corrected path
import Footer from '../../components/Footer.astro'; // Corrected path

const title = "Tech Stack | ArgoBox";
const description = "Explore the technology stack that powers ArgoBox projects, infrastructure, and home lab environment.";

// Define tech stack categories and items
const techCategories = [
  {
    name: "Infrastructure & Hosting",
    icon: "🏗️",
    technologies: [
      {
        name: "Proxmox VE",
        description: "Hypervisor for virtualization and container management",
        url: "https://www.proxmox.com/en/proxmox-ve",
        logo: "/images/tech/proxmox.svg"
      },
      {
        name: "TrueNAS Scale",
        description: "Storage platform with built-in virtualization capabilities",
        url: "https://www.truenas.com/truenas-scale/",
        logo: "/images/tech/truenas.svg"
      },
      {
        name: "pfSense",
        description: "Open source firewall/router with advanced features",
        url: "https://www.pfsense.org/",
        logo: "/images/tech/pfsense.svg"
      },
      {
        name: "UniFi Network",
        description: "Enterprise-grade networking equipment and management",
        url: "https://ui.com/",
        logo: "/images/tech/unifi.svg"
      }
    ]
  },
  {
    name: "Container Orchestration",
    icon: "🚢",
    technologies: [
      {
        name: "Kubernetes",
        description: "Container orchestration platform for application scaling",
        url: "https://kubernetes.io/",
        logo: "/images/tech/kubernetes.svg"
      },
      {
        name: "Rancher",
        description: "Multi-cluster Kubernetes management interface",
        url: "https://rancher.com/",
        logo: "/images/tech/rancher.svg"
      },
      {
        name: "ArgoCD",
        description: "GitOps continuous delivery tool for Kubernetes",
        url: "https://argoproj.github.io/argo-cd/",
        logo: "/images/tech/argocd.svg"
      },
      {
        name: "Longhorn",
        description: "Cloud-native distributed storage for Kubernetes",
        url: "https://longhorn.io/",
        logo: "/images/tech/longhorn.svg"
      }
    ]
  },
  {
    name: "CI/CD & Automation",
    icon: "🔄",
    technologies: [
      {
        name: "Terraform",
        description: "Infrastructure as Code for cloud and on-premises resources",
        url: "https://www.terraform.io/",
        logo: "/images/tech/terraform.svg"
      },
      {
        name: "Ansible",
        description: "Automation platform for configuration management",
        url: "https://www.ansible.com/",
        logo: "/images/tech/ansible.svg"
      },
      {
        name: "GitHub Actions",
        description: "CI/CD pipeline automation integrated with GitHub",
        url: "https://github.com/features/actions",
        logo: "/images/tech/github-actions.svg"
      },
      {
        name: "Flux CD",
        description: "GitOps tool for keeping Kubernetes clusters in sync",
        url: "https://fluxcd.io/",
        logo: "/images/tech/flux.svg"
      }
    ]
  },
  {
    name: "Monitoring & Observability",
    icon: "📊",
    technologies: [
      {
        name: "Prometheus",
        description: "Monitoring system with time-series database",
        url: "https://prometheus.io/",
        logo: "/images/tech/prometheus.svg"
      },
      {
        name: "Grafana",
        description: "Visualization and analytics platform for metrics",
        url: "https://grafana.com/",
        logo: "/images/tech/grafana.svg"
      },
      {
        name: "Loki",
        description: "Log aggregation system designed for Kubernetes",
        url: "https://grafana.com/oss/loki/",
        logo: "/images/tech/loki.svg"
      },
      {
        name: "Uptime Kuma",
        description: "Self-hosted monitoring tool for websites and services",
        url: "https://github.com/louislam/uptime-kuma",
        logo: "/images/tech/uptime-kuma.svg"
      }
    ]
  },
  {
    name: "Development & Web",
    icon: "💻",
    technologies: [
      {
        name: "Astro",
        description: "Modern static site builder with minimal JavaScript",
        url: "https://astro.build/",
        logo: "/images/tech/astro.svg"
      },
      {
        name: "Docker",
        description: "Container platform for application packaging",
        url: "https://www.docker.com/",
        logo: "/images/tech/docker.svg"
      },
      {
        name: "Tailwind CSS",
        description: "Utility-first CSS framework for rapid UI development",
        url: "https://tailwindcss.com/",
        logo: "/images/tech/tailwind.svg"
      },
      {
        name: "Node.js",
        description: "JavaScript runtime for building server-side applications",
        url: "https://nodejs.org/",
        logo: "/images/tech/nodejs.svg"
      }
    ]
  }
];
---

<BaseLayout title={title} description={description}>
  <Header slot="header" />
  
  <div class="container">
    <div class="page-header">
      <h1>Tech Stack</h1>
      <div class="header-accent"></div>
      <p class="intro-text">
        Explore the technologies, tools, and platforms that power the ArgoBox infrastructure, projects, and home lab environment. This curated stack focuses on enterprise-grade solutions that balance performance, reliability, and maintainability.
      </p>
    </div>
    
    <div class="stack-container">
      {techCategories.map(category => (
        <div class="category-section">
          <div class="category-header">
            <div class="category-icon">{category.icon}</div>
            <h2 class="category-title">{category.name}</h2>
          </div>
          
          <div class="technologies-grid">
            {category.technologies.map(tech => (
              <a href={tech.url} target="_blank" rel="noopener noreferrer" class="tech-card">
                <div class="tech-logo-placeholder">
                  <span class="tech-initials">{tech.name.split(' ').map(word => word[0]).join('')}</span>
                </div>
                <div class="tech-info">
                  <h3 class="tech-name">{tech.name}</h3>
                  <p class="tech-description">{tech.description}</p>
                </div>
                <div class="tech-arrow">
                  <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                    <line x1="5" y1="12" x2="19" y2="12"></line>
                    <polyline points="12 5 19 12 12 19"></polyline>
                  </svg>
                </div>
              </a>
            ))}
          </div>
        </div>
      ))}
    </div>
    
    <div class="stack-cta">
      <div class="cta-content">
        <h2 class="cta-title">Build Your Own Home Lab</h2>
        <p class="cta-text">Interested in setting up a similar tech stack in your own environment? Check out my detailed tutorials and guides for step-by-step instructions.</p>
      </div>
      <div class="cta-buttons">
        <a href="/resources/tutorials" class="cta-button primary">View Tutorials</a>
        <a href="/projects/services" class="cta-button secondary">Explore Live Services</a>
      </div>
    </div>
  </div>
  
  <Footer slot="footer" />
</BaseLayout>

<style>
  .page-header {
    margin: 3rem 0 4rem;
    position: relative;
    text-align: center;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
  }
  
  h1 {
    font-size: var(--font-size-4xl);
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    margin-bottom: 0.5rem;
  }
  
  .header-accent {
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    border-radius: 2px;
    margin: 0.5rem auto 2rem;
  }
  
  .intro-text {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    line-height: 1.7;
    margin-bottom: 3rem;
  }
  
  .stack-container {
    display: flex;
    flex-direction: column;
    gap: 4rem;
    margin-bottom: 4rem;
  }
  
  .category-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
  }
  
  .category-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
  }
  
  .category-icon {
    font-size: 2rem;
  }
  
  .category-title {
    font-size: var(--font-size-2xl);
    color: var(--text-primary);
    position: relative;
  }
  
  .category-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-secondary), transparent);
    border-radius: 2px;
  }
  
  .technologies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
  
  .tech-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-primary);
    border-radius: 12px;
    padding: 1.25rem;
    transition: all 0.3s ease;
    text-decoration: none;
    position: relative;
    overflow: hidden;
  }
  
  .tech-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.05), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  .tech-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-primary);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
  }
  
  .tech-card:hover::before {
    opacity: 1;
  }
  
  .tech-logo-placeholder {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-secondary), var(--accent-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--bg-primary);
    font-weight: bold;
    font-size: var(--font-size-lg);
    flex-shrink: 0;
  }
  
  .tech-info {
    flex: 1;
  }
  
  .tech-name {
    font-size: var(--font-size-lg);
    color: var(--text-primary);
    margin-bottom: 0.5rem;
  }
  
  .tech-description {
    font-size: var(--font-size-sm);
    color: var(--text-tertiary);
    margin: 0;
    line-height: 1.5;
  }
  
  .tech-arrow {
    color: var(--accent-primary);
    opacity: 0;
    transform: translateX(-10px);
    transition: all 0.3s ease;
  }
  
  .tech-card:hover .tech-arrow {
    opacity: 1;
    transform: translateX(0);
  }
  
  .stack-cta {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 3rem;
    margin: 6rem 0 4rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    position: relative;
    overflow: hidden;
  }
  
  .stack-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 50%, rgba(6, 182, 212, 0.1), transparent 70%);
    pointer-events: none;
  }
  
  .cta-content {
    flex: 1;
  }
  
  .cta-title {
    font-size: var(--font-size-3xl);
    color: var(--text-primary);
    margin-bottom: 1rem;
  }
  
  .cta-text {
    color: var(--text-secondary);
    font-size: var(--font-size-lg);
    line-height: 1.7;
    margin: 0;
  }
  
  .cta-buttons {
    display: flex;
    gap: 1rem;
  }
  
  .cta-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    font-size: var(--font-size-md);
    text-decoration: none;
    transition: all 0.3s ease;
  }
  
  .cta-button.primary {
    background: linear-gradient(90deg, var(--accent-secondary), var(--accent-primary));
    color: var(--bg-primary);
    box-shadow: 0 5px 15px rgba(6, 182, 212, 0.2);
  }
  
  .cta-button.secondary {
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border-primary);
    color: var(--text-primary);
  }
  
  .cta-button.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(6, 182, 212, 0.3);
  }
  
  .cta-button.secondary:hover {
    transform: translateY(-3px);
    border-color: var(--accent-primary);
    background: rgba(15, 23, 42, 0.8);
  }
  
  @media (max-width: 768px) {
    .technologies-grid {
      grid-template-columns: 1fr;
    }
    
    .stack-cta {
      flex-direction: column;
      text-align: center;
      padding: 2rem 1.5rem;
    }
    
    .cta-buttons {
      flex-direction: column;
      width: 100%;
    }
    
    h1 {
      font-size: var(--font-size-3xl);
    }
    
    .cta-title {
      font-size: var(--font-size-2xl);
    }
    
    .category-title {
      font-size: var(--font-size-xl);
    }
  }
</style>