:root {
    --bg-color: rgb(13, 13, 13);
    --neon-accent: #FF6DFC; /* Magenta Y2K, ho pots canviar a cian o verd llima */
    --text-main: #e0e0e0;
    --panel-border: 2px solid var(--neon-accent);
    --main-font: Gap;
    --secondary-font: Terminal;
}

.btn-retro {
    border: 2px solid black;
    padding: 5px 10px;
    display: flex;
    align-items: center;
    background-color: var(--neon-accent);
    color: var(--bg-color);
    font-family: 'Terminal', normal;
    font-weight: bolder;
    font-size: 0.8rem;
    border: 3px solid #FF6DFC;
    outline: 3px solid black;
    text-decoration: none; /* Quita el subrayado del enlace */
    cursor: pointer;
    box-shadow: 0 0 10px rgba(255, 109, 252, 0.5);
}

.btn-retro:hover {
    background-color: var(--bg-color);
    color: var(--neon-accent);
    box-shadow: 0 0 20px rgba(255, 109, 252, 1);
}


h1 {
    color: var(--text-main);
    font-family: var(--secondary-font);
    font-size: 3rem;
    font-weight: bolder;
    margin-top: 70px;
    line-height: 0.8;
    margin-bottom: -1rem;
}

h2 {
    color: var(--text-main);
    font-size: 1.5rem;
    line-height: -4;
    font-family: var(--secondary-font);
}

p {
    color: var(--text-main);
    font-size: 1.5rem;
    font-family: var(--main-font);
}

.col-compra {
    background-color: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

/* Inputs del formulari de l'arxiu respectant el teu estil */
.input-retro, .input-retro-full {
    background-color: var(--bg-color); 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px solid #FF6DFC;
    padding: 5px 10px;
    font-family: 'Terminal', sans-serif;
    color: var(--text-main);
    outline: none;
    margin: 5px;
}
.input-retro-full {
    width: 90%;
    margin-bottom: 10px;
}

.input-retro::placeholder {
    color: var(--text-main);
}

.input-retro-full::placeholder {
    color: var(--text-main);
}

#formulari-arxiu summary {
    color: var(--text-main);
}

.tag-manager {
    color: var(--text-main);
}

.guia-contingut p, ul{
    color: var(--text-main);
    font-size: 0.9rem;
}

/* Graella de 3 columnes */
.grid-arxiu {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    max-width: 939px;
    margin: 0 auto;
}

