/* ===================================
   LESSON 2 - SPECIFIC STYLES
   Variabili che Vedi
   =================================== */

/* Importing base lesson styles */
@import url('../lezione-01/style.css');

/* HTML Structure Box - Lesson 2 specific additions */
.html-structure-box {
    background: #e3f2fd;
    border: 3px solid #2196f3;
    padding: 2rem;
    border-radius: 16px;
    margin: 2rem 0;
}

body.dark-theme .html-structure-box {
    background: #0d2d4a;
    border-color: #64b5f6;
}

.html-structure-box h3 {
    color: #1976d2;
    margin-bottom: 1rem;
}

body.dark-theme .html-structure-box h3 {
    color: #64b5f6;
}

.html-structure-box p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.id-reference {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1rem;
    border-left: 4px solid #2196f3;
}

body.dark-theme .id-reference {
    background: #1a1a1a;
}

.id-reference strong {
    display: block;
    margin-bottom: 0.75rem;
    color: #1976d2;
    font-size: 1.1rem;
}

body.dark-theme .id-reference strong {
    color: #64b5f6;
}

.id-reference ul {
    list-style: none;
    padding: 0;
}

.id-reference li {
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--bg-tertiary);
}

.id-reference li:last-child {
    border-bottom: none;
}

.id-reference code {
    background: #e3f2fd;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-family: var(--font-code);
    color: #1976d2;
    font-weight: 600;
    margin-right: 0.5rem;
}

body.dark-theme .id-reference code {
    background: #0d2d4a;
    color: #64b5f6;
}

.code-tag {
    color: #569cd6;
}

.code-attr {
    color: #9cdcfe;
}

/* Demo Container Specific */
.demo-display {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
}

body.dark-theme .demo-display {
    background: #2d2d2d;
}

/* Counter Display */
.counter-display {
    text-align: center;
    padding: 2rem;
    background: var(--gradient-primary);
    border-radius: 16px;
    color: white;
    margin-bottom: 2rem;
}

