/* Stili generali del corpo e dei font */
body {
    font-family: 'Inter', sans-serif;
    background-color: #f0f2f5;
}

/* Layout principale a colonne */
.container-layout {
    display: flex;
    min-height: 100vh;
}

/* Stili della barra laterale (Sidebar) */
.sidebar {
    width: 280px;
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 2rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
}

.sidebar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.sidebar-brand img {
    max-height: 80px;
}

.sidebar-menu a,
.sidebar-menu button {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    border-radius: 0.5rem;
    transition: background-color 0.2s;
    cursor: pointer;
    text-align: left;
}

.sidebar-menu a:hover,
.sidebar-menu button:hover {
    background-color: #34495e;
}

.sidebar-menu a.active {
    background-color: #98070B;
    color: white;
}

/* Stili del contenuto principale */
.main-content {
    flex-grow: 1;
    padding: 2rem;
    margin-left: 280px;
}

.content-card {
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    padding: 2rem;
    margin-bottom: 2rem;
}

/* Stili per elementi del form */
input,
button,
select {
    border-radius: 0.5rem;
    transition: all 0.2s;
}

button {
    transition: background-color 0.3s ease, transform 0.1s ease;
}

button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* Stili per l'etichetta stampabile */
#printable-label {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 100;
    justify-content: center;
    align-items: center;
}

.label-content {
    width: 62mm;
    height: 30mm;
    background: white;
    padding: 2mm;
    box-sizing: border-box;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #ccc;
}

/* Stili specifici per la stampa */
@media print {
    body>*:not(#printable-label) {
        display: none !important;
    }

    #printable-label {
        display: flex !important;
        position: static !important;
        width: auto;
        height: auto;
        background-color: transparent;
        margin: 0;
        padding: 0;
    }

    .label-content {
        border: none;
        box-shadow: none;
        width: 62mm !important;
        height: 30mm !important;
        page-break-inside: avoid;
    }
}

@page {
    size: 62mm 30mm;
    margin: 0;
}

/* Stili per le finestre modali */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fefefe;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    width: 80%;
    max-width: 500px;
    text-align: center;
}

.close-button {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
}

.close-button:hover,
.close-button:focus {
    color: black;
    text-decoration: none;
    cursor: pointer;
}

/* Adattamenti per dispositivi mobili (responsive) */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        padding: 1rem;
        flex-direction: row;
        justify-content: space-around;
        align-items: center;
        position: static;
    }

    .sidebar-brand {
        display: none;
    }

    .sidebar-menu {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .sidebar-menu a,
    .sidebar-menu button {
        padding: 0.5rem 0.75rem;
        font-size: 0.875rem;
        white-space: nowrap;
    }

    .main-content {
        padding: 1rem;
        margin-left: 0;
    }

    .container-layout {
        flex-direction: column;
    }
}

/* Stili per la tabella dei partecipanti */
tr.selected {
    background-color: #e0f2fe;
}

.delete-btn {
    background-color: #dc2626;
    color: white;
}

.delete-btn:hover {
    background-color: #b91c1c;
}

/* Stili per la galleria di revisione foto */
#photo-review-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
}

.photo-thumbnail {
    cursor: pointer;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.photo-thumbnail:hover {
    transform: scale(1.05);
}

.photo-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#photo-modal .modal-content {
    max-width: 90vw;
    max-height: 90vh;
}

#photo-modal img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 0.5rem;
}

/* Assicura che il modale di conferma sia sopra quello della foto */
#photo-confirm-modal {
    z-index: 1050;
}

.hidden {
    display: none !important;
}

.login-container {
    max-width: 400px;
    margin: auto;
    /* Centra il contenitore di login */
    padding: 2rem;
    background-color: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
}
.sidebar-logo {
            font-size: 1.875rem; /* text-3xl */
            font-weight: 700; /* font-bold */
            margin-bottom: 2rem;
            text-align: center;
            color: #63b3ed; /* Blu chiaro per il logo */
        }
        .sidebar-nav a {
            display: flex;
            align-items: center;
            padding: 0.75rem 1rem;
            margin-bottom: 0.5rem;
            border-radius: 0.5rem;
            color: #cbd5e0; /* Grigio chiaro per il testo */
            transition: background-color 0.2s ease, color 0.2s ease;
        }
        .sidebar-nav a:hover, .sidebar-nav a.active {
            background-color: #4a5568; /* Grigio più chiaro al hover/attivo */
            color: white;
        }
        .sidebar-nav svg {
            margin-right: 0.75rem;
            width: 1.25rem;
            height: 1.25rem;
        }
        .main-content {
            flex-grow: 1;
            padding: 2rem;
            background-color: #f4f7f6;
            overflow-y: auto; /* Permette lo scrolling nel contenuto principale */
        }
        .card {
            background-color: #ffffff;
            border-radius: 0.75rem;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
            padding: 1.5rem;
            margin-bottom: 1.5rem;
        }
        .form-group label {
            display: block;
            margin-bottom: 0.5rem;
            font-weight: 600;
            color: #4a5568;
        }
        .form-group input, .form-group select {
            width: 100%;
            padding: 0.75rem;
            border: 1px solid #e2e8f0;
            background-color: #edf2f7;
            color: #2d3748;
        }
        .form-group input[type="date"],
        .form-group input[type="time"] {
            appearance: none; /* Rimuove lo stile predefinito del browser */
        }
        .category-input-group {
            display: flex;
            gap: 0.5rem;
            margin-bottom: 0.5rem;
        }
        .category-input-group input {
            flex-grow: 1;
        }
        .events-table, .jurors-table {
            width: 100%;
            border-collapse: collapse;
            margin-top: 1rem;
        }
        .events-table th, .events-table td,
        .jurors-table th, .jurors-table td {
            border: 1px solid #e0e0e0;
            padding: 0.75rem;
            text-align: left;
            font-size: 0.875rem;
        }
        .events-table th, .jurors-table th {
            background-color: #f8f8f8;
            font-weight: 600;
            color: #555;
        }
        .events-table tr:nth-child(even), .jurors-table tr:nth-child(even) {
            background-color: #f9f9f9;
        }
        .events-table tr:hover, .jurors-table tr:hover {
            background-color: #f0f0f0;
        }
        .events-table .action-buttons button, .jurors-table .action-buttons button {
            padding: 0.4rem 0.8rem;
            font-size: 0.75rem;
            border-radius: 0.375rem;
        }

        /* Stili per il modal di modifica e conferma */
        .modal-overlay {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.6);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 1000;
        }
        .modal-content {
            background-color: #fff;
            padding: 2rem;
            border-radius: 1rem;
            max-width: 500px;
            width: 90%;
            box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
            position: relative;
        }
        .modal-close-btn {
            position: absolute;
            top: 1rem;
            right: 1rem;
            background: none;
            border: none;
            font-size: 1.5rem;
            cursor: pointer;
            color: #333;
        }
        .token-display-box {
            background-color: #e2e8f0;
            padding: 1rem;
            border-radius: 0.5rem;
            font-family: monospace;
            word-break: break-all;
            position: relative;
        }
        .token-display-box button {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            padding: 0.3rem 0.6rem;
            background-color: #3b82f6;
            color: white;
            border: none;
            border-radius: 0.3rem;
            font-size: 0.75rem;
            cursor: pointer;
        }
