* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2c5aa0;
    --secondary-color: #34c759;
    --accent-color: #ff9500;
    --text-color: #333;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --tech-color: #007bff;
    --eco-color: #28a745;
    --legal-color: #dc3545;
    --ethics-color: #6f42c1;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
}

html {
    scroll-behavior: smooth;
}

section[id] {
    scroll-margin-top: 80px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 3rem 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="20" r="1.5" fill="rgba(255,255,255,0.1)"/><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/><circle cx="30" cy="80" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="70" cy="70" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s ease-in-out infinite;
}

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

.header-content {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.header .subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

.breadcrumb {
    background: var(--card-bg);
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.breadcrumb nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: var(--primary-color);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* STILI PER ANALISI COMPARATIVA */
.comparative-analysis {
    background: var(--card-bg);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    margin-bottom: 4rem;
    overflow: hidden;
}

.section-title {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 2rem;
    margin: 0;
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.section-description {
    padding: 2rem;
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
    border-bottom: 1px solid var(--border-color);
}

.subsection-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comparison-table-container {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.comparison-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    min-width: 800px;
}

.comparison-table th,
.comparison-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.metric-header {
    background: #f8f9fa;
    font-weight: 600;
    color: var(--text-color);
    width: 200px;
    position: sticky;
    left: 0;
    z-index: 10;
}

.case-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    text-align: center;
    font-weight: 600;
    color: var(--primary-color);
    width: 180px;
}

.case-header i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.case-header.case-1 { border-top: 4px solid var(--tech-color); }
.case-header.case-2 { border-top: 4px solid var(--eco-color); }
.case-header.case-3 { border-top: 4px solid var(--accent-color); }

.category-row {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
}

.category-title {
    font-weight: 600;
    color: var(--primary-color);
    padding: 1rem !important;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.metric-name {
    font-weight: 500;
    background: #f8f9fa;
    position: sticky;
    left: 0;
    z-index: 5;
}

.score-cell {
    text-align: center;
    position: relative;
}

.score-value {
    font-weight: 700;
    font-size: 1.1rem;
    display: block;
    margin-bottom: 0.5rem;
}

.score-bar {
    width: 100%;
    height: 6px;
    background: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

.score-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 1s ease-in-out;
}

.score-fill.tech { background: var(--tech-color); }
.score-fill.eco { background: var(--eco-color); }
.score-fill.legal { background: var(--legal-color); }
.score-fill.ethics { background: var(--ethics-color); }

.metric-cell {
    text-align: center;
    font-size: 0.9rem;
}

.badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.85rem;
    color: white;
}

.badge.badge-very-high {
    background: linear-gradient(45deg, #28a745, #34ce57);
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.badge.badge-high {
    background: linear-gradient(45deg, #007bff, #4dabf7);
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.badge.badge-medium {
    background: linear-gradient(45deg, #ffc107, #ffcd3c);
    color: #856404;
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.complexity-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.complexity-badge.low {
    background: #d4edda;
    color: #155724;
}

.complexity-badge.medium {
    background: #fff3cd;
    color: #856404;
}

.complexity-badge.high {
    background: #f8d7da;
    color: #721c24;
}

.scalability-icons {
    display: flex;
    gap: 0.2rem;
    justify-content: center;
}

.scalability-icons i {
    font-size: 1rem;
    color: #ddd;
}

.scalability-icons i.filled {
    color: #ffc107;
}

.tension-tag {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.tension-tag.high {
    background: var(--danger-color);
    color: white;
}

.impact-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    margin-bottom: 0.3rem;
}

.impact-badge.very-high {
    background: var(--success-color);
    color: white;
}

.impact-badge.high {
    background: var(--tech-color);
    color: white;
}

.impact-badge.medium {
    background: var(--warning-color);
    color: #856404;
}

/* INSIGHTS SECTION */
.insights-section {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

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

.insight-card {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    border-left: 4px solid;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.insight-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.insight-card.best-practice { border-left-color: var(--success-color); }
.insight-card.challenge { border-left-color: var(--danger-color); }
.insight-card.pattern { border-left-color: var(--tech-color); }
.insight-card.recommendation { border-left-color: var(--accent-color); }

.insight-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.insight-header h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
}

.insight-header i {
    font-size: 1.2rem;
}

.insight-card.best-practice .insight-header i { color: var(--success-color); }
.insight-card.challenge .insight-header i { color: var(--danger-color); }
.insight-card.pattern .insight-header i { color: var(--tech-color); }
.insight-card.recommendation .insight-header i { color: var(--accent-color); }

.insight-content {
    font-size: 0.9rem;
    line-height: 1.5;
    color: #666;
}

.insight-content ul,
.insight-content ol {
    margin: 0.5rem 0 0 1rem;
}

.insight-content li {
    margin: 0.3rem 0;
}

.insight-content strong {
    color: var(--text-color);
}

.insight-content small {
    font-style: italic;
    color: #888;
}

/* METHODOLOGY SECTION */
.methodology-section {
    padding: 2rem;
}

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

.methodology-item {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 12px;
    border-top: 3px solid var(--primary-color);
}

.methodology-item h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.methodology-item ul {
    list-style: none;
    padding: 0;
}

.methodology-item li {
    padding: 0.3rem 0;
    font-size: 0.9rem;
    color: #666;
    border-bottom: 1px solid #e9ecef;
}

.methodology-item li:last-child {
    border-bottom: none;
}

.methodology-item strong {
    color: var(--text-color);
}

/* CASE HEADER MIGLIORATO */
.case-study {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    margin-bottom: 3rem;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease-out;
}

.case-study:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.case-study .case-header {
    display: flex;
    align-items: flex-start;
    gap: 2rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, #ffffff, #f8f9fa);
    border-left: 5px solid var(--primary-color);
    position: relative;
    overflow: hidden;
}

.case-study .case-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(44, 90, 160, 0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.case-study .case-number {
    flex-shrink: 0;
    background: var(--primary-color);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(44, 90, 160, 0.25);
    align-self: flex-start;
    margin-top: 0.5rem;
}

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

.case-study .case-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0 0 1rem 0;
    line-height: 1.3;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.case-study .case-title i {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary-color), rgba(44, 90, 160, 0.8));
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 4px 15px rgba(44, 90, 160, 0.2);
}

.case-study .case-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.7;
    margin: 0;
}

/* Varianti colore per ogni caso */
.case-study#case-1 .case-header {
    border-left-color: var(--tech-color);
    background: linear-gradient(135deg, #ffffff, #e3f2ff);
}

.case-study#case-1 .case-number {
    background: var(--tech-color);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.25);
}

.case-study#case-1 .case-title i {
    background: linear-gradient(135deg, var(--tech-color), rgba(0, 123, 255, 0.8));
}

.case-study#case-2 .case-header {
    border-left-color: var(--eco-color);
    background: linear-gradient(135deg, #ffffff, #e8f5e9);
}

.case-study#case-2 .case-number {
    background: var(--eco-color);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.25);
}

.case-study#case-2 .case-title i {
    background: linear-gradient(135deg, var(--eco-color), rgba(40, 167, 69, 0.8));
}

.case-study#case-3 .case-header {
    border-left-color: var(--accent-color);
    background: linear-gradient(135deg, #ffffff, #fff3e0);
}

.case-study#case-3 .case-number {
    background: var(--accent-color);
    box-shadow: 0 4px 12px rgba(255, 149, 0, 0.25);
}