/* Targeta individual de cada arxiu */
.arxiu-item {
     background-color: rgba(0, 0, 0, 0.4) !important; 
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border: 2px solid #FF6DFC;
    position: relative;
    overflow: hidden; /* Important per amagar el text flotant */
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.arxiu-item img {
    width: 100%;
    height: 370px;
    object-fit: cover; /* Retalla la imatge proporcionalment */
    border-bottom: 2px solid #FF6DFC;
}

.arxiu-info {
    padding: 10px;
    color: #FFCAF3;
    text-align: center;
}

.arxiu-info h4 { margin: 5px 0; font-size: 1.2rem; }
.arxiu-info h5 { margin: 0; color: #C19BC0; font-weight: normal; }
.arxiu-info small { display: block; margin-top: 10px; opacity: 0.7; }

/* El text ocult (overlay) que apareix al clicar */
.arxiu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    color: white;
    padding: 0 20px 20px 20px;
    box-sizing: border-box;
    overflow-y: auto; /* Scroll si el text és llarg */
    transform: translateY(100%); /* L'amaguem cap a baix */
    transition: transform 0.3s ease-in-out;
    pointer-events: none;
}

/* Quan JS li afegeixi la classe .actiu (al clicar), l'overlay puja */
.arxiu-item.actiu .arxiu-overlay {
    transform: translateY(0);
    pointer-events: auto;
    border-top: 2px solid #FF6DFC;
}

/* Responsive: 2 columnes en tauletes, 1 en mòbils */
@media (max-width: 960px) { .grid-arxiu { grid-template-columns: 1fr 1fr; } }
@media (max-width: 642px) { .grid-arxiu { grid-template-columns: 1fr; } }

.tag-manager { width: 100%; margin-bottom: 15px; text-align: left; font-family: 'Terminal'; }
.tags-container { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 5px; min-height: 25px; }

.tag-badge {
    background: #FF6DFC;
    color: black;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.tag-badge span { cursor: pointer; font-weight: bold; }

.search-box { position: relative; }
.dropdown-suggeriments {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: black;
    border: 1px solid #FF6DFC;
    z-index: 100;
    max-height: 150px;
    overflow-y: auto;
    display: none;
}
.dropdown-item { padding: 8px; cursor: pointer; color: #FFCAF3; border-bottom: 1px solid #333; }
.dropdown-item:hover { background: #333; }
.dropdown-item.nou { color: #FF6DFC; font-style: italic; }

/* --- ENLLAÇOS DINS DE L'ARXIU --- */
.enllac-arxiu {
    color: #FF6DFC;
    text-decoration: underline;
    font-weight: bold;
    word-break: break-all; /* Això evita que un enllaç molt llarg surti fora de la caixa */
    transition: all 0.2s ease-in-out;
}

.enllac-arxiu:hover {
    color: white;
    text-shadow: 0 0 8px #FF6DFC;
    text-decoration: none;
}
.petons-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px dashed rgba(255, 109, 252, 0.3);
}

.btn-peto-arxiu {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: transform 0.2s;
}

.btn-peto-arxiu:hover {
    transform: scale(1.3);
}

.comptador-petons {
    color: #FF6DFC;
    font-weight: bold;
    font-size: 0.9rem;
}

.btn-peto-arxiu {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

/* Mida de la imatge del petó */
.img-peto-btn {
    width: 25px !important;   /* Ajusta-ho si ho vols més gran */
    height: auto !important;
    border: none !important;
    display: block;
}

/* Efecte en passar el ratolí */
.btn-peto-arxiu:hover {
    transform: scale(1.4) rotate(-10deg);
}

/* Efecte en clicar (feedback visual) */
.btn-peto-arxiu:active {
    transform: scale(0.9);
}

.search-box { 
    position: relative; 
    z-index: 999; /* Donem prioritat a la caixa del cercador */
}

.dropdown-suggeriments {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: black;
    border: 1px solid #FF6DFC;
    z-index: 1000; /* Donem la màxima prioritat al desplegable */
    max-height: 150px;
    overflow-y: auto;
    display: none;
}

.caixeta h2 {
    background-color: transparent !important; /* Traiem el negre sòlid perquè es vegi la foto */
    background-size: cover;
    background-position: center;
    image-rendering: pixelated; /* Manté l'efecte Pixel Art nítid */
}

.box-title {
    background-image: linear-gradient(rgb(0, 0, 0), rgb(31, 2, 30)), url('assets/2M-6.webp');
}

    input, textarea, select {
        font-size: 16px !important;
    }


/* --- PAGINACIÓ ÚLTIMES CREACIONS --- */
.creacio-item {
    display: none; /* Amaguem totes les obres per defecte */
}

.creacio-item.visible {
    display: block; /* Mostrem només les que decideixi el JS */
}

/* ==========================================
   SISTEMA DE COMENTARIS (Arxiu i Referents)
   ========================================== */

.seccio-comentaris {
    margin-top: 15px;
    border-top: 1px dashed #FFCAF3;
    padding-top: 10px;
}

.seccio-comentaris-gran {
    margin-top: 15px;
    padding-top: 10px;
}

.llista-comentaris {
    max-height: 100px;
    overflow-y: auto;
    margin-bottom: 10px;
    padding-right: 5px;
}

.comentari-item {
    margin-bottom: 8px;
    font-size: 0.85rem;
    border-left: 2px solid #FF6DFC;
    padding-left: 8px;
    text-align: left;
}

.comentari-nom {
    color: #FF6DFC;
}

.comentari-text {
    color: #fff;
    word-break: break-word;
}

.comentari-buit {
    font-size: 0.8rem;
    color: #aaa;
    text-align: center;
}

.form-comentari {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.nom-comentari, .text-comentari {
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    font-size: 0.8rem;
}

.text-comentari {
    resize: none;
}

.btn-enviar-comentari {
    position: relative;
    width: 100%;
    margin: 5px 0 0 0;
    font-size: 0.8rem;
    font-family: Arial, Helvetica, sans-serif;
    cursor: pointer;
}

/* 1. Per a navegadors basats en WebKit (Chrome, Safari, Edge, Opera) */

/* Defineix l'amplada total de la barra */
::-webkit-scrollbar {
    width: 10px; /* Barra vertical */
    height: 10px; /* Barra horitzontal */
}

/* El fons de la barra (track) */
::-webkit-scrollbar-track {
    background: #121212; /* Un negre fosc que combini amb el teu fons */
}

/* La part que l'usuari arrossega (thumb) */
::-webkit-scrollbar-thumb {
    background: #FF6DFC; /* El teu rosa característic */
    border-radius: 5px;  /* Arrodonit */
    border: 2px solid #121212; /* Espai visual entre el thumb i el track */
}

/* Efecte en passar el ratolí per sobre del thumb */
::-webkit-scrollbar-thumb:hover {
    background: #ff99f1;
}

/* 2. Per a Firefox (utilitza propietats estàndard) */
* {
    scrollbar-width: thin;          /* "auto", "thin" o "none" */
    scrollbar-color: #FF6DFC #121212; /* color del thumb + color del track */
}

/* --- BOTONS DE CONTROL DEL CREADOR (EDITAR/ELIMINAR) --- */
.controls-creador {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 8px;
    z-index: 10; /* Per assegurar-nos que estan per sobre de la imatge */
}

.btn-creador {
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    border: 2px solid #FF6DFC;
    border-radius: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.btn-creador:hover {
    background-color: #FF6DFC;
    color: black;
    transform: scale(1.1);
}

.btn-eliminar-creador {
    border-color: #FF6DFC;
    color: #FF6DFC;
}

.btn-eliminar-creador:hover {
    background-color: #FF6DFC;
    color: white;
}

/* --- ESTILS DE LA VISTA DETALLADA --- */
#vista-detall {
    width: 100%;
    /* Max-width assegura que ocupi exactament el mateix que ocuparia la teva graella contenidora */
    max-width: 1200px; 
    margin: 0 auto;
    padding-bottom: 50px;
}

#btn-tornar-detall {
    background: transparent;
    color: #ff6dfc;
    border: 1px solid #ff6dfc;
    padding: 8px 15px;
    font-family: inherit;
    font-size: 1.2rem;
    cursor: pointer;
    margin-bottom: 20px;
    border-radius: 5px;
    transition: 0.3s;
}

#btn-tornar-detall:hover {
    background: #ff6dfc;
    color: black;
}

.contingut-detall {
    background: rgba(0, 0, 0, 0.6); /* Un fons fosc per llegir bé el text */
    padding: 20px;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

#detall-imatge {
    width: 100%; /* Ocupa tota l'amplada del contenidor */
    height: auto;
    margin-bottom: 20px;
    box-shadow: 0px 4px 15px rgba(0,0,0,0.5);
}

#detall-titol { margin-top: 0; margin-bottom: 5px; }
#detall-subtitol { color: #ffffff; margin-bottom: 20px; }
#detall-cos { line-height: 1.6; font-size: 1.1rem; color: #ffffff }

.etiqueta-arxiu {
    background: #FF6DFC;
    color: black;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    display: inline-flex; 
    align-items: center;
    gap: 5px;
    margin-right: 5px; 
    margin-bottom: 5px;
    font-weight: bold;
}
.box-title:hover {
    cursor: grab; /* Indica visualment que la caixa es pot arrossegar */
}
/* Estil que s'aplica quan les caixes surten de la columna */
.box-flotant {
    background-color: rgba(0, 0, 0, 0.4) !important;
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 7px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5); /* Dona sensació de profunditat */
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

/* Efecte visual quan l'usuari agafa la caixa */
.box-flotant.arrossegant {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 109, 252, 0.4);
    opacity: 0.95;
}

.box-title:hover {
    cursor: grab;
}
.contingut-markdown p {
    margin-bottom: 15px; 
    font-size: 1rem;
}

#matrix {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1; /* Al fons de tot */
    pointer-events: none; /* Deixa que es pugui clicar el que hi hagi a sota */
}

.arxiu-overlay a {
    color: var(--neon-accent);
}

#detall-cos a {
    color: var(--neon-accent);
}
.grid-container-1 {
    display: grid;
    grid-template-columns: 1fr;
    justify-items:center;
    max-width: 930px;
    margin: 0 auto;
    align-items: stretch; /* Asegura que todas las .column midan lo mismo */
}

header {
    position: relative; /* Permet posicionar el text a sobre */
    width: 100%;        /* Ocupa tota l'amplada de la pàgina */
    height: 140px;      /* Fixa l'alçada als 100px que demanes */
    overflow: hidden;   /* Amaga qualsevol part de la imatge que sobresurti */
}

.fondo {
    width: 100%;        /* Força la imatge a ocupar tota l'amplada */
    height: 140px;      /* Fixa l'alçada de la imatge */
    object-fit: cover;  /* Retalla la imatge de forma proporcional sense deformar-la */
    display: block;
}

.container {
    max-width: 930px;   /* Amplada màxima que demanes */
    width: 100%;        /* Ocupa el 100% en pantalles més petites de 930px */
    margin: 0 auto;     /* Centra la columna horitzontalment a la pantalla */
    position: relative; /* Serveix de referència per al posicionament absolut del text */
    top: -80%;
height: 100%;
}

.text-header {
 position: absolute;
    top: 30px;
    left: 20px;         /* Aliniat a l'esquerra d'aquesta columna de 930px */
    transform: translateY(-50%);
    color: white;
    z-index: 10;        /* S'assegura que el text quedi per sobre */
    margin: 0 20px;
    
}

@media (min-width: 960px) { 
 .fondo {
    height: 50px;
 }
 .text-header {
    display: none;
 }
 #text-header-n {
    display: block !important;
 }
 header {
    height: 50px;
 }
}

@media (max-width: 960px) { 
#titol {
margin-top: 85px;
}
}