/* Dashboard Asilo - CSS Styles (Stile Asilo) */

/* Reset e Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Quicksand', sans-serif; /* Font più giocoso */
    line-height: 1.6;
    color: #4a4a4a;
    background-color: #f0f8ff; /* Azzurro chiaro */
}

/* Layout Admin */
.admin-layout {
    display: grid;
    grid-template-columns: 280px 1fr; /* Sidebar leggermente più larga */
    grid-template-rows: 80px 1fr; /* Header più alto */
    grid-template-areas: 
        "header header"
        "sidebar main";
    min-height: 100vh;
}

/* Header */
.admin-header {
    grid-area: header;
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa07a 100%); /* Colori caldi e vivaci */
    color: white;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 100;
    display: flex;
    align-items: center;
    padding: 0 2rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.logo {
    display: flex;
    align-items: center;
    font-size: 1.8rem; /* Logo più grande */
    font-weight: 700;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.2);
}

.logo i {
    margin-right: 0.75rem;
    font-size: 2.2rem; /* Icona più grande */
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 1.1rem;
}

.user-info span {
    font-weight: 500;
}

/* Sidebar */
.admin-sidebar {
    grid-area: sidebar;
    background: #ffffff;
    border-right: 1px solid #e0e0e0;
    box-shadow: 4px 0 15px rgba(0,0,0,0.08);
    padding-top: 1.5rem;
}

.sidebar-nav {
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.8rem; /* Padding aumentato */
    color: #6c757d;
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 5px solid transparent; /* Bordo più spesso */
    font-size: 1.1rem;
    font-weight: 500;
}

.nav-item:hover {
    background-color: #ffe0b2; /* Arancione chiaro */
    color: #ff6b6b; /* Rosso vivace */
    border-left-color: #ff6b6b;
}

.nav-item.active {
    background-color: #fff3e0; /* Arancione molto chiaro */
    color: #ff6b6b;
    border-left-color: #ff6b6b;
    font-weight: 700;
}

.nav-item i {
    margin-right: 1rem;
    width: 25px; /* Icone più grandi */
    text-align: center;
    font-size: 1.3rem;
}

/* Main Content */
.main-content {
    grid-area: main;
    padding: 2.5rem; /* Padding aumentato */
    overflow-y: auto;
    background-color: #f0f8ff;
}

