* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f8f9fa;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    font-size: 4rem;
    margin-bottom: 0.5rem;
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.tagline {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Navigation */
nav {
    background: white;
    padding: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.category-btn {
    padding: 0.5rem 1.5rem;
    background: #f0f0f0;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 1rem;
}

.category-btn:hover, .category-btn.active {
    background: #5568d3; /* FIXED: Darker purple for WCAG AA (4.6:1 contrast) */
    color: white;
    transform: translateY(-2px);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Search Box */
.search-box {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: border 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #667eea;
}

/* Guides Grid */
.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.guide-card {
    background: white;
    border-radius: 10px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid #667eea;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
}

.guide-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.guide-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.guide-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.guide-category {
    display: none; /* HIDDEN: Category badge (icon is enough) */
    /* UNCOMMENT to show again:
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #f0f0f0;
    border-radius: 15px;
    font-size: 0.85rem;
    color: #666;
    margin-bottom: 0.5rem;
    */
}

.guide-preview {
    color: #666;
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 1rem;
}

.difficulty {
    display: inline-block;
    width: auto; /* IMPORTANT: Only width of text */
    max-width: max-content; /* IMPORTANT: Don't stretch */
    padding: 0.375rem 0.875rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.025em;
    border: 1.5px solid transparent;
}

.difficulty.easy {
    background-color: #dcfce7;
    color: #15803d;
    border-color: #86efac;
}

.difficulty.medium {
    background-color: #fed7aa;
    color: #9a3412;
    border-color: #fdba74;
}

.difficulty.hard {
    background-color: #fecaca;
    color: #991b1b;
    border-color: #fca5a5;
}

/* Footer */
footer {
    background: #333;
    color: white;
    padding: 2rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.footer-logo {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.disclaimer {
    font-size: 0.9rem;
    margin-top: 1rem;
    opacity: 0.8;
    line-height: 1.5;
}

/* ========================================
   GUIDE PAGES - Stili per pagine guida
   ======================================== */

.guide-content {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.back-btn {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 0.7rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    transition: background 0.3s;
}

.back-btn:hover {
    background: #5568d3;
}

.guide-content h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1rem;
}

.meta {
    color: #666;
    font-size: 1rem;
    margin-bottom: 2rem;
}

/* Intro Paragraph */
.guide-intro {
    font-size: 1.1rem;
    margin: 2rem 0;
    line-height: 1.8;
}

/* Section Headings */
.section-heading {
    margin-top: 2rem;
    color: #667eea;
}

/* Standard Paragraphs */
.guide-paragraph {
    margin: 1.5rem 0;
    line-height: 1.8;
}

/* ========================================
   BOX COMPONENTI - Warning, Tools, ecc.
   ======================================== */

/* Tools/Supplies Box */
.tools-needed {
    background: #e7f3ff;
    padding: 1rem;
    border-radius: 5px;
    margin: 1.5rem 0;
}

.tools-needed ul,
.tools-needed ol {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.tools-needed ul li,
.tools-needed ol li {
    padding-left: 0.5rem;
}

/* Warning Box (giallo) */
.warning-box {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 5px;
}

.warning-box strong {
    color: #856404;
}

.warning-box ul,
.warning-box ol {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.warning-box ul li,
.warning-box ol li {
    padding-left: 0.5rem;
}

/* Danger Box (rosso) */
.danger-box {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 5px;
}

.danger-box strong {
    color: #721c24;
}

.danger-box ul,
.danger-box ol {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.danger-box ul li,
.danger-box ol li {
    padding-left: 0.5rem;
}

/* Info Box (blu chiaro) */
.info-box {
    background: #e7f3ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.info-box-title {
    color: #667eea;
    margin-bottom: 1rem;
}

.info-box ul,
.info-box ol {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.info-box ul li,
.info-box ol li {
    padding-left: 0.5rem;
}

/* Neutral Box (grigio chiaro) */
.neutral-box {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.neutral-box-title {
    color: #667eea;
    margin-bottom: 1rem;
}

.neutral-box ul,
.neutral-box ol {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.neutral-box ul li,
.neutral-box ol li {
    padding-left: 0.5rem;
}

/* Error/Red Box */
.error-box {
    background: #f8d7da;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.error-box-title {
    color: #721c24;
    margin-bottom: 1rem;
}

.error-box ul,
.error-box ol {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.error-box ul li,
.error-box ol li {
    padding-left: 0.5rem;
}

/* Yellow/Warning Info Box */
.warning-info-box {
    background: #fff3cd;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.warning-info-box-title {
    margin-bottom: 1rem;
}

.warning-info-box ul,
.warning-info-box ol {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.warning-info-box ul li,
.warning-info-box ol li {
    padding-left: 0.5rem;
}

/* ========================================
   STEPS - Passi guidati
   ======================================== */

.steps {
    margin-top: 1.5rem;
}

.step {
    padding: 1rem;
    margin-bottom: 1rem;
    background: #f8f9fa;
    border-radius: 5px;
    border-left: 3px solid #667eea;
}

.step-number {
    font-weight: bold;
    color: #667eea;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.step ul,
.step ol {
    margin-left: 2rem;
    margin-top: 0.5rem;
}

.step ul li,
.step ol li {
    padding-left: 0.5rem;
    margin: 0.3rem 0;
}

.step p {
    margin-top: 0.5rem;
    line-height: 1.8;
}

/* Sub-steps dentro step */
.step .sub-item {
    margin: 1rem 0;
}

.step .sub-item strong {
    color: #333;
}

.step .sub-item ul {
    margin-top: 0.5rem;
}

/* Success/Check items */
.success-item {
    margin-top: 0.5rem;
    font-weight: bold;
    color: #28a745;
}

.warning-item {
    margin-top: 0.5rem;
    font-weight: bold;
    color: #ffc107;
}

.error-item {
    margin-top: 0.5rem;
    font-weight: bold;
    color: #dc3545;
}

/* ========================================
   FAQ SECTION
   ======================================== */

.faq-section {
    margin: 2rem 0;
}

.faq-question {
    color: #555;
    margin: 1.5rem 0 0.5rem;
}

.faq-question:first-child {
    margin-top: 0;
}

.faq-answer {
    color: #333;
    line-height: 1.6;
}

/* ========================================
   RELATED GUIDES BOX
   ======================================== */

.related-guides-box {
    background: #e7f3ff;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 2rem 0;
}

.related-guides-title {
    color: #667eea;
    margin-bottom: 1rem;
}

.related-guides-list {
    list-style: none;
    padding: 0;
}

.related-guides-list li {
    margin: 0.5rem 0;
}

.related-guides-list a {
    color: #667eea;
    text-decoration: none;
    transition: color 0.3s;
}

.related-guides-list a:hover {
    color: #5568d3;
    text-decoration: underline;
}

/* ========================================
   GUIDE IMAGES
   ======================================== */

.guide-image {
    width: 100%;
    max-width: 700px;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 1.5rem 0;
}

.image-caption {
    text-align: center;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.5rem;
    font-style: italic;
}

.image-container {
    text-align: center;
    margin: 2rem 0;
}

.image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.image-grid img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Spacing utilities */
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Text utilities */
.text-center { text-align: center; }
.text-bold { font-weight: bold; }
.text-primary { color: #667eea; }
.text-success { color: #28a745; }
.text-warning { color: #ffc107; }
.text-danger { color: #dc3545; }
.text-muted { color: #666; }

/* ========================================
   GLOBAL LIST STYLES - SPACING UNIFORME
   ======================================== */

/* REGOLA GLOBALE: Tutti gli elenchi nelle guide hanno lo stesso spacing */
.guide-content ul,
.guide-content ol {
    margin-left: 2rem;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.guide-content ul li,
.guide-content ol li {
    padding-left: 0.5rem;
    margin: 0.3rem 0;
    line-height: 1.6;
}

/* Override per liste che devono stare più strette (come guide correlate) */
.related-guides-list {
    margin-left: 0 !important;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    h1 {
        font-size: 1.8rem;
    }
    
    .guides-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-content h1 {
        font-size: 1.8rem;
    }
    
    .image-grid {
        grid-template-columns: 1fr;
    }
    
    /* Liste su mobile: meno spazio */
    .guide-content ul,
    .guide-content ol {
        margin-left: 1.5rem;
    }
}

/* ============================================
   MULTILINGUAL ADDITIONS - Struttura IT/EN
   ============================================ */

/* Language Redirect Page (root index.html) */
.language-redirect-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.language-redirect-content {
    text-align: center;
    color: white;
    max-width: 600px;
}

.logo-large {
    font-size: 8rem;
    margin-bottom: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.language-redirect-content h1 {
    font-size: 3rem;
    margin-bottom: 2rem;
    color: white;
}

.redirect-message {
    font-size: 1.2rem;
    margin: 0.5rem 0;
    opacity: 0.9;
}

.manual-selection {
    margin-top: 3rem;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.select-language-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.language-links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.language-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 1rem 2rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.language-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

.language-link .flag {
    font-size: 2rem;
}

.language-link .language-name {
    font-size: 1.2rem;
}

/* ============================================
   LANGUAGE SWITCHER - SVG Flag (Cross-platform)
   ============================================ */

.language-switcher {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    z-index: 1001;
    transition: position 0.3s ease;
}

/* Diventa fixed quando si scrolla */
body.scrolled .language-switcher {
    position: fixed;
    top: 1.25rem;
}

.language-switcher-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.9rem;
    background: white;
    color: #333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.language-switcher-link:hover {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    transform: translateY(-1px);
    border-color: #667eea;
}

.language-switcher-link:hover .flag-icon {
    transform: scale(1.05);
}

.language-switcher-link:active {
    transform: translateY(0);
}

.flag-icon {
    width: 1.25rem;
    height: 0.85rem;
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.language-text {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mobile */
@media (max-width: 768px) {
    .language-switcher {
        top: 1rem;
        right: 1rem;
    }
    
    .language-switcher-link {
        padding: 0.45rem 0.8rem;
        font-size: 0.8125rem;
    }
    
    .flag-icon {
        width: 1.15rem;
        height: 0.77rem;
    }
    
    .language-text {
        font-size: 0.8125rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .language-switcher {
        top: 0.875rem;
        right: 0.875rem;
    }
    
    .language-switcher-link {
        padding: 0.4rem 0.7rem;
        font-size: 0.75rem;
    }
    
    .flag-icon {
        width: 1.1rem;
        height: 0.73rem;
    }
    
    .language-text {
        font-size: 0.75rem;
    }
}

/* Scroll detection script (add to bottom of app-it.js and app-en.js) */

/* Coming Soon Page */
.coming-soon-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
}

.coming-soon-content {
    max-width: 700px;
    text-align: center;
    color: white;
}

.coming-soon-logo {
    font-size: 8rem;
    margin-bottom: 2rem;
    animation: bounce 2s infinite;
}

.coming-soon-title {
    font-size: 3.5rem;
    margin-bottom: 2rem;
    color: white;
    font-weight: 700;
}

.coming-soon-text {
    margin-bottom: 3rem;
}

.coming-soon-text p {
    font-size: 1.3rem;
    line-height: 1.8;
    margin: 0.8rem 0;
    opacity: 0.95;
}

.coming-soon-cta {
    margin: 3rem 0;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

.cta-text {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
    opacity: 0.9;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem 2.5rem;
    background: white;
    color: #667eea;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.2rem;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.3);
    background: #f8f9fa;
}

.cta-flag {
    font-size: 2rem;
}

.cta-label {
    font-size: 1.2rem;
}

.coming-soon-features {
    margin: 3rem 0;
    text-align: left;
}

.features-title {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: white;
}

.features-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    backdrop-filter: blur(10px);
    transition: all 0.3s;
}

.feature-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.feature-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.feature-text {
    font-size: 1.1rem;
    line-height: 1.4;
}

.coming-soon-notify {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.notify-text {
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    opacity: 0.9;
}

.notify-email {
    font-size: 1rem;
    opacity: 0.85;
}

.email-link {
    color: white;
    text-decoration: underline;
    font-weight: 600;
    transition: opacity 0.3s;
}

.email-link:hover {
    opacity: 1;
}

/* Responsive Design for Multilingual Elements */
@media (max-width: 768px) {
    .logo-large,
    .coming-soon-logo {
        font-size: 5rem;
    }
    
    .language-redirect-content h1,
    .coming-soon-title {
        font-size: 2.5rem;
    }
    
    .redirect-message,
    .coming-soon-text p {
        font-size: 1.1rem;
    }
    
    .language-links {
        flex-direction: column;
        gap: 1rem;
    }
    
    .language-link {
        width: 100%;
        justify-content: center;
    }
    
    .features-list {
        grid-template-columns: 1fr;
    }
    
    .cta-button {
        width: 100%;
        justify-content: center;
        padding: 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .language-redirect-container,
    .coming-soon-page {
        padding: 1rem;
    }
    
    .logo-large,
    .coming-soon-logo {
        font-size: 4rem;
    }
    
    .language-redirect-content h1,
    .coming-soon-title {
        font-size: 2rem;
    }
    
    .features-title {
        font-size: 1.5rem;
    }
    
    .feature-text {
        font-size: 1rem;
    }
}
/* Guide meta section - aligns badges at bottom */
.guide-meta {
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid #f3f4f6;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}