.case-study#case-3 .case-title i {
    background: linear-gradient(135deg, var(--accent-color), rgba(255, 149, 0, 0.8));
}

/* Animazioni */
.case-study:nth-child(odd) {
    animation-delay: 0.2s;
}

.case-study:nth-child(even) {
    animation-delay: 0.4s;
}

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

/* Hover effects */
.case-study:hover .case-title i {
    transform: scale(1.1) rotate(5deg);
    transition: transform 0.3s ease;
}

.case-study:hover .case-number {
    transform: translateY(-2px);
    transition: transform 0.3s ease;
}

.framework-section {
    padding: 2rem;
    background: #f8f9fa;
}

.framework-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.framework-item {
    background: var(--card-bg);
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

.framework-item:hover {
    transform: translateY(-2px);
}

.framework-item.tech {
    border-left-color: var(--tech-color);
}

.framework-item.eco {
    border-left-color: var(--eco-color);
}

.framework-item.legal {
    border-left-color: var(--legal-color);
}

.framework-item.ethics {
    border-left-color: var(--ethics-color);
}

.framework-label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.framework-label i {
    width: 20px;
    text-align: center;
}

.framework-label.tech { color: var(--tech-color); }
.framework-label.eco { color: var(--eco-color); }
.framework-label.legal { color: var(--legal-color); }
.framework-label.ethics { color: var(--ethics-color); }

.framework-content {
    font-size: 0.95rem;
    color: #666;
    line-height: 1.5;
}

/* ANALISI QUANTITATIVA */
.quantitative-analysis {
    background: linear-gradient(135deg, #f8f9ff, #fff8f9);
    border: 2px solid #e3f2fd;
    border-radius: 16px;
    padding: 2rem;
    margin: 2rem 0;
}

.analysis-title {
    color: var(--primary-color);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.scores-section {
    margin-bottom: 2rem;
}

.scores-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.score-bars {
    display: grid;
    gap: 1rem;
}

.score-bar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.score-label {
    min-width: 100px;
    font-weight: 500;
    font-size: 0.9rem;
}

.score-label.tech { color: var(--tech-color); }
.score-label.eco { color: var(--eco-color); }
.score-label.legal { color: var(--legal-color); }
.score-label.ethics { color: var(--ethics-color); }

.progress-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease-in-out;
}

.progress-fill.tech { background: var(--tech-color); }
.progress-fill.eco { background: var(--eco-color); }
.progress-fill.legal { background: var(--legal-color); }
.progress-fill.ethics { background: var(--ethics-color); }

.score-value {
    min-width: 40px;
    font-weight: 600;
    font-size: 0.9rem;
}

.tensions-section {
    margin-bottom: 2rem;
}

.tensions-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.tension-items {
    display: grid;
    gap: 0.8rem;
}

.tension-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid;
}

.tension-item.high { border-left-color: var(--danger-color); }
.tension-item.medium { border-left-color: var(--warning-color); }
.tension-item.low { border-left-color: var(--success-color); }

.tension-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.tension-badge.high {
    background: var(--danger-color);
    color: white;
}

.tension-badge.medium {
    background: var(--warning-color);
    color: #856404;
}

.tension-badge.low {
    background: var(--success-color);
    color: white;
}

.tension-description {
    flex: 1;
    font-size: 0.9rem;
    color: #666;
}

.factors-section {
    margin-bottom: 2rem;
}

.factors-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.factors-list {
    display: grid;
    gap: 0.5rem;
}

.factor-item {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    font-size: 0.9rem;
}

.factor-icon {
    margin-top: 0.1rem;
    font-size: 1rem;
}

.factor-icon.success {
    color: var(--success-color);
}

.factor-icon.failure {
    color: var(--danger-color);
}

.overall-score {
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.score-badge {
    display: inline-block;
    background: linear-gradient(45deg, #28a745, #34ce57);
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 600;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.score-badge.medium {
    background: linear-gradient(45deg, #ffc107, #ffcd3c);
    color: #856404;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.3);
}

.score-badge.low {
    background: linear-gradient(45deg, #dc3545, #e74c3c);
    color: white;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.papers-section {
    padding: 2rem;
    border-top: 1px solid var(--border-color);
}

.papers-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.papers-list {
    display: grid;
    gap: 1rem;
}

.paper-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    border-left: 3px solid var(--accent-color);
    transition: background-color 0.2s ease;
}

.paper-item:hover {
    background: #e9ecef;
}

.paper-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.paper-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

.highlight-box {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    border: 1px solid #bbdefb;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
}

.highlight-title {
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.highlight-content {
    color: #555;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .header .subtitle {
        font-size: 1rem;
    }
    
    .container {
        padding: 2rem 1rem;
    }
    
    .case-study .case-header {
        flex-direction: column;
        gap: 1rem;
        padding: 2rem 1.5rem;
        text-align: center;
    }
    
    .case-study .case-number {
        align-self: center;
    }
    
    .case-study .case-title {
        flex-direction: column;
        text-align: center;
        font-size: 1.6rem;
    }
    
    .case-study .case-title i {
        width: 56px;
        height: 56px;
        font-size: 1.8rem;
    }
    
    .framework-section, .papers-section, .quantitative-analysis {
        padding: 1.5rem;
    }
    
    .framework-grid, .insights-grid, .methodology-grid {
        grid-template-columns: 1fr;
    }

    .score-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }

    .score-label {
        min-width: auto;
    }

    .section-title {
        font-size: 1.5rem;
        padding: 1.5rem;
    }

    .comparison-table th,
    .comparison-table td {
        padding: 0.5rem;
        font-size: 0.85rem;
    }

    .comparison-table-container {
        padding: 1rem;
    }

    .insights-section,
    .methodology-section {
        padding: 1.5rem;
    }
}