import type { Metadata } from "next";

export const metadata: Metadata = { title: "Faydalı Linkler" };

interface LinkItem {
  title: string;
  url: string;
  description: string;
}

interface Category {
  name: string;
  icon: string;
  links: LinkItem[];
}

const categories: Category[] = [
  {
    name: "Öğrenme Platformları",
    icon: "◈",
    links: [
      { title: "HackTheBox", url: "https://hackthebox.com", description: "CTF ve penetrasyon testi platformu" },
      { title: "TryHackMe", url: "https://tryhackme.com", description: "Yeni başlayanlar için siber güvenlik eğitimi" },
      { title: "PentesterLab", url: "https://pentesterlab.com", description: "Web güvenliği odaklı pratik eğitim" },
      { title: "PortSwigger Web Academy", url: "https://portswigger.net/web-security", description: "Burp Suite ekibinin ücretsiz web güvenlik eğitimi" },
      { title: "PicoCTF", url: "https://picoctf.org", description: "Carnegie Mellon üniversitesinin ücretsiz CTF platformu" },
    ],
  },
  {
    name: "Araçlar",
    icon: "⊡",
    links: [
      { title: "Nmap", url: "https://nmap.org", description: "Ağ keşif ve güvenlik tarama aracı" },
      { title: "Burp Suite", url: "https://portswigger.net/burp", description: "Web uygulama güvenlik testi aracı" },
      { title: "Metasploit", url: "https://metasploit.com", description: "Penetrasyon testi framework'ü" },
      { title: "Ghidra", url: "https://ghidra-sre.org", description: "NSA'nın açık kaynak reverse engineering aracı" },
      { title: "CyberChef", url: "https://gchq.github.io/CyberChef", description: "Veri dönüştürme ve analiz aracı" },
      { title: "OSINT Framework", url: "https://osintframework.com", description: "OSINT araçları haritası" },
    ],
  },
  {
    name: "Kaynaklar & Dokümantasyon",
    icon: "▤",
    links: [
      { title: "OWASP", url: "https://owasp.org", description: "Web güvenlik standartları ve kaynakları" },
      { title: "GTFOBins", url: "https://gtfobins.github.io", description: "Linux privilege escalation teknikleri" },
      { title: "LOLBAS", url: "https://lolbas-project.github.io", description: "Windows living off the land binaries" },
      { title: "PayloadsAllTheThings", url: "https://github.com/swisskyrepo/PayloadsAllTheThings", description: "Güvenlik testleri için payload koleksiyonu" },
      { title: "HackTricks", url: "https://book.hacktricks.xyz", description: "Kapsamlı hacking teknikleri kitabı" },
      { title: "Exploit Database", url: "https://exploit-db.com", description: "Public exploit veritabanı" },
    ],
  },
  {
    name: "Red Team",
    icon: "⚔",
    links: [
      { title: "Red Team Notes", url: "https://www.ired.team", description: "Red team teknikleri ve notları" },
      { title: "Cobalt Strike Guide", url: "https://hstechdocs.helpsystems.com/manuals/cobaltstrike", description: "Cobalt Strike resmi dokümantasyonu" },
      { title: "BloodHound", url: "https://github.com/BloodHoundAD/BloodHound", description: "Active Directory saldırı yolları analizi" },
      { title: "Impacket", url: "https://github.com/impacket/impacket", description: "Python ağ protokol kütüphanesi" },
    ],
  },
  {
    name: "Haberler & Blog",
    icon: "◎",
    links: [
      { title: "Krebs on Security", url: "https://krebsonsecurity.com", description: "Brian Krebs'in güvenlik blogu" },
      { title: "The Hacker News", url: "https://thehackernews.com", description: "Siber güvenlik haberleri" },
      { title: "Darknet Diaries", url: "https://darknetdiaries.com", description: "Gerçek siber suç hikayeleri podcast'i" },
      { title: "Project Zero Blog", url: "https://googleprojectzero.blogspot.com", description: "Google'ın güvenlik araştırma blogu" },
    ],
  },
  {
    name: "CTF Writeupları",
    icon: "◆",
    links: [
      { title: "0xdf hacks stuff", url: "https://0xdf.gitlab.io", description: "HTB ve CTF writeupları" },
      { title: "IppSec YouTube", url: "https://www.youtube.com/@ippsec", description: "HTB makineleri video çözümleri" },
      { title: "CTFtime", url: "https://ctftime.org", description: "CTF yarışmaları takvimi ve arşivi" },
    ],
  },
];

export default function FaydalıLinklerPage() {
  return (
    <div style={{ maxWidth: "100%" }}>
      <div className="page-title">Faydalı Linkler</div>
      <p style={{ fontSize: "0.8rem", color: "var(--text-muted)", marginBottom: "2rem" }}>
        Kategorilere göre düzenlenmiş faydalı bağlantılar koleksiyonu
      </p>

      <div style={{ display: "flex", flexDirection: "column", gap: "1.5rem" }}>
        {categories.map((cat) => (
          <div key={cat.name}>
            <div className="section-header">
              <span style={{ color: "var(--accent)", marginRight: "0.4rem" }}>{cat.icon}</span>
              {cat.name}
            </div>
            <div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(280px, 1fr))", gap: "0.5rem" }}>
              {cat.links.map((link) => (
                <a
                  key={link.url}
                  href={link.url}
                  target="_blank"
                  rel="noopener noreferrer"
                  className="card"
                  style={{ display: "block", textDecoration: "none", opacity: 1 }}
                >
                  <div style={{ display: "flex", alignItems: "center", justifyContent: "space-between", marginBottom: "0.25rem" }}>
                    <span style={{ fontSize: "0.85rem", fontWeight: 600, color: "var(--accent)" }}>{link.title}</span>
                    <span style={{ fontSize: "0.6rem", color: "var(--text-muted)" }}>↗</span>
                  </div>
                  <p style={{ fontSize: "0.75rem", color: "var(--text-muted)", lineHeight: 1.5, margin: 0 }}>{link.description}</p>
                </a>
              ))}
            </div>
          </div>
        ))}
      </div>
    </div>
  );
}
