/* ============================================================
   RESET E BASE
   ============================================================ */
* { 
    margin: 0; 
    padding: 0; 
    box-sizing: border-box; 
}

body { 
    font-family: 'Roboto', sans-serif; 
    background-color: #1a1a1a; 
    color: #f4f4f4; 
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    margin: 0;
}

main{
  	width: 100vw
}

h1, h2, h3, .logo { 
  	margin-top: auto;
    font-family: 'Oswald', sans-serif; 
    text-transform: uppercase; 
}

/* ============================================================
   NAVIGAZIONE (NAVBAR)
   ============================================================ */
.navbar { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    padding: 15px 5%; 
    background: #000; 
    border-bottom: 3px solid #556b2f; 
}

.logo { 
    font-size: 1.5rem; 
    color: #fff; 
    text-decoration: none; 
    font-weight: bold; 
}

.logo span { 
    color: #556b2f; 
}

.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 20px; 
    align-items: center; 
}

.nav-links a { 
    color: #fff; 
    text-decoration: none; 
    font-weight: bold; 
    font-size: 0.9rem; 
}

.btn-sell { 
    background: #556b2f; 
    padding: 8px 15px; 
    border-radius: 4px; 
    transition: 0.3s; 
}

.btn-sell:hover { 
    background: #6b8e23; 
}

/* ============================================================
   HERO SECTION
   ============================================================ */
.hero { 
    padding: 100px 20px; 
    background: linear-gradient(rgba(0,0,0,0.75), rgba(0,0,0,0.75)), no-repeat center center/cover; 
    text-align: center; 
}

.hero h1 { 
    font-size: 3rem; 
    margin-bottom: 15px; 
    letter-spacing: 2px; 
}

.hero p { 
    font-size: 1.2rem; 
    margin-bottom: 30px; 
    color: #ccc; 
}

/* BOTTONI HERO */
.hero-btns { 
    display: flex; 
    gap: 15px; 
    justify-content: center; 
    flex-wrap: wrap; 
    margin-top: 20px; 
}

.btn-primary, .btn-secondary {
    display: inline-block !important;
    padding: 15px 30px !important;
    text-decoration: none !important;
    font-weight: bold !important;
    text-transform: uppercase !important;
    border-radius: 5px !important;
    transition: 0.3s !important;
    text-align: center !important;
    min-width: 200px;
    border: none;
    cursor: pointer;
}

.btn-primary { 
    background-color: #556b2f !important; 
    color: white !important; 
}

.btn-primary:hover { 
    background-color: #6b8e23 !important; 
}

.btn-secondary { 
    background-color: transparent !important; 
    color: white !important; 
    border: 2px solid white !important; 
}

.btn-secondary:hover { 
    background-color: white !important; 
    color: black !important; 
}

/* ============================================================
   PAGINA LOGIN & REGISTRAZIONE (AUTH)
   ============================================================ */
.auth-page {
    /* SFONDO TATTICO (Addio pentola!) */
    background-size: cover;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 40px 20px;
}

.auth-container {
    background: rgba(20, 20, 20, 0.95);
    border: 2px solid #556b2f;
    border-radius: 10px;
    display: flex;
    max-width: 950px;
    width: 100%;
    box-shadow: 0 0 40px rgba(0,0,0,0.7);
    position: relative;
    flex-wrap: wrap;
    overflow: hidden;
}

.auth-box {
    flex: 1;
    padding: 45px;
    min-width: 320px;
}

.auth-box h2 {
    color: #556b2f;
    margin-bottom: 25px;
    font-size: 1.8rem;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    text-align: center;
}

.auth-box p {
    font-size: 0.95rem;
    color: #aaa;
    margin-bottom: 25px;
    text-align: center;
}

