/* Stili specifici per l'area amministrativa */

/* Schermata di Login */
.login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.login-container {
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
    animation: fadeInUp 0.6s ease-out;
}

.login-header h1 {
    font-family: 'Playfair Display', serif;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-header p {
    color: #666;
    margin-bottom: 30px;
    font-size: 1em;
}

.login-form {
    margin-bottom: 20px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: #2c3e50;
    font-weight: 600;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 10px;
    font-size: 1em;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.login-btn {
    width: 100%;
    padding: 12px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
}

.login-error {
    background: #fee;
    color: #c53030;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    border: 1px solid #fed7d7;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9em;
}

.back-to-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #666;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.3s ease;
}

.back-to-form:hover {
    color: #667eea;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background: #f8f9fa;
    min-height: 100vh;
    padding-bottom: 50px;
}

/* Header Amministrativo */
.admin-header {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left {
    flex: 1;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.admin-header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 2.2em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-header p {
    margin: 10px 0 0 0;
    opacity: 0.9;
    font-size: 1.1em;
}

.logout-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(231, 76, 60, 1);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(231, 76, 60, 0.3);
}

.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Sezioni principali */
.admin-main {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
    overflow: visible;
}

.stats-section,
.charts-section,
.actions-section,
.details-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

.stats-section h2,
.charts-section h2,
.actions-section h2,
.details-section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.8em;
    margin-bottom: 25px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Griglia delle statistiche */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(30px, -30px);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.3);
}

.stat-card.adults {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.stat-card.children {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
}

.stat-card.total {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.stat-icon {
    font-size: 2.5em;
    opacity: 0.9;
    z-index: 1;
}

.stat-content h3 {
    font-size: 2.5em;
    font-weight: 700;
    margin: 0;
    z-index: 1;
}

.stat-content p {
    margin: 5px 0 0 0;
    opacity: 0.9;
    font-weight: 600;
    z-index: 1;
}

/* Sezione grafici */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
}

.chart-card {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.chart-card h3 {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #495057;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-container {
    position: relative;
    height: 300px;
    margin-bottom: 20px;
}

.chart-legend {
    display: flex;
    justify-content: center;
    gap: 30px;
    flex-wrap: wrap;
}

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

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 3px;
}

.legend-color.yes {
    background: #28a745;
}

.legend-color.no {
    background: #dc3545;
}

/* Sezione azioni */
.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 25px 20px;
    border: none;
    border-radius: 12px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    color: white;
}

.action-btn i {
    font-size: 2em;
}

.action-btn.export {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.action-btn.refresh {
    background: linear-gradient(135deg, #007bff 0%, #6610f2 100%);
}

.action-btn.clear {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.action-btn.print {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
}

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

/* Tabella */
.table-container {
    overflow-x: auto;
    overflow-y: visible;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    width: 100%;
    box-sizing: border-box;
}

.rsvp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.rsvp-table th {
    background: #f8f9fa;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
}

.rsvp-table td {
    padding: 12px;
    border-bottom: 1px solid #e9ecef;
    vertical-align: middle;
}

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

.participation-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
}

.participation-badge.yes {
    background: #d4edda;
    color: #155724;
}

.participation-badge.no {
    background: #f8d7da;
    color: #721c24;
}

.notes-preview {
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    color: #007bff;
}

.notes-preview:hover {
    text-decoration: underline;
}

.table-actions {
    display: flex;
    gap: 8px;
}

.btn-small {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.8em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-view {
    background: #007bff;
    color: white;
}

.btn-delete {
    background: #dc3545;
    color: white;
}

.btn-small:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* Messaggio nessun dato */
.no-data {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.no-data i {
    font-size: 4em;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-data p {
    font-size: 1.2em;
    margin: 0;
}

/* Modal specifici per admin */
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5em;
    cursor: pointer;
    color: #6c757d;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.btn-cancel,
.btn-confirm {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel {
    background: #6c757d;
    color: white;
}

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

.btn-cancel:hover,
.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* Responsive design per admin */
@media (max-width: 768px) {
    .admin-container {
        padding: 15px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .admin-header h1 {
        font-size: 1.8em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .actions-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .rsvp-table {
        font-size: 0.85em;
    }
    
    .rsvp-table th,
    .rsvp-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .actions-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .stats-section,
    .charts-section,
    .actions-section,
    .details-section {
        padding: 20px;
    }
}

/* Animazioni */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-section,
.charts-section,
.actions-section,
.details-section {
    animation: fadeInUp 0.6s ease forwards;
}

.stat-card {
    animation: fadeInUp 0.6s ease forwards;
}

.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* Stili per la stampa */
@media print {
    .admin-header,
    .actions-section,
    .back-btn {
        display: none;
    }
    
    .admin-container {
        max-width: none;
        padding: 0;
        background: white;
    }
    
    .stats-section,
    .details-section {
        box-shadow: none;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    .rsvp-table {
        font-size: 0.8em;
    }
    
    .stat-card {
        background: #f8f9fa !important;
        color: #333 !important;
        border: 1px solid #ddd;
    }
}