.counter-label {
    font-size: 1rem;
    opacity: 0.9;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

.counter-value {
    font-size: 5rem;
    font-weight: 900;
    line-height: 1;
    margin: 1rem 0;
    text-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.counter-sublabel {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.stat-box {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    transition: all 0.3s;
}

body.dark-theme .stat-box {
    background: #1a1a1a;
}

.stat-box:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Code Peek */
.code-peek {
    background: #1e1e1e;
    padding: 1.5rem;
    border-radius: 12px;
    margin-top: 1.5rem;
}

.code-peek h4 {
    color: #888;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.code-peek code {
    font-family: var(--font-code);
    font-size: 0.9rem;
    line-height: 1.6;
}

.code-number {
    color: #b5cea8;
}

/* Visual Box */
.visual-box {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin: 1.5rem 0;
}

.variable-visual {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.var-box {
    background: white;
    border: 3px solid var(--accent-primary);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s;
}

body.dark-theme .var-box {
    background: #1a1a1a;
}

.var-box:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

.var-name {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    font-family: var(--font-code);
}

.var-value {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--accent-primary);
    font-family: var(--font-code);
}

/* Why Box */
.why-box {
    background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
    color: white;
    padding: 2rem;
    border-radius: 16px;
    margin: 1.5rem 0;
}

.why-box h3 {
    color: white;
    margin-bottom: 1rem;
}

.why-box ol {
    padding-left: 1.5rem;
}

.why-box li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

/* Comparison Table */
.comparison-table {
    margin: 2rem 0;
    overflow-x: auto;
}

.comparison-table h4 {
    margin-bottom: 1rem;
}

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

body.dark-theme .comparison-table table {
    background: #2d2d2d;
}

.comparison-table th {
    background: var(--gradient-primary);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 700;
}

.comparison-table td {
    padding: 1.5rem;
    border-bottom: 1px solid var(--bg-tertiary);
}

.comparison-table code {
    display: block;
    margin: 0.5rem 0;
    font-family: var(--font-code);
    font-size: 0.9rem;
}

.comparison-table small {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
}

/* Info Box */
.info-box {
    background: #d1f2eb;
    border-left: 4px solid #00d2a0;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
}

body.dark-theme .info-box {
    background: #003d2d;
    color: #00ffa5;
}

.info-box strong {
    display: block;
    margin-bottom: 0.5rem;
}

/* Rules Box */
.rules-box {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 2rem 0;
}

.rule-item {
    display: flex;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border-radius: 12px;
    align-items: flex-start;
}

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

.rule-item code {
    display: block;
    margin: 0.5rem 0;
    padding: 0.5rem;
    background: rgba(0,0,0,0.1);
    border-radius: 4px;
    font-family: var(--font-code);
}

.rule-item ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

/* Types Grid */
.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.type-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 16px;
    text-align: center;
    transition: all 0.3s;
    border: 3px solid transparent;
}

.type-card:hover {
    border-color: var(--accent-primary);
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.type-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.type-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.type-card p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.code-example-small {
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.code-example-small pre {
    margin: 0;
}

.code-example-small code {
    font-family: var(--font-code);
    font-size: 0.85rem;
    line-height: 1.5;
    color: #d4d4d4;
}

.code-boolean {
    color: #569cd6;
}

.code-null {
    color: #569cd6;
}

/* Interactive Type Checker */
.interactive-type-checker {
    margin: 2rem 0;
}

.type-checker {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.type-input {
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--bg-tertiary);
    border-radius: 8px;
    font-family: var(--font-code);
    background: white;
    color: var(--text-primary);
}

body.dark-theme .type-input {
    background: #1a1a1a;
    border-color: #3d3d3d;
}

.type-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.check-btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.check-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.type-result {
    padding: 1.5rem;
    background: white;
    border-radius: 8px;
    font-size: 1.2rem;
    font-weight: 600;
    text-align: center;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.dark-theme .type-result {
    background: #1a1a1a;
}

/* Calculator Demo */
.calculator-demo {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    margin: 2rem 0;
}

.calc-container {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
}

body.dark-theme .calc-container {
    background: #2d2d2d;
}

.calc-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.calc-input {
    padding: 1rem;
    font-size: 1.5rem;
    text-align: center;
    border: 3px solid var(--bg-tertiary);
    border-radius: 8px;
    font-weight: 700;
    font-family: var(--font-code);
}

body.dark-theme .calc-input {
    background: #1a1a1a;
    border-color: #3d3d3d;
    color: white;
}

.calc-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.calc-operator {
    padding: 1rem;
    font-size: 1.1rem;
    border: 3px solid var(--bg-tertiary);
    border-radius: 8px;
    background: white;
    cursor: pointer;
    font-weight: 600;
}

body.dark-theme .calc-operator {
    background: #1a1a1a;
    border-color: #3d3d3d;
    color: white;
}

.calc-btn {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.calc-btn:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

.calc-result {
    background: var(--gradient-sunset);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-top: 1.5rem;
}

.result-label {
    display: block;
    color: white;
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.result-value {
    font-size: 3rem;
    font-weight: 900;
    color: white;
    font-family: var(--font-code);
}

/* Display Box */
.display-box {
    background: var(--gradient-primary);
    color: white;
    padding: 3rem;
    border-radius: 16px;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    min-height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.5s;
}

/* Points Display */
.points-display {
    background: var(--gradient-primary);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 2rem;
}

.points-label {
    color: white;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.points-value {
    font-size: 6rem;
    font-weight: 900;
    color: white;
    line-height: 1;
    margin: 1rem 0;
    text-shadow: 0 5px 15px rgba(0,0,0,0.3);
    transition: all 0.3s;
}

.points-sublabel {
    color: white;
    font-size: 1rem;
    opacity: 0.8;
}

.exercise-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
}

/* Project Styles */
.project-display {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    margin-bottom: 2rem;
}

.main-counter {
    background: var(--gradient-primary);
    padding: 3rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 2rem;
}

.counter-big-value {
    font-size: 7rem;
    font-weight: 900;
    color: white;
    line-height: 1;
    text-shadow: 0 6px 20px rgba(0,0,0,0.3);
    transition: all 0.5s;
}

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

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s;
}

body.dark-theme .stat-card {
    background: #1a1a1a;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-title {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.stat-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-primary);
    font-family: var(--font-code);
}

.project-controls-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.project-input {
    padding: 1rem;
    font-size: 1.2rem;
    text-align: center;
    border: 3px solid var(--bg-tertiary);
    border-radius: 8px;
    font-weight: 700;
    font-family: var(--font-code);
}

body.dark-theme .project-input {
    background: #1a1a1a;
    border-color: #3d3d3d;
    color: white;
}

.project-btn {
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.project-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

/* Key Concepts */
.key-concepts-box {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    margin: 2rem 0;
}

.key-concepts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.concept-card {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-primary);
    transition: all 0.3s;
}

body.dark-theme .concept-card {
    background: #2d2d2d;
}

.concept-card:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow-md);
}

.concept-card h4 {
    color: var(--accent-primary);
    margin-bottom: 0.5rem;
}

.concept-card code {
    background: rgba(102, 126, 234, 0.1);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: var(--font-code);
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .calc-inputs {
        grid-template-columns: 1fr;
    }

    .calc-operator {
        text-align: center;
    }

    .counter-value {
        font-size: 3.5rem;
    }

    .counter-big-value {
        font-size: 4rem;
    }

    .points-value {
        font-size: 4rem;
    }

    .project-controls-grid {
        grid-template-columns: 1fr;
    }

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

    .key-concepts-grid {
        grid-template-columns: 1fr;
    }

    .variable-visual {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .project-stats {
        grid-template-columns: 1fr 1fr;
    }
}



/* ============================================
   FIX CSS PER CALCOLATRICE LIVE
   Aggiungi questo CSS al file style.css della lezione
   ============================================ */

/* Fix Calcolatrice Live - Previene fuoriuscita */
.calculator-demo {
    margin: 2rem 0;
}

.calc-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--bg-secondary, #f8fafc);
    border-radius: 12px;
    border: 2px solid var(--border-color, #e2e8f0);
    overflow: hidden; /* Previene fuoriuscita */
}

.calc-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    align-items: center;
}

.calc-input {
    width: 100%; /* Importante: limita la larghezza */
    max-width: 100%; /* Previene overflow */
    padding: 0.75rem;
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-primary, white);
    color: var(--text-primary, #1e293b);
    transition: all 0.2s;
    box-sizing: border-box; /* Importante per il sizing */
}

.calc-input:focus {
    outline: none;
    border-color: var(--accent-primary, #6366f1);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.calc-operator {
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: 2px solid var(--border-color, #e2e8f0);
    border-radius: 8px;
    background: var(--bg-primary, white);
    color: var(--text-primary, #1e293b);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap; /* Previene wrap del testo */
}

.calc-operator:hover {
    border-color: var(--accent-primary, #6366f1);
}

.calc-btn {
    width: 100%; /* Larghezza controllata */
    padding: 1rem 2rem;
    font-size: 1.2rem;
    font-weight: 700;
    background: var(--accent-primary, #6366f1);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.calc-btn:hover {
    background: var(--accent-secondary, #8b5cf6);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.calc-btn:active {
    transform: translateY(0);
}

.calc-result {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, 
        var(--accent-primary, #6366f1), 
        var(--accent-secondary, #8b5cf6));
    border-radius: 10px;
    color: white;
    min-height: 80px; /* Previene il collasso */
    overflow: hidden; /* Previene fuoriuscita */
}

.result-label {
    font-size: 1rem;
    font-weight: 600;
    opacity: 0.9;
}

.result-value {
    font-size: 2rem;
    font-weight: 900;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    word-break: break-all; /* Previene overflow di numeri lunghi */
}

/* Responsive - Mobile */
@media (max-width: 768px) {
    .calc-inputs {
        grid-template-columns: 1fr; /* Stack verticalmente */
        gap: 0.75rem;
    }
    
    .calc-operator {
        width: 100%;
    }
    
    .calc-input {
        font-size: 1rem;
    }
    
    .result-value {
        font-size: 1.5rem;
    }
}

/* Responsive - Tablet */
@media (max-width: 1024px) {
    .calc-container {
        padding: 1rem;
    }
}


/* ============================================
   CSS PER SEZIONE ESERCIZI SCARICABILI
   Aggiungi questo CSS al file style.css della lezione
   ============================================ */

/* Download Intro */
.download-intro {
    background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-primary);
    margin-bottom: 2rem;
}

.download-intro p {
    margin-bottom: 0.75rem;
    color: #1e293b;  
    line-height: 1.6;
}
.download-intro strong {
    color: #6366f1;  
    font-weight: 700;
}

.download-intro p:last-child {
    margin-bottom: 0;
}

/* Download Box Main */
.download-box-main {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
    margin: 2rem 0;
    box-shadow: 0 10px 40px rgba(99, 102, 241, 0.3);
}

.download-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.download-box-main h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.download-box-main > p {
    opacity: 0.95;
    margin-bottom: 1.5rem;
}

.btn-download-big {
    display: inline-block;
    background: white;
    color: var(--accent-primary);
    padding: 1.25rem 3rem;
    border-radius: 12px;
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-download-big:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.download-note {
    margin-top: 1rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.download-note code {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

/* Exercises Grid */
.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.exercise-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.exercise-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-primary);
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.exercise-number {
    font-size: 2rem;
    font-weight: 900;
    color: var(--accent-primary);
    opacity: 0.2;
}

.exercise-difficulty {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-end;
}

.difficulty-badge {
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.difficulty-badge.easy {
    background: #d1fae5;
    color: #065f46;
}

.difficulty-badge.medium {
    background: #fef3c7;
    color: #92400e;
}

.difficulty-badge.hard {
    background: #fee2e2;
    color: #991b1b;
}

.time-badge {
    font-size: 0.85rem;
    color: #64748b;
}

.exercise-card h4 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.exercise-description {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.exercise-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.feature {
    font-size: 0.85rem;
    padding: 0.25rem 0.75rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    color: var(--text-secondary);
}

/* Instructions Download */
.instructions-download {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.instructions-download h3 {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

.download-steps {
    list-style: none;
    counter-reset: step-counter;
    padding: 0;
}

.download-steps li {
    counter-increment: step-counter;
    position: relative;
    padding: 1rem 1rem 1rem 3.5rem;
    margin-bottom: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--accent-primary);
}

.download-steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    background: var(--accent-primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.download-steps li strong {
    color: var(--accent-primary);
}

.download-steps code {
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #1e293b;
}

/* What's Included */
.whats-included {
    margin: 2rem 0;
}

.whats-included h3 {
    color: var(--accent-primary);
    margin-bottom: 1.5rem;
}

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

.included-item {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
}

.included-icon {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.included-item strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.included-item p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* Pro Tips */
.pro-tips-download {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.pro-tips-download h3 {
    color: #92400e;
    margin-bottom: 1.5rem;
}

.tip-box {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    border-left: 4px solid #f59e0b;
}

.tip-box:last-child {
    margin-bottom: 0;
}

.tip-box strong {
    display: block;
    color: #92400e;
    margin-bottom: 0.5rem;
}

.tip-box p {
    color: #78716c;
    font-size: 0.95rem;
}

.tip-box kbd {
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    border: 1px solid #cbd5e1;
    box-shadow: 0 2px 0 #cbd5e1;
}

.tip-box code {
    background: #f1f5f9;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    color: #1e293b;
}

/* CTA Download */
.cta-download {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    padding: 3rem 2rem;
    border-radius: 16px;
    text-align: center;
    margin: 2rem 0;
    border: 2px solid var(--accent-primary);
}

.cta-download h3 {
    color: var(--accent-primary);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.cta-download > p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.btn-download-cta {
    display: inline-block;
    background: var(--accent-primary);
    color: white;
    padding: 1.25rem 3rem;
    border-radius: 12px;
    font-size: 1.2rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-download-cta:hover {
    background: var(--accent-secondary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.4);
}

.cta-note {
    margin-top: 1rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Responsive */
@media (max-width: 768px) {
    .exercises-grid {
        grid-template-columns: 1fr;
    }
    
    .included-grid {
        grid-template-columns: 1fr;
    }
    
    .download-box-main {
        padding: 2rem 1.5rem;
    }
    
    .download-box-main h3 {
        font-size: 1.5rem;
    }
    
    .btn-download-big,
    .btn-download-cta {
        padding: 1rem 2rem;
        font-size: 1.1rem;
    }
    
    .download-steps li {
        padding: 1rem 1rem 1rem 3rem;
    }
}


/* Banner Esercizi Scaricabili */
.exercise-banner {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
    padding: 2rem 0;
    margin-bottom: 2rem;
}

.banner-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.banner-icon {
    font-size: 3rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

.banner-text {
    flex: 1;
    min-width: 250px;
}

.banner-content h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.banner-content p {
    opacity: 0.95;
    margin: 0;
}

.banner-link {
    display: inline-block;
    background: white;
    color: var(--accent-primary);
    padding: 1rem 2rem;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.banner-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .banner-content {
        flex-direction: column;
        text-align: center;
    }
    
    .banner-content h3 {
        font-size: 1.3rem;
    }
    
    .banner-link {
        width: 100%;
    }
}

/* ===================================
   SEZIONE PONTE - Comparison Demo
   =================================== */
.comparison-demo {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin: 2rem 0;
}

.demo-col {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    border: 2px solid var(--border-color);
}

.demo-col.highlight {
    border-color: var(--accent-primary);
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.1);
}

.demo-col h4 {
    margin-top: 0;
    font-size: 1.2rem;
}

.demo-box {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    text-align: center;
}

.display-text {
    font-size: 1.5rem;
    font-weight: 600;
    padding: 1rem;
    margin-bottom: 1rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.demo-btn {
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 0.25rem;
}

.demo-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.demo-btn.btn-primary {
    background: var(--accent-primary);
    color: white;
}

.demo-btn.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.code-peek-small {
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 8px;
    margin: 1rem 0;
}

.code-peek-small code {
    color: #d4d4d4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 1.6;
}

.highlight-code {
    background: rgba(255, 215, 0, 0.2);
    padding: 0 4px;
    border-radius: 3px;
}

.note {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 1rem;
    font-style: italic;
}

.key-insight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.key-insight h4 {
    margin-top: 0;
    font-size: 1.3rem;
}

.key-insight p {
    margin-bottom: 0;
    line-height: 1.8;
}

/* ===================================
   USER CARD - Esercizio Dichiarazione
   =================================== */
.user-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.card-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

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

.card-label {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

.card-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

.exercise-objectives {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1.5rem 0;
}

.exercise-objectives h5 {
    margin-top: 0;
    color: var(--accent-primary);
}

.exercise-objectives ol {
    margin-bottom: 0;
    padding-left: 1.5rem;
}

.exercise-objectives li {
    margin: 0.75rem 0;
    line-height: 1.6;
}

/* ===================================
   WHY GRID - Perché servono variabili
   =================================== */
.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.why-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.why-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--accent-primary);
}

.why-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.why-card h4 {
    margin: 0.5rem 0;
    color: var(--accent-primary);
}

.why-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .comparison-demo {
        grid-template-columns: 1fr;
    }
    
    .why-grid {
        grid-template-columns: 1fr;
    }
    
    .card-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* ===================================
   TYPE CHECKER
   =================================== */
.type-checker-display {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.type-input {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-family: 'JetBrains Mono', monospace;
}

.type-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.check-btn {
    width: 100%;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--accent-primary);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.check-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3);
}

.type-result {
    margin-top: 1.5rem;
    min-height: 100px;
}

.result-placeholder {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
    font-style: italic;
}

.result-success {
    background: linear-gradient(135deg, #55efc4 0%, #45d4a8 100%);
    padding: 1.5rem;
    border-radius: 8px;
    color: white;
}

.result-error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
    padding: 1.5rem;
    border-radius: 8px;
    color: white;
}

.type-result-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.type-result-info {
    line-height: 2;
}

.type-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 6px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.type-number { background: #74b9ff; color: #0984e3; }
.type-string { background: #ffeaa7; color: #fdcb6e; }
.type-boolean { background: #55efc4; color: #00b894; }
.type-undefined { background: #dfe6e9; color: #636e72; }
.type-object { background: #fab1a0; color: #e17055; }

/* Type Examples Interactive */
.type-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.type-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.type-btn:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

.type-example-display {
    display: none;
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin-top: 1rem;
}

.type-example-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.type-example-icon {
    font-size: 2.5rem;
}

.type-examples-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.type-example-item {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.type-example-item code {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1rem;
    color: var(--accent-primary);
}

.example-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.type-operations {
    background: rgba(99, 102, 241, 0.1);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--accent-primary);
}

/* ===================================
   CALCULATOR
   =================================== */
.calc-container {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
}

.calc-display {
    margin-bottom: 1.5rem;
}

.calc-screen {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    text-align: right;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.calc-inputs {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.calc-input {
    padding: 1rem;
    font-size: 1.2rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.calc-operator {
    padding: 1rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    background: white;
    cursor: pointer;
}

.calc-btn-big {
    width: 100%;
    padding: 1.25rem;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.calc-btn-big:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.4);
}

.calc-process {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    min-height: 120px;
}

.process-placeholder {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
    font-style: italic;
}

.calc-step {
    padding: 0.75rem;
    background: white;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-primary);
}

.calc-step-result {
    background: linear-gradient(135deg, #55efc4 0%, #45d4a8 100%);
    color: white;
    font-weight: 600;
    border-left-color: #00b894;
}

.calc-result-display {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-label {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.result-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

/* ===================================
   COUNTER PROJECT
   =================================== */
.counter-project {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2.5rem;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.3);
}

.counter-main-display {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 1.5rem;
}

.counter-label {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
}

.counter-big-value {
    font-size: 4rem;
    font-weight: 900;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
}

.counter-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-mini {
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    color: white;
}

.stat-mini-label {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.stat-mini-value {
    font-size: 2rem;
    font-weight: 700;
    font-family: 'JetBrains Mono', monospace;
}

.counter-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.counter-btn {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.counter-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.btn-increment {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
}

.btn-decrement {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.btn-reset {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
}

/* ===================================
   LEARNING BOX
   =================================== */
.learning-box {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

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

.skill-item {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    text-align: center;
}

.skill-icon {
    font-size: 2rem;
    display: block;
    margin-bottom: 0.5rem;
}

.skill-item strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.skill-item p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0;
}

/* ===================================
   PRO TIPS BOX
   =================================== */
.pro-tips-box {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 12px;
    border-left: 4px solid var(--accent-primary);
    margin: 2rem 0;
}

.pro-tips-box h4 {
    margin-top: 0;
    color: var(--accent-primary);
}

.pro-tips-box ul {
    margin-bottom: 0;
}

.pro-tips-box li {
    margin: 1rem 0;
    line-height: 1.6;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 768px) {
    .calc-inputs {
        grid-template-columns: 1fr;
    }
    
    .counter-stats {
        grid-template-columns: 1fr;
    }
    
    .counter-controls {
        grid-template-columns: 1fr;
    }
    
    .skills-grid {
        grid-template-columns: 1fr;
    }
    
    .type-buttons {
        flex-direction: column;
    }
}

/* ===================================
   POINTS DISPLAY - Esercizio Punti
   =================================== */
.points-display {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    color: white;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.3);
}

.points-label {
    font-size: 1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

.points-value {
    font-size: 5rem;
    font-weight: 900;
    font-family: 'JetBrains Mono', monospace;
    line-height: 1;
    margin: 1rem 0;
    transition: all 0.3s ease;
}

.points-sublabel {
    font-size: 0.9rem;
    opacity: 0.8;
}

.exercise-preview {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.exercise-controls {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.exercise-btn {
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.exercise-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
}

.exercise-btn.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.exercise-btn.btn-success {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
}

.exercise-btn.btn-warning {
    background: linear-gradient(135deg, #ffeaa7 0%, #fdcb6e 100%);
    color: #2d3436;
}

/* ===================================
   HINT BOX
   =================================== */
.hint-box {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.hint-btn {
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
    transition: all 0.3s ease;
}

.hint-btn:hover {
    border-color: var(--accent-primary);
    background: var(--accent-primary);
    color: white;
}

.hint-content {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    border-left: 4px solid var(--accent-primary);
}

.hint-content pre {
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-top: 1rem;
}

.hint-content code {
    color: #d4d4d4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

/* ===================================
   PROJECT DISPLAY
   =================================== */
.live-project {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 16px;
    margin: 2rem 0;
}

.project-display {
    background: white;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 2rem;
}

.main-counter {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    color: white;
    margin-bottom: 2rem;
}

.project-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-tertiary);
    padding: 1.5rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--accent-primary);
}

.stat-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.stat-title {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-primary);
    font-family: 'JetBrains Mono', monospace;
}

.project-controls-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 1rem;
    align-items: center;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.project-input {
    padding: 0.75rem;
    font-size: 1.1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
}

.project-btn {
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: white;
}

.project-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.project-btn.btn-success {
    background: linear-gradient(135deg, #55efc4 0%, #00b894 100%);
}

.project-btn.btn-warning {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
}

.project-btn.btn-secondary {
    background: linear-gradient(135deg, #74b9ff 0%, #0984e3 100%);
}

.project-code-section {
    margin-top: 2rem;
}

.project-code-section h4 {
    margin-bottom: 1rem;
}

/* ===================================
   RECAP & ACHIEVEMENT BOXES
   =================================== */
.recap-box {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.recap-list {
    margin: 1.5rem 0 0 0;
    padding-left: 1.5rem;
}

.recap-list li {
    margin: 1rem 0;
    line-height: 1.6;
}

.achievement-box {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

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

.achievement-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.achievement-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--accent-primary);
}

.achievement-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.achievement-card h4 {
    margin: 0.5rem 0;
    color: var(--accent-primary);
}

.achievement-card p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ===================================
   DOWNLOAD BOXES
   =================================== */
.download-box-main {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    color: white;
    margin: 2rem 0;
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.3);
}

.download-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.download-box-main h3 {
    margin: 1rem 0;
}

.download-box-main p {
    margin: 1rem 0;
    opacity: 0.9;
}

.btn-download-big,
.btn-download-cta {
    display: inline-block;
    padding: 1.25rem 3rem;
    font-size: 1.3rem;
    font-weight: 700;
    background: white;
    color: var(--accent-primary);
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.3s ease;
    margin: 1rem 0;
}

.btn-download-big:hover,
.btn-download-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.3);
}

.download-note {
    font-size: 0.9rem;
    opacity: 0.8;
}

.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.exercise-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    border: 2px solid var(--border-color);
    transition: all 0.3s ease;
}

.exercise-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    border-color: var(--accent-primary);
}

.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.exercise-number {
    font-size: 3rem;
    font-weight: 900;
    color: var(--accent-primary);
    opacity: 0.2;
    line-height: 1;
}

.exercise-difficulty {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.difficulty-badge,
.time-badge {
    padding: 0.4rem 0.8rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
}

.difficulty-badge.easy {
    background: #55efc4;
    color: #00b894;
}

.difficulty-badge.medium {
    background: #ffeaa7;
    color: #fdcb6e;
}

.difficulty-badge.hard {
    background: #ff6b6b;
    color: #d63031;
}

.time-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.exercise-description {
    color: var(--text-secondary);
    margin: 1rem 0;
    line-height: 1.6;
}

.exercise-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.feature {
    padding: 0.4rem 0.8rem;
    background: var(--bg-tertiary);
    border-radius: 6px;
    font-size: 0.85rem;
}

.instructions-download {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.download-steps {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.download-steps li {
    margin: 1.5rem 0;
    line-height: 1.8;
}

.whats-included {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

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

.included-item {
    text-align: center;
    padding: 1.5rem;
    background: var(--bg-tertiary);
    border-radius: 8px;
}

.included-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.pro-tips-download {
    background: var(--bg-tertiary);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.tip-box {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin: 1rem 0;
    border-left: 4px solid var(--accent-primary);
}

.tip-box strong {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--accent-primary);
}

.cta-download {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    color: white;
    margin: 2rem 0;
}

.cta-note {
    opacity: 0.9;
    margin-top: 1rem;
}

/* ===================================
   NEXT LESSON & FEEDBACK BOXES
   =================================== */
.next-lesson-box {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    color: white;
    margin: 2rem 0;
}

.next-lesson-box h3 {
    margin-top: 0;
}

.btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.3rem;
    margin-top: 1.5rem;
}

.feedback-box {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 12px;
    margin: 2rem 0;
}

.feedback-box h3 {
    color: var(--accent-primary);
}

.feedback-box ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.feedback-box li {
    margin: 1rem 0;
    line-height: 1.6;
}

/* ===================================
   RESPONSIVE
   =================================== */
@media (max-width: 968px) {
    .project-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .project-controls-grid {
        grid-template-columns: 1fr;
    }
    
    .achievements-grid {
        grid-template-columns: 1fr;
    }
    
    .exercises-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .exercise-controls {
        grid-template-columns: 1fr;
    }
    
    .project-stats {
        grid-template-columns: 1fr;
    }
    
    .included-grid {
        grid-template-columns: 1fr;
    }
}


/* ===================================
   FIX CALCOLATRICE - Testo invisibile
   =================================== */

/* Fix calc-step - testo visibile */
.calc-step {
    padding: 0.75rem 1rem;
    background: white;
    margin-bottom: 0.5rem;
    border-radius: 6px;
    border-left: 4px solid var(--accent-primary);
    color: #1e293b !important; /* FIX: forza colore scuro */
    line-height: 1.6;
}

.calc-step strong {
    color: var(--accent-primary) !important;
    font-weight: 700;
}

.calc-step code {
    background: #f8f9fa;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    color: #2d3436 !important; /* FIX: codice scuro leggibile */
    font-weight: 600;
}

/* calc-step-result rimane com'è (sfondo verde, testo bianco OK) */
.calc-step-result {
    color: white !important;
}

.calc-step-result strong {
    color: white !important;
}

.calc-step-result code {
    color: white !important;
    background: rgba(255, 255, 255, 0.2);
}

/* ===================================
   FIX SUGGERIMENTI - Chiusi di default
   =================================== */

.hint-content {
    display: none; /* Chiusi di default - si aprono al click */
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    border-left: 4px solid var(--accent-primary);
}

.hint-content p {
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.hint-content pre {
    background: #1e1e1e;
    padding: 1rem;
    border-radius: 6px;
    overflow-x: auto;
    margin-top: 1rem;
}

.hint-content code {
    color: #d4d4d4;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

/* ===================================
   FIX CALC INPUT/OPERATOR - Contrasto
   =================================== */

.calc-input {
    color: #1e293b !important;
    background: white !important;
    font-weight: 600;
}

.calc-input::placeholder {
    color: #94a3b8;
}

.calc-operator {
    color: #1e293b !important;
    background: white !important;
}

/* ===================================
   FIX PROCESS PLACEHOLDER
   =================================== */

.process-placeholder {
    color: var(--text-secondary) !important;
}

/* ===================================
   FIX DARK THEME (se hai dark mode)
   =================================== */

body.dark-theme .calc-step {
    background: #2d3436 !important;
    color: #dfe6e9 !important;
}

body.dark-theme .calc-step code {
    background: #1e272e;
    color: #74b9ff !important;
}

body.dark-theme .hint-content {
    background: #2d3436 !important;
    color: #dfe6e9 !important;
}

body.dark-theme .calc-input,
body.dark-theme .calc-operator {
    background: #1a1a1a !important;
    color: #dfe6e9 !important;
    border-color: #3d3d3d;
}

body.dark-theme .process-placeholder {
    color: #94a3b8 !important;
}