:root {
    /* Light Theme Palette from Logo */
    --bg-base: #ffffff;
    --bg-surface: rgba(245, 245, 245, 0.8);
    --bg-surface-hover: rgba(235, 235, 235, 0.9);
    
    --text-primary: #111111; /* Quasi nero */
    --text-secondary: #4b5563; /* Grigio scuro */
    
    /* Red Accent from Logo */
    --accent-primary: #ff1e1e; /* Rosso acceso del logo */
    --accent-secondary: #cc0000;
    --accent-gradient: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    
    --border-color: rgba(0, 0, 0, 0.1);
    --glass-border: 1px solid rgba(0, 0, 0, 0.05);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.08);
}

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

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Background Ambient Effects - Adattati al tema chiaro */
.background-effects {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15; /* Molto leggero su sfondo bianco */
    animation: float 20s infinite ease-in-out alternate;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: #ff1e1e;
    top: -100px;
    left: -100px;
}

.orb-2 {
    width: 500px;
    height: 500px;
    background: #e5e5e5;
    bottom: -200px;
    right: -100px;
    animation-delay: -5s;
}

.orb-3 {
    width: 300px;
    height: 300px;
    background: #ffaaaa;
    top: 40%;
    left: 40%;
    opacity: 0.1;
    animation-delay: -10s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(50px, 50px) scale(1.1); }
}

/* Layout */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Glassmorphism utility - Tema Chiaro */
.glass-panel {
    background: var(--bg-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: var(--glass-border);
    border-radius: 24px;
    box-shadow: var(--glass-shadow);
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 3rem;
    flex-wrap: wrap;
    gap: 2rem;
    animation: fadeInDown 0.8s ease-out forwards;
    position: relative;
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    letter-spacing: -1px;
}

/* Se c'è un logo come immagine, lo mettiamo in alto a destra */
.logo-container {
    display: flex;
    justify-content: flex-end;
}

.logo-img {
    max-height: 80px;
    object-fit: contain;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Data Loader Area */
.data-loader {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #ffffff;
}

.loader-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.loader-info .icon {
    color: var(--accent-primary);
}

.loader-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

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

/* Status Messages */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    margin-top: 1rem;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.status-badge.error {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

/* Stats Overview */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    padding: 1.5rem;
    transition: transform 0.3s ease;
    background: #ffffff;
}

.stat-card:hover {
    transform: translateY(-5px);
}

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

.stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* Charts Grid */
.charts-grid {
    display: grid;
    grid-template-columns: 1fr; /* Una chart per riga */
    gap: 2rem;
}

.chart-container {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 450px;
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    background: #ffffff;
}

.chart-header {
    margin-bottom: 1.5rem;
}

.chart-question {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
    color: var(--text-primary);
}

.chart-type-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.canvas-wrapper {
    position: relative;
    flex-grow: 1;
    width: 100%;
    min-height: 300px;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 5rem 2rem;
    margin-top: 2rem;
    background: #ffffff;
}

.empty-icon {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    opacity: 0.5;
}

.empty-state h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.empty-state p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto 2rem;
}

/* Animations */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

/* Responsive */
@media (max-width: 768px) {
    .header { flex-direction: column; align-items: flex-start; }
    .logo-container { width: 100%; justify-content: flex-start; margin-bottom: 1rem; }
    .header-content h1 { font-size: 2.2rem; }
    .data-loader { width: 100%; }
}

/* Login Screen */
.login-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-box {
    padding: 3rem;
    text-align: center;
    max-width: 420px;
    width: 90%;
    animation: fadeInUp 0.5s ease-out forwards;
}

.login-logo {
    max-height: 50px;
    margin-bottom: 1.5rem;
}

.login-box h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.login-box p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

#passwordInput {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    font-family: 'Outfit', sans-serif;
    outline: none;
    transition: all 0.3s ease;
    background: #f9f9f9;
}

#passwordInput:focus {
    border-color: var(--accent-primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 30, 30, 0.1);
}

#loginBtn {
    width: 100%;
    padding: 1.1rem;
    font-size: 1.1rem;
}

/* Pulsanti */
.btn-primary {
    background: var(--accent-gradient);
    color: #ffffff;
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 30, 30, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 30, 30, 0.4);
}

.login-error {
    color: #dc2626 !important;
    margin-top: 1rem;
    margin-bottom: 0 !important;
    font-weight: 600;
    display: none;
}