/* DIVISORE CENTRALE */
.auth-divider {
    width: 2px;
    background: linear-gradient(to bottom, transparent, #556b2f, transparent);
    margin: 40px 0;
}

/* INPUT E GRUPPI */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    color: #8da45f;
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.input-group input, .input-group select {
    width: 100%;
    padding: 12px;
    background: #111;
    border: 1px solid #444;
    color: white;
    border-radius: 4px;
    font-family: 'Roboto', sans-serif;
}

.input-group input:focus {
    border-color: #556b2f;
    outline: none;
    background: #1a1a1a;
}

.checkbox-group {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    font-size: 0.85rem;
    color: #ccc;
    line-height: 1.3;
}

.full-width { width: 100%; }

.forgot-pw {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #666;
    text-decoration: none;
    font-size: 0.85rem;
}

.forgot-pw:hover { color: #8da45f; }

.back-home {
    position: absolute;
    bottom: 20px;
    width: 100%;
    text-align: center;
}

.back-home a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.6;
}

/* ============================================================
   BARRA DI RICERCA
   ============================================================ */
.search-bar-section { 
    background: #000; 
    padding: 25px; 
    border-bottom: 2px solid #556b2f; 
}

.search-form { 
    display: flex; 
    gap: 10px; 
    max-width: 1100px; 
    margin: 0 auto; 
    flex-wrap: wrap; 
}

.search-form input, .search-form select { 
    flex: 1; 
    min-width: 180px; 
    padding: 12px; 
    background: #2a2a2a; 
    border: 1px solid #444; 
    color: white; 
    border-radius: 4px; 
}

.search-form button { 
    background: #556b2f; 
    color: white; 
    border: none; 
    padding: 0 30px; 
    font-weight: bold; 
    cursor: pointer; 
    border-radius: 4px; 
    text-transform: uppercase; 
}

/* ============================================================
   GRIGLIA ANNUNCI E TITOLI (CENTRATI)
   ============================================================ */
.container { 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 0 20px; 
}

.section-title { 
    color: #556b2f; 
    margin: 0 auto 40px auto; 
    text-align: center; 
    display: table; 
    padding: 0 20px 10px 20px;
    border-bottom: 3px solid #556b2f; 
    font-size: 2.2rem;
}

.annunci-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); 
    gap: 25px; 
}

.scheda-item { 
    background: #2a2a2a; 
    border: 1px solid #333; 
    border-radius: 10px; 
    overflow: hidden; 
    transition: 0.3s; 
}

.scheda-item:hover { 
    transform: translateY(-5px); 
    border-color: #556b2f; 
}

.immagine-item { 
    height: 200px; 
    background-size: cover; 
    background-position: center; 
    position: relative; 
}

.info-item { padding: 20px; }

.price { 
    font-size: 1.4rem; 
    font-weight: bold; 
    color: #fff; 
    display: block; 
    margin: 10px 0; 
}

.btn-view { 
    display: block; 
    text-align: center; 
    background: #333; 
    color: #fff; 
    text-decoration: none; 
    padding: 10px; 
    border-radius: 4px; 
    border: 1px solid #444; 
}

