/*
Theme Name: Baby Diario Scuola
Theme URI: https://gaiaideaweb.it
Author: GaiaIdeaWeb
Author URI: https://gaiaideaweb.it
Description: Tema personalizzato per Baby Diario Scuola, il diario scolastico digitale by GaiaIdeaWeb.
Version: 1.0
License: GPL-2.0+
Text Domain: baby-diario-scuola
*/

/* ============================================================================
   TABLE OF CONTENTS
   ============================================================================
   1. Reset & Base
   2. Header & Footer
   3. Content Area
   4. Lista Report (page-miei-report.php)
   5. Single Report (single.php)
   6. Dati Bambino Tabella
   7. Commenti
   8. Paginazione
   9. Messaggi di Accesso Negato
   10. Stili ACF Frontend
   11. Responsive Design
   ============================================================================ */


/* ============================================================================
   1. RESET & BASE
   ============================================================================ */

*, *::before, *::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
}

/* Layout globale per sticky footer */
html, body {
    height: 100%;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #005a87;
}

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}



/* ============================================================================
2. HEADER: logo a sinistra, menu a destra
============================================================================= */

/* Top Menu Fix Cross-Browser */
.site-header {
    background-color: #0073aa !important; /* forza il colore */
    padding: 15px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    width: 100%;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    box-sizing: border-box;
    flex-wrap: wrap; /* evita che Firefox impili tutto */
}

.site-branding {
    flex: 0 0 auto;

    display: flex;
    align-items: center;
    gap: 15px;
}

.site-logo img {
    max-height: 60px;
    width: auto;
    display: block;
}

.site-title {
    margin: 0;
}

.site-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
}

.site-title a {
    color: #fff !important;
    text-decoration: none !important;
}


.site-description {
    margin: 0;
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    line-height: 1.2;
}

.header-navigation {
    flex: 1 1 auto !important;
}

.header-nav-list {
    display: flex !important;
    flex-direction: row !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
    list-style: none !important;
    gap: 25px;
}

.header-nav-list li {
    margin: 0 !important;
    padding: 0 !important;
}

.header-nav-list a {
    color: #fff !important;
    text-decoration: none !important;
    font-size: 16px !important;
    white-space: nowrap !important;
    transition: color 0.3s;
}

.header-nav-list a:hover {
    color: #ffd966 !important;
}

/* Mobile: menu verticale centrato */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center;
    }

    .header-nav-list {
        flex-direction: column !important;
        gap: 10px !important;
        justify-content: center !important;
    }

    .site-title {
        font-size: 22px !important;
    }
}


/* ============================================================================
   3. CONTENT AREA
   ============================================================================ */

.content-area {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    flex: 1; /* fondamentale per spingere il footer */
}
.site-main h1 {
    font-size: 28px;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

.entry-header {
    padding: 0;
}

.entry-content {
    padding: 0;
}

.entry-content h2 {
    margin-top: 30px;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}


/* ============================================================================
   3.1 LAYOUT GLOBALE (STICKY FOOTER)
   ============================================================================ */

/* ============================================================================
   FOOTER ANIMATO
   ============================================================================ */

.site-footer {
    background-color: #0073aa; /* blu dell'header */
    color: #ffffff;
    text-align: center;
    padding: 20px 0;
    width: 100%;
    margin-top: auto;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.2); /* leggera profondità interna */
    
    /* Animazione fade-in */
    opacity: 0;
    transform: translateY(20px);
    animation: footerFadeIn 0.8s ease-out forwards;
}

/* Link footer */
.site-footer a {
    color: #ffffff;
    text-decoration: underline;
}

.site-footer a:hover {
    color: #ffd966;
}

/* Keyframes animazione */
@keyframes footerFadeIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* ============================================================================
   3.2 LOGIN PAGE
   ============================================================================ */

.login-box {
    max-width: 450px;
    margin: 50px auto;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.login-box h1 {
    text-align: center;
    margin-bottom: 25px;
    color: #0073aa;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form input[type="text"],
.login-form input[type="password"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 15px;
}

.login-form input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0,115,170,0.5);
    outline: none;
}

