/* Reset base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Arial', sans-serif;
}

/* Sfondo generale */
body {
    background-color: #1a1a1a;
    color: #fff;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container form login */
.login-container {
    background-color: #262626;
    padding: 40px;
    border-radius: 10px;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.5);
    width: 350px;
    text-align: center;
}

/* Titolo */
.login-container h2 {
    margin-bottom: 20px;
    color: #ff6600;
}

/* Input */
.login-container input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: none;
    border-radius: 5px;
    background: #333;
    color: #fff;
}

/* Pulsante */
.login-container button {
    width: 100%;
    padding: 12px;
    background-color: #ff6600;
    border: none;
    border-radius: 5px;
    color: #1a1a1a;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.login-container button:hover {
    background-color: #e65c00;
}

/* Messaggio errore */
.errore {
    color: #ff3300;
    margin-top: 10px;
}
.button {
    display: block;
    width: 100%;
    padding: 12px;
    background-color: #ff6600;
    text-align: center;
    text-decoration: none;
    color: #1a1a1a;
    font-weight: bold;
    border-radius: 5px;
    margin-bottom: 10px;
    transition: background 0.3s;
}

.button:hover {
    background-color: #e65c00;
}

.logout {
    background-color: #555;
    color: #fff;
}

.logout:hover {
    background-color: #333;
}
.successo {
    color: #00cc66;
    margin-top: 10px;
}
ul {
    text-align: left;
    padding-left: 20px;
}
ul li {
    margin-bottom: 10px;
}
/* Button group layout */
.button-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 20px;
}

/* Stile pulsanti uniformato */
.button, .secondary {
    flex: 1;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    font-weight: bold;
    border-radius: 5px;
    transition: background 0.3s;
    display: inline-block;
}

/* Primary button */
.button {
    background-color: #ff6600;
    color: #1a1a1a;
    border: none;
    cursor: pointer;
}

.button:hover {
    background-color: #e65c00;
}

/* Secondary button (Torna alla Home) */
.secondary {
    background-color: #333;
    color: #fff;
}

.secondary:hover {
    background-color: #555;
}
/* Drop Area */
#drop-area {
    border: 2px dashed #ff6600;
    padding: 20px;
    text-align: center;
    margin-top: 15px;
    border-radius: 5px;
    cursor: pointer;
    background-color: #1a1a1a;
    transition: all 0.3s;
}
#drop-area:hover {
    background-color: #222;
}
#drop-area.highlight {
    border-color: #e65c00;
    background-color: #2a2a2a;
}
#drop-area input[type="file"] {
    display: none;
}

/* Popup */
.popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-content {
    background: #262626;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
}

.popup-content h3 {
    color: #00cc66;
    margin-bottom: 10px;
}

.popup-content p {
    margin-bottom: 20px;
}
select {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    border: none;
    border-radius: 5px;
    background: #333;
    color: #fff;
}

/* Griglia kit */
.kit-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Card singolo kit */
.kit-card {
    background-color: #1a1a1a;
    border: 1px solid #ff6600;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(255, 102, 0, 0.3);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Titolo kit */
.kit-card h3 {
    color: #ff6600;
    margin-bottom: 10px;
}

/* Dettagli testo */
.kit-card p {
    margin-bottom: 8px;
}

/* Pulsante nella card */
.kit-card .button {
    margin-top: auto;
}
.kit-card .button-group {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-top: 15px;
}

.kit-card .button-group a {
    flex: 1;
}


.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.gallery-item img {
    width: 100%;
    height: auto;
    border-radius: 5px;
    border: 1px solid #ff6600;
    box-shadow: 0 0 8px rgba(255, 102, 0, 0.4);
    transition: transform 0.2s;
}

.gallery-item img:hover {
    transform: scale(1.05);
}
.popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.popup-content {
    background: #262626;
    padding: 30px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 0 20px rgba(255, 102, 0, 0.5);
}

.popup-content h3 {
    color: #ff3300;
    margin-bottom: 10px;
}

.popup-content p {
    margin-bottom: 20px;
}
/* Galleria grande */
.big-gallery img {
    height: 150px;
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.9);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
}

.lightbox img {
    max-width: 90%;
    max-height: 80vh;
    border: 4px solid #ff6600;
    border-radius: 5px;
}

.lightbox .close {
    color: #fff;
    font-size: 30px;
    position: absolute;
    top: 20px;
    right: 30px;
    cursor: pointer;
}

.lightbox-controls {
    margin-top: 10px;
    display: flex;
    gap: 20px;
    font-size: 25px;
    color: #ff6600;
    cursor: pointer;
}
/* Galleria immagini */
.big-gallery img {
    height: 180px;
    object-fit: cover;
    border-radius: 5px;
    cursor: pointer;
    transition: transform 0.2s;
}
.big-gallery img:hover {
    transform: scale(1.05);
}

/* Lightbox migliorata */
.lightbox {
    display: none;
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.95);
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 9999;
    padding: 20px;
}

