/* Importazione dei Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@700&family=Cinzel&family=Exo+2:ital,wght@1,800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Genos:wght@100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:ital,wght@0,100..800;1,100..800&display=swap');



body {
    font-family: Genos, monospace;
    background-color: #222;
    padding: 50px;
    font-size: 12px;
    weight: 400;
}

h1 {
	font-family: Orbitron, monospace;
	color: #ffcc99;
	text-shadow: 0 1px 20px rgba(255, 169, 93, 0.8), 2px 0 40px rgba(255, 169, 93, 0.4);
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

tr:hover {
    background-color: #f1f1f1;
}

/* Rendi il contenitore leggibile */
pre {
    background: #333;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-family: "JetBrains Mono", monospace;
    font-optical-sizing: auto;
    font-weight: 400;
    font-size: 1.6rem;
    letter-spacing: 0.5px;
    text-shadow: 0 0 7px rgba(93, 169, 255, 0.8), 0 0 10px rgba(93, 169, 255, 0.4), 1px 1px 0 #000;
    text-align: left;
}

/* Stilizza i link (i tuoi file) */
pre a {
    display: inline-block;
    padding: 5px 10px;
    text-decoration: none;
    color: #00bcff;
    border-radius: 4px;
    transition: background 0.2s;
}

/* Colpisce le intestazioni della tabella testuale */
pre a[href^="?C="] {
    color: #00bcff;
    text-shadow: 1px 1px 10px rgba(0, 188, 255, 0.8);
    font-weight: bold;
}

pre a:hover {
    background-color: #e9ecef;
    color: #0056b3;
}

/* Nascondi gli HR brutti di Apache */
hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 20px 0;
}


/* --- 1. NASCONDI ICONE ORIGINALI --- */
pre img {
    display: none !important;
}

/* --- 2. PREPARA I LINK --- */
pre a {
    text-decoration: none;
    position: relative;
    padding-left: 28px; /* Leggermente più spazio per non incollare l'icona */
    display: inline-block;
}

/* --- 3. REGOLA BASE PER LE ICONE (FA) --- */
/* Invece di content:none, definiamo lo stile comune qui */
pre a::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: 0;
    width: 20px;
    text-align: center;
    content: ""; /* Di base vuoto, così i titoli non mostrano nulla */
}

/* --- 4. ASSEGNAZIONE CONTENUTI SPECIFICI --- */

/* CARTELLE (link che finiscono con /) */
pre a[href$="/"]::before {
    content: "\f07b";
    color: #ffcc99;
}

/* PARENT DIRECTORY (link che torna indietro) */
pre a[href*=".."]::before {
    content: "\f062"; /* Freccia su */
    color: #ffffff;
    text-shadow: 0 0 8px #fff;
}

/* FILE COMPRESSI (.gz) */
pre a[href$=".gz"]::before {
    content: "\f1c6";
    color: #00bcff;
    text-shadow: 0 0 8px rgba(0, 188, 255, 0.6);
}

/* FILE GENERICI (TODO, copyright, ecc) */
/* Colpiamo solo i link che NON hanno slash, NON hanno punti di domanda e NON hanno due punti */
pre a:not([href$="/"]):not([href*="?"]):not([href*=".."]):not([href$=".gz"])::before {
    content: "\f15b";
    color: #ffcc99;
}

/* Se il link precede un'immagine che ha come testo alternativo "Parent Directory" */
pre a:has(+ img[alt*="PARENT"])::before,
pre img[alt*="PARENT"] + a::before {
    content: "\f062" !important;
    color: #fff !important;
}


/* --- 5. IL COLPO DI GRAZIA PER I TITOLI --- */
/* Se il link contiene un punto di domanda (ordinamento), forziamo il vuoto */
pre a[href*="?"]::before {
    content: none !important;
}

/*    Retro Details & Animations....*/

/* Effetto "CRT Scanline" */
body::before {
    content: " ";
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0; right: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.25) 50%), 
                linear-gradient(90deg, rgba(255, 0, 0, 0.06), rgba(0, 255, 0, 0.02), rgba(0, 0, 255, 0.06));
    z-index: 9999;
    pointer-events: none;
    background-size: 100% 4px, 3px 100%;
}

/*  Barra di scansione CRT animata  */
@keyframes scan {
    0% { transform: translateY(-100vh); }
    100% { transform: translateY(100vh); }
}

body::after {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100px;
    background: linear-gradient(0deg, rgba(0, 188, 255, 0.1) 0%, transparent 100%);
    opacity: 0.1;
    pointer-events: none;
    animation: scan 8s linear infinite;
}