.dashboard-header {
    margin-bottom: 2.5rem;
    background-color: #ffffff;
    padding: 1.5rem 2rem;
    border-radius: 15px; /* Bordi arrotondati */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

.dashboard-header h1 {
    font-size: 2.5rem; /* Titolo più grande */
    font-weight: 700;
    color: #343a40;
    margin-bottom: 0.75rem;
}

.dashboard-header p {
    color: #6c757d;
    font-size: 1.2rem;
}

/* Cards */
.card {
    background: white;
    border-radius: 15px; /* Bordi arrotondati */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    padding: 2rem; /* Padding aumentato */
    margin-bottom: 2rem;
}

.card h2 {
    font-size: 1.8rem; /* Titolo card più grande */
    font-weight: 700;
    color: #343a40;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 1rem;
}

/* Statistics Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Card più grandi */
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: linear-gradient(135deg, #a7d9ff 0%, #cceeff 100%); /* Sfondo sfumato */
    border-radius: 15px; /* Bordi arrotondati */
    padding: 2rem; /* Padding aumentato */
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #343a40;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.stat-icon {
    width: 70px; /* Icona più grande */
    height: 70px;
    border-radius: 50%; /* Cerchio */
    background: #ff6b6b; /* Colore icona */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 1.5rem;
    font-size: 2rem; /* Dimensione icona */
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.stat-content h3 {
    font-size: 2.8rem; /* Numero più grande */
    font-weight: 700;
    color: #343a40;
    margin-bottom: 0.5rem;
}

.stat-content p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* Forms */
.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 1rem; /* Padding aumentato */
    border: 2px solid #e0e0e0; /* Bordo più spesso */
    border-radius: 10px; /* Bordi arrotondati */
    font-size: 1.1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background-color: #fdfdfd;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #6a5acd; /* Viola */
    box-shadow: 0 0 0 4px rgba(106, 90, 205, 0.2);
}

.form-text {
    font-size: 0.95rem;
    color: #888;
    margin-top: 0.5rem;
}

.form-actions {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 1.5rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 1rem 2rem; /* Padding aumentato */
    border: none;
    border-radius: 10px; /* Bordi arrotondati */
    font-size: 1.1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 0.75rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.btn-primary {
    background: linear-gradient(135deg, #6a5acd 0%, #8a2be2 100%); /* Viola */
    color: white;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 15px rgba(106, 90, 205, 0.3);
}

.btn-outline {
    background: transparent;
    color: white;
    border: 2px solid rgba(255,255,255,0.5);
}

.btn-outline:hover {
    background: rgba(255,255,255,0.2);
    border-color: white;
}

.btn-sm {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    border-radius: 8px;
}

.btn-info {
    background: linear-gradient(135deg, #20c997 0%, #17a2b8 100%); /* Verde acqua */
    color: white;
}

.btn-info:hover {
    background: linear-gradient(135deg, #17a2b8 0%, #20c997 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%); /* Rosso-arancio */
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #fd7e14 0%, #dc3545 100%);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%); /* Verde */
    color: white;
}

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

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #ffcd39 100%); /* Giallo */
    color: #343a40;
}

.btn-warning:hover {
    background: linear-gradient(135deg, #ffcd39 0%, #ffc107 100%);
}

/* Tables */
.table-container {
    overflow-x: auto;
    border-radius: 15px; /* Bordi arrotondati */
    border: 1px solid #e0e0e0;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.data-table th {
    background: #f8f8f8;
    padding: 1.2rem; /* Padding aumentato */
    text-align: left;
    font-weight: 700;
    color: #4a4a4a;
    border-bottom: 2px solid #e0e0e0;
    font-size: 1.1rem;
}

.data-table td {
    padding: 1.2rem; /* Padding aumentato */
    border-bottom: 1px solid #f0f0f0;
    color: #555;
}

.data-table tr:hover {
    background: #fcfcfc;
}

.actions {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 1rem; /* Padding aumentato */
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: capitalize;
}

.badge-admin {
    background: #ffe0b2; /* Arancione chiaro */
    color: #ff6b6b;
}

.badge-genitore {
    background: #d1fae5; /* Verde chiaro */
    color: #28a745;
}

.badge-success {
    background: #d1fae5;
    color: #28a745;
}

.badge-danger {
    background: #fee2e2;
    color: #dc3545;
}

.badge-info {
    background: #e0f7fa;
    color: #17a2b8;
}

.badge-certificato {
    background: #fff3e0;
    color: #fd7e14;
}

.badge-autorizzazione {
    background: #e6e6fa; /* Lavanda */
    color: #6a5acd;
}

.badge-medico {
    background: #ffebee; /* Rosso pastello */
    color: #dc3545;
}

.badge-altro {
    background: #f0f0f0;
    color: #6c757d;
}

/* Alerts */
.alert {
    padding: 1.2rem; /* Padding aumentato */
    border-radius: 10px; /* Bordi arrotondati */
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.1rem;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #28a745;
    border: 1px solid #a7f3d0;
}

.alert-error {
    background: #fee2e2;
    color: #dc3545;
    border: 1px solid #fca5a5;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6); /* Sfondo più scuro */
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: white;
    padding: 2.5rem; /* Padding aumentato */
    border-radius: 20px; /* Bordi molto arrotondati */
    width: 90%;
    max-width: 700px; /* Larghezza massima aumentata */
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.close-button {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    font-size: 2.5rem; /* Icona più grande */
    cursor: pointer;
    color: #999;
}

.close-button:hover {
    color: #555;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem; /* Padding aumentato */
    color: #888;
    background-color: #fdfdfd;
    border-radius: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

.empty-state i {
    font-size: 4rem; /* Icona più grande */
    margin-bottom: 1.5rem;
    color: #ccc;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.75rem;
    color: #555;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #8a2be2 0%, #ff6b6b 100%); /* Sfumatura vivace */
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-container {
    width: 100%;
    max-width: 450px; /* Larghezza aumentata */
    padding: 2.5rem; /* Padding aumentato */
}

.login-form {
    background: white;
    padding: 3rem; /* Padding aumentato */
    border-radius: 20px; /* Bordi molto arrotondati */
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.login-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.login-header i {
    font-size: 4rem; /* Icona più grande */
    color: #6a5acd; /* Viola */
    margin-bottom: 1rem;
}

.login-header h2 {
    color: #343a40;
    font-size: 2rem; /* Titolo più grande */
    font-weight: 700;
}

.login-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #e0e0e0;
    text-align: center;
    font-size: 0.95rem;
    color: #888;
}

/* Parent Layout */
.parent-layout {
    min-height: 100vh;
    background: #f0f8ff;
}

.parent-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa07a 100%);
    color: white;
    padding: 1.5rem 2.5rem; /* Padding aumentato */
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.parent-nav {
    background: #ffffff;
    padding: 1rem 2.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    gap: 2.5rem; /* Spazio aumentato */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.parent-nav .nav-item {
    padding: 0.75rem 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: #6c757d;
    border-bottom: 3px solid transparent;
}

.parent-nav .nav-item:hover {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
    background-color: transparent; /* Rimuovi sfondo hover */
}

.parent-nav .nav-item.active {
    color: #ff6b6b;
    border-bottom-color: #ff6b6b;
    background-color: transparent;
}

.parent-main {
    padding: 2.5rem;
}

/* Children Grid */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); /* Card più grandi */
    gap: 2rem;
    margin-bottom: 2.5rem;
}

.child-card {
    background: linear-gradient(135deg, #fffacd 0%, #ffe0b2 100%); /* Sfondo giallo pastello */
    border-radius: 20px; /* Bordi molto arrotondati */
    padding: 2rem; /* Padding aumentato */
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    color: #4a4a4a;
}

.child-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 25px rgba(0,0,0,0.2);
}

.child-avatar {
    width: 80px; /* Avatar più grande */
    height: 80px;
    border-radius: 50%;
    background: #6a5acd; /* Viola */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem; /* Icona più grande */
    margin-bottom: 1.5rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.child-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #343a40;
    margin-bottom: 0.75rem;
}

.child-info p {
    color: #6c757d;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1rem;
}

.child-info p i {
    color: #ff6b6b; /* Icone rosse */
}

.child-actions {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #f0f0f0;
    text-align: center;
}

/* Utility Classes */
.mt-4 {
    margin-top: 2rem;
}

.mb-4 {
    margin-bottom: 2rem;
}

/* Responsive */
@media (max-width: 992px) {
    .admin-layout {
        grid-template-columns: 1fr;
        grid-template-rows: 80px auto 1fr;
        grid-template-areas: 
            "header"
            "sidebar"
            "main";
    }
    
    .admin-sidebar {
        display: block; /* Mostra sidebar su schermi medi */
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05);
        padding-top: 0;
    }

    .sidebar-nav {
        display: flex;
        overflow-x: auto;
        padding: 0.5rem 1rem;
        justify-content: flex-start; /* Allinea a sinistra */
        white-space: nowrap; /* Evita il wrap */
    }

    .nav-item {
        flex-shrink: 0;
        padding: 0.75rem 1rem;
        border-left: none;
        border-bottom: 3px solid transparent;
    }

    .nav-item.active {
        border-left-color: transparent;
        border-bottom-color: #ff6b6b;
    }

    .nav-item i {
        margin-right: 0.5rem;
    }

    .main-content, .parent-main {
        padding: 1.5rem;
    }

    .dashboard-header, .card {
        padding: 1.5rem;
    }

    .stats-grid, .form-grid, .children-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }

    .stat-card, .child-card {
        padding: 1.5rem;
    }

    .stat-icon, .child-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
    }

    .stat-content h3 {
        font-size: 2.2rem;
    }

    .stat-content p {
        font-size: 1rem;
    }

    .data-table th, .data-table td {
        padding: 0.8rem;
        font-size: 0.95rem;
    }

    .btn {
        padding: 0.8rem 1.5rem;
        font-size: 1rem;
    }

    .alert {
        padding: 1rem;
        font-size: 1rem;
    }

    .modal-content {
        padding: 2rem;
    }

    .login-form {
        padding: 2.5rem;
    }
}

@media (max-width: 768px) {
    .admin-header, .parent-header {
        padding: 1rem 1.5rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .logo i {
        font-size: 1.8rem;
    }

    .user-info {
        font-size: 1rem;
        gap: 1rem;
    }

    .user-info .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .parent-nav {
        padding: 0.8rem 1.5rem;
        gap: 1.5rem;
    }

    .parent-nav .nav-item {
        font-size: 1rem;
    }

    .parent-main {
        padding: 1.5rem;
    }

    .dashboard-header h1 {
        font-size: 2rem;
    }

    .dashboard-header p {
        font-size: 1.1rem;
    }

    .card h2 {
        font-size: 1.6rem;
    }

    .stat-content h3 {
        font-size: 2rem;
    }

    .stat-content p {
        font-size: 0.9rem;
    }

    .form-group label {
        font-size: 1rem;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        padding: 0.8rem;
        font-size: 1rem;
    }

    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
    }

    .empty-state {
        padding: 3rem;
    }

    .empty-state i {
        font-size: 3rem;
    }

    .empty-state h3 {
        font-size: 1.3rem;
    }

    .empty-state p {
        font-size: 1rem;
    }

    .login-form {
        padding: 2rem;
    }

    .login-header i {
        font-size: 3rem;
    }

    .login-header h2 {
        font-size: 1.8rem;
    }
}

/* Checkbox Custom */
.checkbox-group {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-top: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
    color: #555;
}

.checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    height: 20px;
    width: 20px;
    background-color: #eee;
    border-radius: 5px;
    margin-right: 0.5rem;
    border: 2px solid #ccc;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark {
    background-color: #6a5acd;
    border-color: #6a5acd;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-label input[type="checkbox"]:checked ~ .checkmark:after {
    display: block;
}

.checkbox-label .checkmark:after {
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 3px 3px 0;
    transform: rotate(45deg);
}

/* Badges for Merenda/Pranzo */
.badge-completo {
    background-color: #d4edda; /* Light green */
    color: #155724;
}

.badge-parziale {
    background-color: #fff3cd; /* Light yellow */
    color: #856404;
}

.badge-niente {
    background-color: #f8d7da; /* Light red */
    color: #721c24;
}

/* Diary Details Modal */
.diary-details {
    padding: 1rem;
}

.diary-info h3 {
    font-size: 1.6rem;
    color: #343a40;
    margin-bottom: 0.5rem;
}

.diary-info p {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 1rem;
}

.diary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.diary-item {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.diary-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a4a4a;
}

.diary-section {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    margin-top: 1.5rem;
}

.diary-section strong {
    display: block;
    margin-bottom: 0.5rem;
    color: #4a4a4a;
}

.diary-section p {
    white-space: pre-wrap; /* Mantiene la formattazione del testo */
    word-wrap: break-word;
    color: #555;
}

/* Sidebar Footer */
.sidebar-footer {
    margin-top: auto; /* Spinge il footer in basso */
    padding: 1.5rem;
    border-top: 1px solid #e0e0e0;
    text-align: center;
}

.sidebar-footer .btn {
    width: 100%;
    justify-content: center;
}

/* Navbar (Admin) */
.navbar {
    background-color: #ffffff;
    padding: 1rem 2.5rem;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 2rem; /* Spazio sotto la navbar */
}

.navbar-left h2 {
    font-size: 1.8rem;
    color: #343a40;
}

.navbar-right span {
    font-size: 1.1rem;
    color: #6c757d;
    font-weight: 500;
}

/* Container per il contenuto principale */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Fix per il layout */
.admin-layout {
    display: flex;
}

.admin-sidebar {
    flex-shrink: 0;
}

.main-content {
    flex-grow: 1;
}

@media (max-width: 992px) {
    .admin-layout {
        flex-direction: column;
    }

    .admin-sidebar {
        width: 100%;
        order: 2; /* Sposta la sidebar sotto il main content su mobile */
    }

    .main-content {
        order: 1;
    }

    .navbar {
        margin-bottom: 1rem;
    }
}