.btn-view:hover { background: #556b2f; border-color: #556b2f; }

/* Stile base per tutti i tag categoria */
.tag-categoria {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 12px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 3px;
    color: #fff;
    z-index: 2;
}

/* Colore specifico per SOFTAIR (Verde Militare) */
.tag-categoria.softair {
    background-color: #556b2f;
}

/* Colore specifico per LASERTAG (Rosso/Arancio per distinguerlo) */
.tag-categoria.lasertag {
    background-color: #d35400;
}

/* Colore specifico per ATTREZZATURA (Grigio scuro) */
.tag-categoria.attrezzatura {
    background-color: #0CADED;
}

/* ============================================================
   FOOTER (CENTRATO)
   ============================================================ */
footer { 
    background: #000; 
    padding: 50px 20px; 
    text-align: center; 
    border-top: 2px solid #333; 
    margin-top: 60px;
    width: 100%;
}

footer p {
    color: #888;
    font-size: 0.9rem;
    max-width: 800px;
    margin: 0 auto;
}

footer a {
    color: #8da45f;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}

footer a:hover {
    color: #fff;
    text-decoration: underline;
}

/* ============================================================
   MOBILE RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .navbar {
        display: flex;
        flex-direction: column; /* Forza la disposizione verticale: Logo sopra, Menu sotto */
        align-items: center;    /* Centra tutto orizzontalmente */
        gap: 15px;              /* Spazio tra logo e menu */
        padding: 15px 5%;
        background: #000;
    }

    .nav-links {
        display: flex;          /* Assicura che i link siano flessibili */
        flex-wrap: wrap;        /* Permette ai link di andare a capo se troppi */
        justify-content: center;/* Centra i link sotto il logo */
        gap: 15px;              /* Spazio tra i vari link */
        width: 100%;            /* Usa tutto lo spazio disponibile */
        padding: 0;
        margin: 0;
        list-style: none;
    }
    .hero h1 { font-size: 2rem; }
    .hero-btns { flex-direction: column; align-items: center; }
    .btn-primary, .btn-secondary { width: 90%; }
    .search-form { flex-direction: column; }
    .search-form input, .search-form select, .search-form button { width: 100%; height: 50px; }
    .section-title { font-size: 1.6rem; }
    
    /* Login Mobile */
    .auth-container { flex-direction: column; }
    .auth-divider { width: 80%; height: 2px; margin: 0 auto; }
}

/* --- TAG CATEGORIA --- */
.tag-categoria {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    border-radius: 3px;
    color: #fff;
    z-index: 2;
}
.tag-categoria.softair { background-color: #556b2f; }
.tag-categoria.lasertag { background-color: #d35400; }
.tag-categoria.attrezzatura { background-color: #444; }

/* --- AGGIUSTAMENTI CARD --- */
.footer-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.location {
    font-size: 0.85rem;
    color: #8da45f;
    margin-top: 5px;
}

/* 1. Rendi il dropdown un blocco solido senza spazi */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #2a2a2a;
    min-width: 180px;
    box-shadow: 0px 8px 16px rgba(0,0,0,0.3);
    z-index: 1000;
    border-radius: 4px;
    
    /* IMPORTANTE: Questo "ponte" invisibile copre lo spazio vuoto */
    padding-top: 10px; 
    margin-top: -5px; 
}

/* 2. Assicurati che l'area sensibile all'hover sia continua */
.dropdown {
    padding-bottom: 10px; /* Estende l'area di hover verso il basso */
    margin-bottom: -10px;
}

/* 3. Per i link interni, togliamo il padding eccessivo se serve */
.dropdown-content a {
    color: white;
    padding: 12px 16px;
    display: block;
    margin-top: 0; /* Evita altri gap */
}

/* Effetto hover sui link del dropdown */
.dropdown-content a:hover {
    background-color: #8da45f; /* Il tuo verde militare */
}

/* Mostra il menu quando passi sopra con il mouse */
.dropdown:hover .dropdown-content {
    display: block;
}

/* Stile per il pulsante "Info" */
.dropbtn {
    cursor: pointer;
}

/* Stile per il pallino rosso delle notifiche */
.badge {
    background-color: #ff3b30; /* Rosso acceso stile notifica */
    color: white;              /* Numero bianco */
    font-size: 0.75rem;        /* Testo piccolo */
    font-weight: bold;
    
    /* Dimensioni e forma */
    min-width: 20px;           /* Larghezza minima per numeri singoli */
    height: 20px;              /* Altezza fissa */
    border-radius: 50%;        /* Rende il quadrato un cerchio perfetto */
    padding: 0 5px;            /* Un po' di spazio laterale se il numero diventa a 2 cifre (es. 10) */
    
    /* Allineamento del numero al centro del pallino */
    display: inline-flex;
    justify-content: center;
    align-items: center;
    
    /* Posizionamento rispetto al testo */
    margin-left: 8px;          /* Spazio dal nome utente */
    vertical-align: middle;    /* Allineato verticalmente al testo */
    transform: translateY(-1px); /* Piccolo aggiustamento ottico verso l'alto */
}