body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f4f4f9;
    color: #333;
}

header {
    background-color: #2196F3;
    color: white;
    padding: 1rem;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

header h1 { margin: 0; font-size: 1.5rem; }
header p { margin: 5px 0 0; font-size: 0.9rem; opacity: 0.9; }

#main-content {
    padding: 20px;
    max-width: 600px;
    margin: 0 auto;
    padding-bottom: 80px;
}

.hidden { display: none !important; }

/* Dashboard */
.card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    text-align: center;
}

.grid-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.module-btn {
    background: white;
    border: none;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.module-btn:active { transform: scale(0.98); }
.module-btn .icon { font-size: 2rem; margin-bottom: 10px; }
.module-btn h3 { margin: 5px 0; font-size: 1rem; color: #2196F3; }
.module-btn small { color: #666; font-size: 0.8rem; }

/* Navigazione */
.back-btn {
    background: transparent;
    border: 2px solid #2196F3;
    color: #2196F3;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: bold;
    margin-bottom: 20px;
    display: inline-block;
}

/* Moduli e Attività */
.module-header {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    border-left: 5px solid #2196F3;
}

.module-header h2 { margin-top: 0; color: #333; }
.module-header .icf-badge {
    background: #e3f2fd;
    color: #1565c0;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    font-weight: bold;
    display: inline-block;
    margin-top: 10px;
}

.clickable-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    cursor: pointer;
    transition: all 0.2s;
    border-left: 5px solid #ddd;
}
/* Evidenziazione parole selezionate nel Caviardage */
.cavia-selected {
    background: #d1c4e9;
    border-bottom: 2px solid #7e57c2;
    color: #4a148c;
    font-weight: bold;
}


.clickable-card:hover { transform: translateX(5px); border-left-color: #2196F3; }
.clickable-card h3 { margin: 0 0 5px 0; color: #333; }
.activity-label { text-transform: uppercase; font-size: 0.7rem; color: #999; letter-spacing: 1px; display: block; margin-bottom: 5px; }
.arrow-icon { float: right; color: #ccc; }

/* Dettagli */
.detail-box {
    background: white;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

.section-title {
    color: #2196F3;
    border-bottom: 1px solid #eee;
    padding-bottom: 5px;
    margin-top: 20px;
    margin-bottom: 10px;
}

.example-grid { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.word-tag { background: #e3f2fd; color: #1565c0; padding: 8px 15px; border-radius: 20px; font-size: 0.9rem; }

/* Carte CAA */
.caa-card {
    border: 2px solid #333;
    border-radius: 8px;
    width: 80px;
    height: 100px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #fff;
    text-align: center;
}
.caa-icon { font-size: 2.5rem; }
.caa-label { font-size: 0.7rem; font-weight: bold; text-transform: uppercase; margin-top: 5px; }

/* Documenti e Normativa */
.normative-box {
    background-color: #fff8e1;
    border-left: 5px solid #ffc107;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 5px;
}

.doc-btn {
    background: #fff;
    border: 1px solid #2196F3;
    color: #2196F3;
    padding: 10px 15px;
    border-radius: 20px;
    margin-right: 10px;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.pdf-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #d32f2f;
    color: white;
    text-decoration: none;
    padding: 15px;
    border-radius: 8px;
    margin-top: 25px;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0,0,0,0.2);
}

.doc-text-area {
    background: white;
    padding: 20px;
    border-radius: 10px;
    line-height: 1.6;
    color: #444;
}


/* Gestione Contatti */
.contact-form { display: flex; gap: 10px; margin-bottom: 20px; background: #f9f9f9; padding: 15px; border-radius: 8px; }
.contact-input { flex: 1; padding: 10px; border: 1px solid #ddd; border-radius: 5px; }
.btn-add { background: #2196F3; color: white; border: none; padding: 10px 15px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.contact-item { display: flex; justify-content: space-between; align-items: center; background: white; padding: 15px; border-radius: 8px; margin-bottom: 10px; border-left: 4px solid #4CAF50; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.contact-actions { display: flex; gap: 10px; }
.btn-call, .btn-save, .btn-del { text-decoration: none; padding: 8px 12px; border-radius: 5px; font-size: 1.2rem; border: none; cursor: pointer; }
.btn-call { background: #e3f2fd; } .btn-save { background: #e8f5e9; } .btn-del { background: #ffebee; }

footer { text-align: center; padding: 20px; font-size: 0.8rem; color: #999; margin-top: 20px; }

/* ==========================================
   ABOUT PAGE - Stili
   ========================================== */

.about-container {
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
}

.about-header {
    background: linear-gradient(135deg, #2196F3, #1565c0);
    color: white;
    padding: 30px 20px;
    text-align: center;
}

.about-logo {
    font-size: 4rem;
    margin-bottom: 10px;
}

.about-header h2 {
    margin: 0;
    font-size: 1.8rem;
}

.about-version {
    margin: 8px 0 0;
    opacity: 0.85;
    font-size: 0.9rem;
}

.about-section {
    padding: 20px;
    border-bottom: 1px solid #eee;
}

.about-section:last-of-type {
    border-bottom: none;
}

.about-section h3 {
    color: #2196F3;
    margin: 0 0 12px 0;
    font-size: 1.1rem;
}

.about-section p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    color: #555;
}

.about-section p:last-child {
    margin-bottom: 0;
}

.app-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.app-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.app-link:hover {
    background: #e3f2fd;
    border-color: #2196F3;
    transform: translateX(5px);
}

.app-icon {
    font-size: 2rem;
    width: 45px;
    text-align: center;
}

.app-link strong {
    display: block;
    color: #333;
    font-size: 1rem;
}

.app-link small {
    color: #666;
    font-size: 0.85rem;
}

/* Contatti e Supporto */
.contact-support-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.support-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
    border: 2px solid transparent;
}

.support-link .support-icon {
    font-size: 1.8rem;
    width: 45px;
    text-align: center;
}

.support-link strong {
    display: block;
    font-size: 1rem;
    color: #333;
}

.support-link small {
    color: #666;
    font-size: 0.85rem;
}

.contact-link {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
}

.contact-link:hover {
    border-color: #2196F3;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.donate-link {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
}

.donate-link:hover {
    border-color: #ff9800;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.2);
}

/* Share Buttons - Condivisione Social */
.share-intro {
    margin: 0 0 15px;
    color: #666;
    font-size: 0.9rem;
}

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

.share-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s;
    cursor: pointer;
    border: none;
}

.share-btn .share-icon {
    font-size: 1.2rem;
}

.share-btn.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
    color: white;
}

.share-btn.whatsapp:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
}

.share-btn.facebook {
    background: linear-gradient(135deg, #1877F2, #0d5bbd);
    color: white;
}

.share-btn.facebook:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.4);
}

.share-btn.email {
    background: linear-gradient(135deg, #EA4335, #c5221f);
    color: white;
}

.share-btn.email:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(234, 67, 53, 0.4);
}

.share-btn.copy-link {
    background: linear-gradient(135deg, #607D8B, #455A64);
    color: white;
}

.share-btn.copy-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(96, 125, 139, 0.4);
}

.share-btn.copy-link.copied {
    background: linear-gradient(135deg, #4CAF50, #388E3C);
}

@media (max-width: 500px) {
    .share-buttons {
        flex-direction: column;
    }

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

/* Floating Share Button */
.floating-share-container {
    position: fixed;
    bottom: 25px;
    right: 25px;
    z-index: 1000;
}

.floating-share-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2196F3, #1565c0);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.4);
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-share-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(33, 150, 243, 0.5);
}

.floating-share-container.open .floating-share-btn {
    background: linear-gradient(135deg, #f44336, #c62828);
    transform: rotate(45deg);
}

.share-icon-main {
    font-size: 1.5rem;
    transition: transform 0.3s;
}

.floating-share-menu {
    position: absolute;
    bottom: 70px;
    right: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s;
}

.floating-share-menu.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.float-share-item {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1.3rem;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    transition: all 0.3s;
    animation: popIn 0.3s ease backwards;
}

.float-share-item:nth-child(1) { animation-delay: 0.05s; }
.float-share-item:nth-child(2) { animation-delay: 0.1s; }
.float-share-item:nth-child(3) { animation-delay: 0.15s; }
.float-share-item:nth-child(4) { animation-delay: 0.2s; }

@keyframes popIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.float-share-item:hover {
    transform: scale(1.15);
}

.float-share-item.whatsapp {
    background: linear-gradient(135deg, #25D366, #128C7E);
}

.float-share-item.facebook {
    background: linear-gradient(135deg, #1877F2, #0d5bbd);
}

.float-share-item.email {
    background: linear-gradient(135deg, #EA4335, #c5221f);
}

.float-share-item.copy {
    background: linear-gradient(135deg, #607D8B, #455A64);
}

/* Nascondi floating button quando tour è attivo */
body.tour-active .floating-share-container {
    display: none;
}

/* Features Section - Presentazione PWA */
.features-section {
    background: linear-gradient(135deg, #f8f9fa, #e8eaf6);
}

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 15px;
}

.feature-item {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.3s;
}

.feature-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.feature-icon {
    font-size: 1.8rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.feature-item strong {
    display: block;
    color: #1565c0;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.feature-item p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
}

.features-footer {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #2196F3, #1565c0);
    border-radius: 10px;
    text-align: center;
}

.features-footer p {
    margin: 0;
    color: white;
    font-size: 0.9rem;
}

@media (max-width: 500px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .feature-item {
        padding: 12px;
    }

    .feature-icon {
        font-size: 1.5rem;
        width: 35px;
    }
}

.privacy-notice {
    background: #e8f5e9;
}

.privacy-notice h3 {
    color: #2e7d32;
}

.privacy-notice p {
    color: #2e7d32;
}

.about-footer {
    background: #f5f5f5;
    padding: 20px;
    text-align: center;
}

.about-footer p {
    margin: 5px 0;
    color: #666;
    font-size: 0.85rem;
}

/* ==========================================
   RICERCA GLOBALE - Stili
   ========================================== */

.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-box {
    display: flex;
    align-items: center;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    padding: 12px 15px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.search-box:focus-within {
    border-color: #2196F3;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.search-icon {
    font-size: 1.2rem;
    margin-right: 10px;
    opacity: 0.6;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    background: transparent;
    color: #333;
}

.search-box input::placeholder {
    color: #999;
}

.search-clear {
    background: #e0e0e0;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 0.9rem;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.search-clear:hover {
    background: #bdbdbd;
    color: #333;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    margin-top: 8px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
}

.search-results-header {
    padding: 10px 15px;
    background: #f5f5f5;
    border-bottom: 1px solid #eee;
    font-size: 0.85rem;
    color: #666;
    border-radius: 12px 12px 0 0;
}

.search-result-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 15px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
}

.search-result-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.search-result-item:hover {
    background: #e3f2fd;
}

.search-result-item:focus {
    background: #e3f2fd;
    outline: none;
}

.result-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.result-content {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.result-title mark {
    background: #fff59d;
    padding: 0 2px;
    border-radius: 2px;
}

.result-meta {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}

.result-type {
    font-size: 0.75rem;
    background: #e3f2fd;
    color: #1565c0;
    padding: 2px 8px;
    border-radius: 10px;
}

.result-module {
    font-size: 0.75rem;
    color: #888;
}

.result-desc {
    font-size: 0.85rem;
    color: #666;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.result-desc mark {
    background: #fff59d;
    padding: 0 2px;
    border-radius: 2px;
}

.search-no-results {
    padding: 30px 20px;
    text-align: center;
    color: #666;
}

.search-no-results span {
    font-size: 2rem;
    display: block;
    margin-bottom: 10px;
    opacity: 0.5;
}

.search-no-results p {
    margin: 0;
}

/* ==========================================
   FINESTRA DI JOHARI - Stili
   ========================================== */

/* Container principale */
.johari-container {
    background: #fff;
    padding: 20px;
    border-radius: 12px;
}

/* Tabs delle fasi */
.phase-tabs {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.phase-tab {
    flex: 1;
    min-width: 100px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    background: #f5f5f5;
    border-radius: 25px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    text-align: center;
}

.phase-tab:hover {
    background: #e3f2fd;
    border-color: #2196F3;
}

.phase-tab.active {
    background: #2196F3;
    color: white;
    border-color: #2196F3;
}

/* Categorie tratti */
.trait-categories {
    margin-top: 15px;
}

.trait-category {
    margin-bottom: 15px;
}

.category-header {
    user-select: none;
}

.category-header:hover {
    opacity: 0.9;
}

.category-traits {
    padding: 12px;
    background: #fafafa;
    border-radius: 0 0 8px 8px;
}

/* Bottoni tratti */
.trait-btn {
    transition: all 0.2s ease;
    font-weight: 500;
}

.trait-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.trait-btn.selected {
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}

/* Bottoni azioni Johari */
.johari-btn {
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.johari-btn.primary {
    background: #2196F3;
    color: white;
}

.johari-btn.primary:hover {
    background: #1976D2;
    box-shadow: 0 3px 8px rgba(33,150,243,0.4);
}

.johari-btn.secondary {
    background: #e0e0e0;
    color: #333;
}

.johari-btn.secondary:hover {
    background: #bdbdbd;
}

/* Quadranti Johari */
.johari-window {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.johari-quadrant {
    min-height: 120px;
}

.quadrant-traits {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.q-trait {
    display: inline-block;
    padding: 4px 10px;
    background: rgba(255,255,255,0.7);
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Profilo categorie - barre */
.category-profile {
    background: #fff;
}

/* Summary selezione */
.selection-summary {
    border-left: 4px solid #2196F3;
}

/* Responsive */
@media (max-width: 500px) {
    .phase-tabs {
        flex-direction: column;
    }

    .phase-tab {
        width: 100%;
    }

    .johari-window {
        grid-template-columns: 1fr;
    }

    .johari-btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .category-traits {
        justify-content: center;
    }
}

/* Stampa Johari */
@media print {
    .johari-container {
        box-shadow: none;
        border: 1px solid #ddd;
    }

    .phase-tabs,
    .johari-btn,
    .back-btn,
    header,
    footer {
        display: none !important;
    }

    .johari-result {
        padding: 20px;
    }

    .johari-quadrant {
        break-inside: avoid;
    }
}

/* ==========================================
   ACRONIMI DI VALORE - Stili Gamificati
   ========================================== */

.acronym-game-container {
    background: #fff;
}

/* Modalità buttons */
.mode-btn {
    padding: 10px 20px;
    border: 2px solid #3f51b5;
    background: #fff;
    color: #3f51b5;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.mode-btn:hover {
    background: #e8eaf6;
}

.mode-btn.active {
    background: #3f51b5;
    color: #fff;
}

/* Bottoni Acronimi */
.acronym-btn {
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.acronym-btn.primary {
    background: #3f51b5;
    color: white;
}

.acronym-btn.primary:hover {
    background: #303f9f;
    box-shadow: 0 3px 8px rgba(63,81,181,0.4);
}

.acronym-btn.secondary {
    background: #e0e0e0;
    color: #333;
}

.acronym-btn.secondary:hover {
    background: #bdbdbd;
}

/* Griglia lettere */
.acronym-letter-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    margin-bottom: 10px;
    background: #fafafa;
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s;
}

.acronym-letter-row.completed {
    background: #e8f5e9;
    border-color: #4CAF50;
}

.letter-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
}

.letter-content {
    flex: 1;
}

.acronym-word-input {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.acronym-word-input:focus {
    outline: none;
    border-color: #3f51b5;
}

.letter-status {
    width: 30px;
    text-align: center;
    font-size: 1.2rem;
}

.status-empty { color: #ccc; }
.status-valid { color: #4CAF50; font-weight: bold; }
.status-invalid { color: #f44336; }

/* Suggerimenti chip */
.suggestions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.suggestion-chip {
    padding: 4px 10px;
    background: #e8eaf6;
    border: 1px solid #c5cae9;
    border-radius: 15px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #3f51b5;
}

.suggestion-chip:hover {
    background: #3f51b5;
    color: white;
    border-color: #3f51b5;
}

.suggestion-chip.more {
    background: #fff;
    border-style: dashed;
}

/* Modal suggerimenti */
.suggestions-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.suggestions-modal-content {
    background: white;
    padding: 25px;
    border-radius: 15px;
    max-width: 400px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
}

.suggestions-modal-content h4 {
    margin: 0 0 20px 0;
    color: #3f51b5;
    text-align: center;
}

.suggestion-category {
    margin-bottom: 15px;
}

.suggestion-category h5 {
    margin: 0 0 8px 0;
    font-size: 0.9rem;
    color: #666;
}

.suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* Achievement badge */
.achievement-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    background: linear-gradient(135deg, #FFD700, #FFA500);
    border-radius: 50%;
    font-size: 1.2rem;
    box-shadow: 0 2px 6px rgba(255,165,0,0.4);
}

@keyframes achievementPop {
    0% { transform: scale(0); opacity: 0; }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); opacity: 1; }
}

/* Profile Card */
.profile-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    padding: 25px;
    color: white;
    box-shadow: 0 10px 30px rgba(102,126,234,0.4);
    margin-top: 20px;
}

.profile-card .card-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255,255,255,0.3);
}

.profile-card .card-header h3 {
    margin: 0 0 10px 0;
    font-size: 1.2rem;
}

.profile-card .card-name {
    font-size: 2rem;
    font-weight: bold;
    letter-spacing: 5px;
}

.profile-card .card-body {
    margin-bottom: 20px;
}

.card-word-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.card-word-row:last-child {
    border-bottom: none;
}

.card-letter {
    font-size: 1.5rem;
    font-weight: bold;
    width: 30px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}

.card-word {
    font-size: 1.1rem;
    font-weight: 500;
}

.profile-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding-top: 15px;
    border-top: 1px solid rgba(255,255,255,0.3);
    font-size: 0.85rem;
    opacity: 0.9;
}

.card-achievements {
    font-size: 1.3rem;
}

/* History items */
.history-item {
    background: #f5f5f5;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    border-left: 4px solid #3f51b5;
}

.history-name {
    font-weight: bold;
    font-size: 1.1rem;
    color: #3f51b5;
    letter-spacing: 2px;
}

.history-words {
    font-size: 0.85rem;
    color: #666;
    margin: 5px 0;
}

.history-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    color: #999;
}

/* Responsive Acronimi */
@media (max-width: 500px) {
    .acronym-letter-row {
        flex-wrap: wrap;
    }

    .letter-badge {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .letter-content {
        width: 100%;
        order: 3;
        margin-top: 10px;
    }

    .letter-status {
        margin-left: auto;
    }

    .mode-btn {
        flex: 1;
        text-align: center;
    }

    .profile-card .card-name {
        font-size: 1.5rem;
        letter-spacing: 3px;
    }
}

/* Stampa Acronimi */
@media print {
    .acronym-game-container {
        box-shadow: none;
    }

    .acronym-modes,
    .acronym-input-section,
    .acronym-btn,
    #acronym-game-area,
    #acronym-history,
    .back-btn {
        display: none !important;
    }

    .profile-card {
        box-shadow: none;
        border: 2px solid #3f51b5;
        background: white !important;
        color: #333 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .profile-card .card-header {
        border-bottom-color: #3f51b5;
    }

    .profile-card .card-name {
        color: #3f51b5;
    }
}

/* ==========================================
   GUIDED TOUR - Stili
   ========================================== */

/* Overlay scuro */
.tour-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    transition: opacity 0.3s ease;
}

/* Spotlight (evidenzia elemento target) */
.tour-spotlight {
    position: fixed;
    border-radius: 10px;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.75);
    z-index: 9999;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* Tooltip principale */
.tour-tooltip {
    position: fixed;
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    max-width: 340px;
    width: 90%;
    z-index: 10000;
    animation: tourFadeIn 0.3s ease;
    overflow: hidden;
}

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

.tour-tooltip.center {
    max-width: 380px;
}

/* Header del tooltip */
.tour-tooltip-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: linear-gradient(135deg, #2196F3, #1565c0);
    color: white;
}

.tour-step-indicator {
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0.9;
}

.tour-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.tour-close:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Contenuto */
.tour-title {
    margin: 0;
    padding: 16px 16px 8px;
    font-size: 1.15rem;
    color: #333;
}

.tour-content {
    margin: 0;
    padding: 0 16px 16px;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666;
}

/* Progress dots */
.tour-progress {
    padding: 0 16px 12px;
    text-align: center;
}

.tour-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.tour-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #e0e0e0;
    transition: all 0.3s;
}

.tour-dot.active {
    background: #2196F3;
    transform: scale(1.2);
}

.tour-dot.completed {
    background: #4CAF50;
}

/* Pulsanti navigazione */
.tour-buttons {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
}

.tour-nav {
    display: flex;
    gap: 8px;
}

.tour-btn {
    padding: 10px 18px;
    border-radius: 25px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.tour-btn-skip {
    background: transparent;
    color: #999;
}

.tour-btn-skip:hover {
    color: #666;
    background: #eee;
}

.tour-btn-prev {
    background: #e0e0e0;
    color: #333;
}

.tour-btn-prev:hover {
    background: #d0d0d0;
}

.tour-btn-next {
    background: #2196F3;
    color: white;
}

.tour-btn-next:hover {
    background: #1976D2;
    box-shadow: 0 3px 10px rgba(33, 150, 243, 0.4);
}

/* Frecce indicatrici (opzionale) */
.tour-tooltip.bottom::before {
    content: '';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-bottom: 12px solid #2196F3;
}

.tour-tooltip.top::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 12px solid transparent;
    border-right: 12px solid transparent;
    border-top: 12px solid #f8f9fa;
}

/* Body con tour attivo */
body.tour-active {
    overflow: hidden;
}

/* Pulsante Guida nella dashboard */
.tour-trigger-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 20px;
    margin-top: 15px;
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 2px dashed #2196F3;
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: #1565c0;
    transition: all 0.3s;
}

.tour-trigger-btn:hover {
    background: linear-gradient(135deg, #bbdefb, #90caf9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.2);
}

.tour-trigger-btn .tour-icon {
    font-size: 1.3rem;
}

/* Responsive Tour */
@media (max-width: 400px) {
    .tour-tooltip {
        max-width: 95%;
        margin: 0 10px;
    }

    .tour-buttons {
        flex-direction: column;
        gap: 10px;
    }

    .tour-nav {
        width: 100%;
        justify-content: space-between;
    }

    .tour-btn-skip {
        order: 3;
        width: 100%;
        text-align: center;
    }

    .tour-btn {
        flex: 1;
    }
}

/* ==========================================
   CORNICE TEORICA - Timeline e Info Cards
   ========================================== */

/* Timeline Normativa */
.timeline-container {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.timeline-container h4 {
    margin-bottom: 15px;
}

.timeline-wrapper {
    display: flex;
    overflow-x: auto;
    gap: 0;
    padding: 10px 0;
    -webkit-overflow-scrolling: touch;
}

.timeline-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 100px;
    position: relative;
    flex-shrink: 0;
}

.timeline-item::after {
    content: '';
    position: absolute;
    top: 18px;
    left: 50%;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #2196F3, #64b5f6);
    z-index: 0;
}

.timeline-item:last-child::after {
    display: none;
}

.timeline-year {
    background: linear-gradient(135deg, #2196F3, #1565c0);
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(33, 150, 243, 0.3);
}

.timeline-content {
    text-align: center;
    margin-top: 12px;
    padding: 0 8px;
}

.timeline-content strong {
    display: block;
    color: #1565c0;
    font-size: 0.85rem;
}

.timeline-content span {
    font-size: 0.75rem;
    color: #666;
    display: block;
    margin-top: 4px;
}

/* Info Cards Espandibili */
.info-cards-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.info-card-collapsible {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    transition: all 0.3s;
}

.info-card-collapsible.expanded {
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.info-card-header {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px;
    cursor: pointer;
    transition: background 0.2s;
}

.info-card-header:hover {
    background: #f8f9fa;
}

.info-card-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.info-card-titles {
    flex: 1;
}

.info-card-titles h4 {
    margin: 0;
    color: #333;
    font-size: 1rem;
}

.info-card-titles small {
    color: #666;
    font-size: 0.85rem;
}

.info-card-arrow {
    color: #999;
    font-size: 0.8rem;
    transition: transform 0.3s;
}

.info-card-body {
    padding: 0 18px 18px;
    border-top: 1px solid #eee;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Contenuto espanso - Percorsi */
.info-card-expanded h4 {
    color: #1565c0;
    margin: 15px 0 8px;
    font-size: 1rem;
}

.info-card-expanded h4:first-child {
    margin-top: 10px;
}

.result-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.85rem;
    margin: 5px 0 10px;
}

.result-badge.diploma {
    background: #e8f5e9;
    color: #2e7d32;
}

.result-badge.attestato {
    background: #fff3e0;
    color: #e65100;
}

.warning-box {
    background: #ffebee;
    border-left: 4px solid #f44336;
    padding: 12px 15px;
    border-radius: 0 8px 8px 0;
    margin: 15px 0;
}

/* Flowchart */
.flowchart {
    background: #f5f5f5;
    padding: 20px;
    border-radius: 12px;
    margin-top: 15px;
}

.flow-step {
    background: #2196F3;
    color: white;
    padding: 12px 18px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
    margin-bottom: 15px;
}

.flow-step.small {
    background: #64b5f6;
    font-size: 0.9rem;
    padding: 10px 15px;
}

.flow-arrows {
    display: flex;
    gap: 20px;
    justify-content: center;
}

.flow-sub-arrows {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.flow-branch {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
}

.flow-label {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.8rem;
    margin-bottom: 8px;
}

.flow-label.yes {
    background: #4caf50;
    color: white;
}

.flow-label.no {
    background: #f44336;
    color: white;
}

.flow-result {
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-align: center;
    border: 2px solid #4caf50;
}

.flow-result.warning {
    border-color: #ff9800;
    background: #fff8e1;
}

/* Dimensioni Grid */
.dimension-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.dimension-card {
    background: #fafafa;
    padding: 15px;
    border-radius: 8px;
}

.dimension-card h4 {
    margin: 0 0 5px;
    font-size: 0.95rem;
    color: #333;
}

.dimension-card p {
    margin: 0 0 10px;
    font-size: 0.8rem;
    color: #888;
}

.dimension-card ul {
    margin: 0;
    padding-left: 18px;
    font-size: 0.85rem;
}

.dimension-card li {
    margin-bottom: 4px;
    color: #555;
}

.dimension-card .highlight {
    background: #e8f5e9;
    color: #2e7d32;
    padding: 8px 12px;
    border-radius: 6px;
    margin-top: 10px;
    font-weight: 500;
}

.info-note {
    background: #e3f2fd;
    padding: 12px 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #1565c0;
}

/* GLO Members */
.glo-members {
    margin-bottom: 20px;
}

.member-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
}

.member-row.header-role {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    border: 1px solid #90caf9;
}

.member-row.optional {
    background: #f5f5f5;
    border: 1px dashed #bdbdbd;
}

.member-row.student {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
}

.member-icon {
    font-size: 1.5rem;
}

.member-row strong {
    display: block;
    font-size: 0.95rem;
    color: #333;
}

.member-row small {
    font-size: 0.8rem;
    color: #666;
}

/* Rules Grid */
.rules-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.rule-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px;
    background: #fafafa;
    border-radius: 8px;
}

.rule-icon {
    font-size: 1.3rem;
    flex-shrink: 0;
}

.rule-item strong {
    display: block;
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 4px;
}

.rule-item p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
}

/* Responsive Cornice Teorica */
@media (max-width: 500px) {
    .dimension-grid {
        grid-template-columns: 1fr;
    }

    .rules-grid {
        grid-template-columns: 1fr;
    }

    .flow-arrows {
        flex-direction: column;
        gap: 15px;
    }

    .flow-sub-arrows {
        flex-direction: column;
        gap: 10px;
    }

    .timeline-item {
        min-width: 85px;
    }

    .timeline-year {
        font-size: 0.75rem;
        padding: 5px 10px;
    }
}