.login-submit {
    width: 100%;
    padding: 10px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.login-submit:hover {
    background: #005a87;
}

/* Messaggi login */
.login-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.login-logout {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

/* Link password dimenticata */
.lost-password a {
    color: #0073aa;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.lost-password a:hover {
    color: #005a87;
}

/* Media query: mobile */
@media screen and (max-width: 768px) {
    .login-box {
        margin: 30px 10px;
        padding: 25px;
    }

    .login-box h1 {
        font-size: 22px;
    }

    .login-form input[type="text"],
    .login-form input[type="password"] {
        font-size: 16px;
        padding: 10px;
    }

    .login-submit {
        padding: 12px;
    }
}

@media screen and (max-width: 480px) {
    .login-box {
        margin: 20px 5px;
        padding: 20px;
    }

    .login-box h1 {
        font-size: 20px;
    }

    .login-form input[type="text"],
    .login-form input[type="password"] {
        font-size: 16px;
        padding: 8px;
    }

    .login-submit {
        padding: 10px;
    }
}
/* ============================================================================
   4. LISTA REPORT (page-miei-report.php)
   ============================================================================ */

.report-info {
    background: #e9f7fe;
    border-left: 4px solid #0073aa;
    padding: 15px;
    margin-bottom: 25px;
    border-radius: 4px;
}

.report-info p {
    margin: 0;
    color: #333;
    font-size: 14px;
}

.report-info strong {
    color: #0073aa;
}

.lista-report {
    list-style: none;
    margin: 0;
    padding: 0;
}

.lista-report li {
    margin-bottom: 15px;
    padding: 15px;
    border-left: 3px solid #0073aa;
    background: #f8f9fa;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.lista-report li:hover {
    background: #e9ecef;
}

.lista-report a {
    font-size: 16px;
    color: #333;
    text-decoration: none;
}

.lista-report a:hover {
    color: #0073aa;
}

.lista-report .autore-report {
    font-size: 13px;
    color: #666;
}

.lista-report .report-date {
    color: #666;
    font-size: 0.9em;
    display: block;
    margin-top: 5px;
}


/* ============================================================================
   5. SINGLE REPORT (single.php)
   ============================================================================ */

.aggiornamento-bimbi-dati {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border-left: 4px solid #4CAF50;
}

.aggiornamento-bimbi-dati p {
    margin: 8px 0;
    font-size: 1.05em;
}

.torna-report {
    margin: 30px 0;
}

.torna-report .button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.3s ease;
}

.torna-report .button:hover {
    background: #005a87;
    color: #fff;
}


/* ============================================================================
   6. DATI BAMBINO TABELLA
   ============================================================================ */

.dati-bambino-tabella {
    margin: 20px 0;
}

.dato-riga {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.dato-riga:last-child {
    border-bottom: none;
}

.dato-label {
    flex: 1;
    font-weight: 600;
    color: #333;
}

.dato-valore {
    flex: 2;
    text-align: right;
    color: #666;
}

.dato-valore em {
    color: #999;
    font-style: italic;
}


/* ============================================================================
   7. COMMENTI
   ============================================================================ */

.comments-area {
    margin: 40px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.comments-title {
    font-size: 18px;
    color: #333;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #0073aa;
}

.comments-title span {
    background: #0073aa;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 14px;
    margin-left: 10px;
}

.comment-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.comment {
    padding: 20px;
    margin-bottom: 20px;
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.comment:last-child {
    margin-bottom: 0;
}

.comment-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f0f0f0;
}

.comment-author {
    display: flex;
    align-items: center;
}

.comment-author .avatar {
    border-radius: 50%;
    margin-right: 12px;
    border: 2px solid #0073aa;
}

.comment-author .fn {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.comment-metadata {
    font-size: 13px;
    color: #6c757d;
}

.comment-metadata a {
    color: #6c757d;
    text-decoration: none;
}

.comment-metadata a:hover {
    color: #0073aa;
}

.comment-content {
    font-size: 15px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 15px;
}

.comment-content p {
    margin-bottom: 10px;
}

.comment-actions {
    display: flex;
    gap: 10px;
}

.reply,
.comment-edit-link {
    font-size: 13px;
    padding: 5px 12px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #495057;
    text-decoration: none;
    transition: all 0.3s ease;
}

.reply:hover,
.comment-edit-link:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

/* Commenti nidificati (risposte) */
.children {
    list-style: none;
    margin: 20px 0 0 30px;
    padding: 0;
    border-left: 2px solid #e9ecef;
    padding-left: 20px;
}

.children .comment {
    background: #fafafa;
    border-color: #e9ecef;
}

/* Commento dell'autore del post */
.comment.bypostauthor {
    border-left: 4px solid #28a745;
    background: #f8fff9;
}

/* Form commenti */
.comment-respond {
    margin-top: 40px;
    padding: 25px;
    background: white;
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.comment-reply-title {
    font-size: 16px;
    color: #333;
    margin-bottom: 20px;
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #495057;
}

.comment-form textarea,
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"] {
    width: 100%;
    padding: 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box;
}

.comment-form textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-form .form-submit {
    margin-top: 10px;
}

.comment-form .submit {
    background: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease;
}

.comment-form .submit:hover {
    background: #005a87;
}

.comment-awaiting-moderation {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 10px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    font-size: 13px;
}

.logged-in-as {
    margin-bottom: 15px;
    font-size: 14px;
    color: #6c757d;
}

.comment-form p.comment-form-float-label {
    margin-left: 10px;
    margin-right: 10px;
}

/* Commenti chiusi */
.comments-closed {
    text-align: center;
    padding: 20px;
    color: #6c757d;
    font-style: italic;
    border-top: 1px solid #e9ecef;
    margin-top: 30px;
}


/* ============================================================================
   8. PAGINAZIONE
   ============================================================================ */

.pagination {
    text-align: center;
    margin: 40px 0;
    padding: 20px 0;
    border-top: 1px solid #eee;
}

.pagination .page-numbers {
    display: inline-block;
    padding: 8px 15px;
    margin: 0 5px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #0073aa;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination .page-numbers:hover {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.pagination .current {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
    font-weight: bold;
}

.pagination .dots {
    background: none;
    border: none;
    color: #666;
}


/* ============================================================================
   9. MESSAGGI DI ACCESSO NEGATO
   ============================================================================ */

.accesso-negato {
    padding: 40px;
    text-align: center;
    max-width: 600px;
    margin: 60px auto;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.accesso-negato h2 {
    color: #d63638;
    margin-bottom: 20px;
}

.accesso-negato p {
    font-size: 16px;
    margin-bottom: 20px;
}

.accesso-negato a {
    color: #0073aa;
    font-weight: 600;
}

.accesso-negato a:hover {
    color: #005a87;
}


/* ============================================================================
   10. STILI ACF FRONTEND
   ============================================================================ */

.acf-fields.-left > .acf-field {
    padding: 15px 10px;
}

.acf-field-button-group .acf-button-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.acf-field-button-group .acf-button-group label {
    width: 100%;
    margin: 5px 0;
    text-align: center;
    padding: 12px 10px;
}

.acf-field-button-group .acf-button-group input[type="radio"] {
    margin-right: 10px;
}

.acf-field-select select,
.acf-field-date-picker input,
.acf-field-user select {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.acf-field {
    border-top: 1px solid #f0f0f0;
}

.acf-field:first-child {
    border-top: none;
}


/* ============================================================================
   11. RESPONSIVE DESIGN
   ============================================================================ */

/* Tablet (max 1024px) */
@media screen and (max-width: 1024px) {
    .content-area {
        margin: 30px auto;
    }

    .aggiornamento-bimbi-dati {
        margin: 20px 0;
    }

    .dati-bambino-tabella {
        margin: 15px 0;
    }
}

/* Smartphone (max 768px) */
@media screen and (max-width: 768px) {
    body {
        font-size: 15px;
        line-height: 1.5;
    }

    .site-header .site-title {
        font-size: 20px;
    }

    .content-area {
        margin: 20px 10px;
        padding: 0 10px;
    }

    .site-main h1 {
        font-size: 22px;
    }

    .aggiornamento-bimbi-dati {
        padding: 15px;
        margin: 15px 0;
    }

    .dato-riga {
        flex-direction: column;
        padding: 12px 0;
        border-bottom: 1px solid #e0e0e0;
    }

    .dato-label {
        flex: none;
        margin-bottom: 5px;
        font-size: 15px;
    }

    .dato-valore {
        flex: none;
        text-align: left;
        font-size: 16px;
        color: #333;
    }

    .lista-report li {
        margin-bottom: 15px;
        padding: 10px;
    }

    .pagination .page-numbers {
        padding: 6px 10px;
        margin: 0 2px;
        font-size: 14px;
    }

    .comments-area {
        padding: 20px;
        margin: 30px 0;
    }

    .comment-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .children {
        margin-left: 15px;
        padding-left: 15px;
    }

    .comment-respond {
        padding: 20px;
    }

    .acf-fields.-left {
        padding: 10px;
    }

    .acf-field .acf-label {
        margin-bottom: 8px;
        font-size: 14px;
    }

    .acf-field .acf-label label {
        font-weight: 600;
        line-height: 1.4;
    }

    .acf-field .acf-label p {
        font-size: 12px;
        margin-top: 4px;
        color: #666;
    }

    .acf-field-button-group .acf-button-group label {
        padding: 10px 8px;
        font-size: 14px;
    }

    /* Migliora tap target per mobile */
    .acf-button-group label,
    .button,
    input[type="submit"] {
        min-height: 44px;
        min-width: 44px;
    }

    input, select, textarea {
        font-size: 16px; /* Previene zoom automatico su iOS */
        padding: 10px;
    }
}

/* Smartphone piccoli (max 480px) */
@media screen and (max-width: 480px) {
    .content-area {
        margin: 15px 8px;
        padding: 0 5px;
    }

    .aggiornamento-bimbi-dati {
        margin: 10px 0;
        padding: 12px;
    }

    .dati-bambino-tabella {
        margin: 10px 0;
    }

    .lista-report li {
        padding: 8px;
    }

    .comments-area {
        padding: 15px;
    }

    .comment {
        padding: 15px;
    }

    .comment-author {
        flex-direction: column;
        align-items: flex-start;
    }

    .comment-author .avatar {
        margin-right: 0;
        margin-bottom: 8px;
    }

    .comment-actions {
        flex-direction: column;
    }

    .pagination .page-numbers {
        padding: 5px 8px;
        margin: 0 1px;
        font-size: 13px;
    }

    .acf-fields.-left > .acf-field {
        padding: 12px 5px;
    }

    .acf-field-button-group .acf-button-group label {
        font-size: 13px;
        padding: 8px 6px;
    }

    .acf-field {
        margin-bottom: 15px;
    }
}

/* ============================================================================
   12. POP-UP DI BENVENUTO (TOAST)
   ============================================================================ */

.welcome-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: #0073aa;
    color: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.25);
    padding: 15px 20px;
    z-index: 9999;
    max-width: 320px;
    animation: toastFadeIn 0.5s ease-out;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.welcome-toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.welcome-emoji {
    font-size: 32px;
    line-height: 1;
}

.welcome-message {
    margin: 0 0 4px 0;
    font-weight: 700;
    font-size: 16px;
}

.welcome-submessage {
    margin: 0;
    font-size: 13px;
    opacity: 0.85;
}

.welcome-toast-close {
    background: none;
    border: none;
    color: #aaa;
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 10px;
    align-self: flex-start;
    line-height: 1;
    transition: color 0.2s;
}

.welcome-toast-close:hover {
    color: #fff;
}

/* Animazione */
@keyframes toastFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Versione responsive */
@media screen and (max-width: 480px) {
    .welcome-toast {
        right: 10px;
        bottom: 20px;
        left: 10px;
        max-width: none;
    }
    .welcome-toast-content {
        gap: 10px;
    }
    .welcome-emoji {
        font-size: 28px;
    }
}

/* ============================================================================
   13. PROFILO UTENTE
   ============================================================================ */


.bds-profile-wrapper{
    max-width: 420px;
    margin: 40px auto;
    background: #ffffff;
    padding: 25px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    font-family: inherit;
}

.bds-profile-wrapper h2{
    text-align: center;
    margin-bottom: 20px;
    font-size: 22px;
}

.bds-profile-form label{
    display:block;
    margin-top: 12px;
    font-weight: 600;
    font-size: 14px;
}

.bds-profile-form input{
    width:100%;
    padding: 10px;
    margin-top: 6px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

.bds-profile-form button{
    margin-top: 20px;
    width:100%;
    padding: 12px;
    background: #2d6cdf;
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.bds-profile-form button:hover{
    background: #1f56c2;
}

/* ============================================================================
Pulsante Stampa Report */
/* ============================================================================*/

.bds-print-button {
    padding: 8px 16px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.bds-print-button:hover {
    background-color: #0056b3;
}

/* Tooltip Stampa Report */
.bds-print-tooltip {
    display: none;
    margin-left: 10px;
    font-size: 12px;
    color: #555;
    background-color: #f8f9fa;
    border: 1px solid #ddd;
    padding: 5px 8px;
    border-radius: 4px;
    max-width: 250px;
}

/* Contenitore del pulsante e tooltip */
.bds-print-actions {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}
 

.report-tipologia {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
    margin-left: 4px;
}
