/* Sistema Presenze Venerdì - Stili */

.presenze-venerdi-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.presenze-venerdi-app {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 1200px;
    margin: 0 auto;
}

.presenze-header {
    text-align: center;
    margin-bottom: 30px;
}

.presenze-header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.presenze-header p {
    color: #666;
    font-size: 16px;
}

/* Pagina di selezione utenti */
.presenze-users-page {
    min-height: 400px;
}

.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 30px;
}

.user-button {
    display: block;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
}

.user-button:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
    color: white;
}

/* Barra superiore */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.back-link {
    display: inline-block;
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
}

.back-link:hover {
    text-decoration: underline;
}

.logout-btn {
    padding: 10px 20px;
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.logout-btn:hover {
    background: #c0392b;
}

/* Statistiche */
.stats {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-around;
    flex-wrap: wrap;
    gap: 15px;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

.stat-label {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Righe delle date */
.date-row {
    display: flex;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #eee;
    gap: 20px;
    flex-wrap: wrap;
}

.date-row:hover {
    background-color: #f8f9fa;
}

.date-label {
    font-weight: bold;
    min-width: 200px;
    color: #333;
}

.options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    flex: 1;
}

.option {
    display: flex;
    align-items: center;
    gap: 5px;
}

.option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.option label {
    cursor: pointer;
    user-select: none;
}

/* Modal password */
.password-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

.password-modal.active {
    display: flex;
}

.password-box {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 400px;
    width: 90%;
}

.password-box h2 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.password-box input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    margin-bottom: 15px;
}

.password-box input:focus {
    outline: none;
    border-color: #667eea;
}

.password-buttons {
    display: flex;
    gap: 10px;
}

.password-box button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-confirm {
    background: #667eea;
    color: white;
}

.btn-confirm:hover {
    background: #5568d3;
}

.btn-cancel {
    background: #ddd;
    color: #333;
}

.btn-cancel:hover {
    background: #ccc;
}

.error-message {
    color: #e74c3c;
    text-align: center;
    margin-top: 10px;
    display: none;
}

/* Messaggi di notifica */
.save-message,
.error-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    display: none;
    animation: slideIn 0.3s;
    z-index: 999999;
}

.save-message {
    background: #4CAF50;
    color: white;
}

.error-notification {
    background: #e74c3c;
    color: white;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
    }
    to {
        transform: translateX(0);
    }
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .presenze-venerdi-app {
        padding: 20px;
    }
    
    .date-row {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .date-label {
        min-width: 100%;
        margin-bottom: 10px;
    }
    
    .users-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .stats {
        flex-direction: column;
    }
}

/* Nasconde le pagine */
.presenze-page {
    display: none;
}

.presenze-page.active {
    display: block;
}

/* Pagina Riepilogo */
.riepilogo-btn {
    display: block;
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #2ecc71 0%, #27ae60 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.riepilogo-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.riepilogo-table-container {
    overflow-x: auto;
    margin-top: 20px;
}

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

.riepilogo-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.riepilogo-table th {
    padding: 15px 10px;
    text-align: left;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.riepilogo-table th:first-child {
    position: sticky;
    left: 0;
    z-index: 11;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.riepilogo-table td {
    padding: 12px 10px;
    border-bottom: 1px solid #eee;
    text-align: center;
}

.riepilogo-table td:first-child {
    text-align: left;
    font-weight: bold;
    background: #f8f9fa;
    position: sticky;
    left: 0;
    z-index: 5;
}

.riepilogo-table tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    white-space: nowrap;
}

.status-presente {
    background: #d4edda;
    color: #155724;
}

.status-assente {
    background: #f8d7da;
    color: #721c24;
}

.status-via-prima {
    background: #fff3cd;
    color: #856404;
}

.status-ritardo {
    background: #d1ecf1;
    color: #0c5460;
}

.status-empty {
    color: #999;
    font-style: italic;
}

.filter-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.filter-bar label {
    font-weight: bold;
    color: #333;
}

.filter-bar select {
    padding: 8px 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
}

.filter-bar select:focus {
    outline: none;
    border-color: #667eea;
}

.export-btn {
    margin-left: auto;
    padding: 8px 20px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.export-btn:hover {
    background: #2980b9;
}

.legend {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.legend-badge {
    width: 50px;
    height: 20px;
    border-radius: 10px;
}

/* Responsive riepilogo */
@media (max-width: 768px) {
    .riepilogo-table {
        font-size: 12px;
    }
    
    .riepilogo-table th,
    .riepilogo-table td {
        padding: 8px 5px;
    }
    
    .status-badge {
        font-size: 10px;
        padding: 3px 8px;
    }
    
    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .export-btn {
        margin-left: 0;
        width: 100%;
    }
}
