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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg,#bcaa72 0%, #bcaa72 100%);
    min-height: 100vh;
    padding: 20px;
}

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

h1 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-size: 2.5em;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.upload-area {
    background: white;
    border: 3px dashed #d0c298;
    border-radius: 15px;
    padding: 60px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.upload-area:hover {
    background: #f0f4ff;
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
}

.upload-area p {
    margin: 15px 0;
    color: #333;
    font-size: 1.2em;
}

#file-input {
    margin-top: 15px;
    padding: 12px 24px;
    background:#d0c298;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.3s;
}

#file-input:hover {
    background: #5568d3;
}

.hidden {
    display: none !important;
}

#loading {
    text-align: center;
    background: white;
    padding: 40px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #d0c298;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

#results {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.data-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.data-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #d0c298;
    font-size: 14px;
}

.data-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 5px;
}

.comparisons-list {
    margin-top: 20px;
}

.comparison-card {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 15px;
    border-radius: 10px;
    border-left: 5px solid #28a745;
    transition: transform 0.2s;
}

.comparison-card:hover {
    transform: translateX(5px);
}

.comparison-card.best {
    background: #d4edda;
    border-left-color: #155724;
    box-shadow: 0 4px 10px rgba(21, 87, 36, 0.1);
}

.comparison-card h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.3em;
}

.comparison-card p {
    margin: 8px 0;
}

.savings {
    font-size: 1.5em;
    color: #28a745;
    font-weight: bold;
    margin: 10px 0;
}

/* ============================================
   STILI PER IL LOG DI DEBUG (NUOVI)
   ============================================ */
#debug-log {
    background: #1e1e1e;
    color: #00ff00;
    padding: 15px;
    margin-top: 20px;
    border-radius: 8px;
    max-height: 250px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    white-space: pre-wrap;
    display: none; /* Nascosto di default */
    border: 1px solid #333;
    box-shadow: 0 4px 10px rgba(0,255,0,0.1);
}

#debug-log div {
    margin-bottom: 3px;
    line-height: 1.4;
}

/* Scrollbar personalizzata per il log */
#debug-log::-webkit-scrollbar {
    width: 8px;
}

#debug-log::-webkit-scrollbar-track {
    background: #2a2a2a;
    border-radius: 4px;
}

#debug-log::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}



.mobile-message {
    display: none;
    background: #fff3cd;
    border: 2px solid #ffc107;
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .upload-area {
        padding: 40px 20px;
    }
    .upload-area p:first-child {
        display: none; /* Nasconde "Trascina qui" su mobile */
    }
    .mobile-message {
        display: block;
    }
    .btn-primary, .btn-secondary {
        display: inline-block !important;
        margin: 5px;
        padding: 12px 24px;
        border: none;
        border-radius: 8px;
        cursor: pointer;
        font-size: 16px;
        width: 90%;
    }
    .btn-primary {
        background: #d0c298;
        color: white;
    }
    .btn-secondary {
        background: #28a745;
        color: white;
    }
}