.lightbox img {
    max-width: 90%;
    max-height: 80vh;
    border: 4px solid #ff6600;
    border-radius: 8px;
    margin-bottom: 20px;
    box-shadow: 0 0 15px rgba(255, 102, 0, 0.5);
}

/* Nuovi controlli visibili */
.lightbox-controls {
    display: flex;
    gap: 20px;
    align-items: center;
}

.lightbox-controls button {
    background: #ff6600;
    color: #1a1a1a;
    font-weight: bold;
    border: none;
    padding: 12px 20px;
    font-size: 18px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.lightbox-controls button:hover {
    background: #e65c00;
}

/* Bottone close */
.lightbox .close-btn {
    position: absolute;
    top: 25px;
    right: 25px;
    background: #ff6600;
    color: #1a1a1a;
    font-weight: bold;
    border: none;
    padding: 10px 15px;
    font-size: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}
.lightbox .close-btn:hover {
    background: #e65c00;
}
/* Container esterno */
.gallery-wrapper {
    max-width: 1200px;
    margin: 30px auto;
    padding: 10px 20px;
}

/* Grid responsive */
.gallery-wide {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
}

/* Singola immagine */
.gallery-wide .gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #ff6600;
    transition: transform 0.2s;
    cursor: pointer;
}

.gallery-wide .gallery-item img:hover {
    transform: scale(1.05);
}



@media (max-width: 768px) {
    body {
        font-size: 18px;
    }

    /* Container principale */
    .login-container, .kit-card, .popup-content {
        width: 95%;
        max-width: 95%;
        padding: 20px;
        margin: 0 auto;
    }

    /* Griglie che diventano singola colonna */
    .kit-grid {
        grid-template-columns: 1fr;
    }

    .gallery-wide {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    /* Immagini nella gallery più grandi */
    .gallery-wide .gallery-item img {
        height: 140px;
    }

    /* Input e pulsanti più tappabili */
    input, select, textarea {
        padding: 16px;
        font-size: 1.1rem;
    }

    .button, button, .secondary {
        padding: 16px;
        font-size: 1.1rem;
    }
}

.kit-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.kit-list-item {
    display: flex;
    justify-content: space-between;
    background: #1a1a1a;
    border: 1px solid #ff6600;
    padding: 15px;
    border-radius: 8px;
    flex-wrap: wrap;
}

.kit-info h4 {
    color: #ff6600;
    margin-bottom: 5px;
}

.kit-info p {
    margin-bottom: 3px;
}

.kit-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

@media (min-width: 768px) {
    .kit-list-item {
        flex-direction: row;
        align-items: center;
    }
    .kit-actions {
        flex-direction: row;
        margin-top: 0;
    }
}



/* 1️⃣ Contenitore generale più largo */
.page-wrapper, .login-container, .home-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 2️⃣ Tabella ampia e distribuita */
.kit-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

/* Spaziature migliorate */
.kit-table th, .kit-table td {
    padding: 18px 25px;
    text-align: left;
}

.kit-table th {
    background: #262626;
    color: #ff6600;
    font-size: 1.1rem;
}

.kit-table td {
    background: #1a1a1a;
    font-size: 1rem;
    border-top: 1px solid #ff6600;
}

/* Distribuzione colonne */
.kit-table tr td:first-child { width: 45%; }
.kit-table tr td:nth-child(2) { width: 30%; }
.kit-table tr td:nth-child(3) { width: 25%; }

/* 3️⃣ Responsive su mobile */
@media (max-width: 768px) {
    .page-wrapper, .login-container, .home-container {
        padding: 10px;
    }

    .kit-table th, .kit-table td {
        padding: 12px;
    }

    .kit-table {
        font-size: 0.9rem;
    }
}
/* Container fisso con scroll */
.table-wrapper {
    max-height: 300px; /* oppure 400px in base alle tue preferenze */
    overflow-y: auto;
    border: 1px solid #ff6600;
    border-radius: 8px;
    background: #1a1a1a;
    padding: 10px;
}

/* Tabella dentro il wrapper */
.kit-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.kit-table th, .kit-table td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #ff6600;
}

.kit-table th {
    background: #262626;
    color: #ff6600;
    position: sticky;
    top: 0;
    z-index: 1;
}
/* Contenitore fisso della tabella */
.table-wrapper {
    max-height: 400px; /* altezza personalizzabile */
    overflow-y: auto;
    margin-bottom: 20px;
    padding: 5px;
    border: 1px solid #ff6600;
    border-radius: 8px;
    background: #1a1a1a;
}

/* La tabella rimane normale */
.kit-table {
    width: 100%;
    border-collapse: collapse;
}

/* Header sticky */
.kit-table th {
    position: sticky;
    top: 0;
    background: #262626;
    color: #ff6600;
}
.kit-table td.actions {
    display: flex;
    gap: 8px;
}

.kit-table td.actions a {
    flex: 1;
    text-align: center;
}