/* ======================================================================
   ECONOMIA OGGI - ULTIMATE THEME (V3.0)
   Designed for Clarity, Speed & Mobile Responsiveness
====================================================================== */

:root {
    /* --- COLOR PALETTE --- */
    --primary: #0f3460;
    --primary-dark: #0a2545;
    --accent: #e94560;
    --accent-glow: rgba(233, 69, 96, 0.5);
    --success: #00b894;
    --danger: #ff7675;
    
    /* --- BACKGROUNDS --- */
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --bg-dark: #1a1a2e;
    
    /* --- TEXT --- */
    --text-main: #2d3436;
    --text-muted: #636e72;
    --text-light: #dfe6e9;

    /* --- DIMENSIONS & SPACING --- */
    --promo-height: 36px;
    --nav-height: 70px;
    --ticker-height: 44px;
    /* Totale altezza header fisso: 36 + 70 + 44 = 150px */
    --header-total-height: 150px; 
}

/* =========================================
   1. RESET & TYPOGRAPHY
========================================= */
body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    /* Spazio vitale per l'header fisso */
    padding-top: var(--header-total-height); 
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Roboto Condensed', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
}

a { text-decoration: none; transition: all 0.2s ease; }

/* =========================================
   2. FIXED HEADER STACK (Promo + Nav + Ticker)
========================================= */

/* A. Promo Bar (Top) */
.promo-bar {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--promo-height);
    background: #000;
    color: rgba(255,255,255,0.85);
    font-size: 0.75rem;
    display: flex; align-items: center;
    z-index: 1050;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* B. Main Navbar (Middle) */
.navbar {
    position: fixed;
    top: var(--promo-height);
    left: 0; width: 100%;
    height: var(--nav-height);
    background: rgba(15, 52, 96, 0.95);
    backdrop-filter: blur(12px); /* Glassmorphism */
    -webkit-backdrop-filter: blur(12px);
    z-index: 1040;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    padding: 0; /* Reset padding BS */
}

.navbar-brand .logo-icon-box {
    width: 38px; height: 38px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: white; margin-right: 10px;
    font-size: 1.1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.navbar-brand .logo-text {
    color: #fff; font-size: 1.25rem; font-weight: 800; text-transform: uppercase;
}
.text-accent { color: var(--accent); }

.nav-link {
    color: rgba(255,255,255,0.8) !important;
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0 15px !important;
    height: var(--nav-height);
    display: flex; align-items: center;
    border-bottom: 2px solid transparent;
}
.nav-link:hover, .nav-link.active {
    color: #fff !important;
    background: rgba(255,255,255,0.05);
    border-bottom-color: var(--accent);
}

/* C. Ticker Tape (Bottom of Header) */
.ticker-wrap {
    position: fixed;
    top: calc(var(--promo-height) + var(--nav-height));
    left: 0; width: 100%;
    height: var(--ticker-height);
    background: #08111d; /* Darker than primary */
    color: #fff;
    overflow: hidden;
    z-index: 1030;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    line-height: var(--ticker-height);
}

.ticker {
    display: inline-block;
    white-space: nowrap;
    animation: ticker-scroll 45s linear infinite;
}
.ticker-item {
    display: inline-block;
    padding: 0 1.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    font-family: 'Roboto Condensed', sans-serif;
}
@keyframes ticker-scroll { 0% { transform: translate3d(0, 0, 0); } 100% { transform: translate3d(-50%, 0, 0); } }

/* =========================================
   3. HERO SECTIONS
========================================= */
.hero-dashboard, .super-hero {
    /* Padding ridotto perché padding-top è gestito dal body */
    padding: 40px 0 60px; 
    background: radial-gradient(circle at top right, #1a237e 0%, #000000 90%);
    color: white;
    position: relative;
    overflow: hidden;
}

/* Orb Effects Background */
.hero-dashboard::before {
    content: ''; position: absolute;
    width: 400px; height: 400px;
    background: var(--accent);
    filter: blur(150px); opacity: 0.2;
    top: -100px; right: -100px; border-radius: 50%;
    pointer-events: none;
}

/* =========================================
   4. CARDS & GLASSMORPHISM
========================================= */
.glass-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.glass-card:hover {
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: var(--accent);
}

/* Standard Cards */
.card {
    border-radius: 12px;
    border: none;
    box-shadow: 0 2px 15px rgba(0,0,0,0.04);
    transition: 0.2s;
}
.card:hover { box-shadow: 0 8px 25px rgba(0,0,0,0.08); }

.card-header {
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    padding: 15px 20px;
}

/* =========================================
   WIDGET SIDEBAR (FIX LOGO GIGANTE)
========================================= */
.widget-broker {
    border: none;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    overflow: hidden;
    background: #fff;
}

.widget-broker .card-header {
    background: var(--primary);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 15px;
    border: none;
}

.widget-broker .list-group-item {
    border: none;
    border-bottom: 1px solid #f5f5f5;
    padding: 20px;
    transition: background 0.2s;
}

.widget-broker .list-group-item:last-child { border-bottom: none; }
.widget-broker .list-group-item:hover { background-color: #fafafa; }

/* IL FIX FONDAMENTALE PER IL LOGO */
.broker-logo-container {
    height: 60px; /* Altezza fissa per uniformità */
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.broker-logo-img {
    max-width: 140px;   /* Larghezza massima sicura */
    max-height: 50px;   /* Altezza massima sicura */
    width: auto;
    height: auto;
    object-fit: contain; /* Mantiene le proporzioni senza tagliare */
}

.btn-broker {
    background-color: var(--success);
    color: white;
    font-weight: 700;
    border-radius: 50px;
    padding: 10px 20px;
    font-size: 0.85rem;
    box-shadow: 0 4px 15px rgba(0, 184, 148, 0.3);
    transition: transform 0.2s, box-shadow 0.2s;
    border: none;
}
.btn-broker:hover {
    background-color: #00a383;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 184, 148, 0.4);
}

/* =========================================
   TOP ASSETS HOME (TABELLA PREMIUM)
========================================= */
.crypto-widget-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px; /* Spazio tra le righe */
}

.crypto-widget-table thead th {
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    padding-bottom: 10px;
}

.crypto-widget-table tbody tr {
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.crypto-widget-table tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.08);
    background: #fff;
    z-index: 10;
    position: relative;
}

.crypto-widget-table td {
    padding: 15px 20px;
    border: none;
    vertical-align: middle;
}

/* Arrotondamento bordi riga */
.crypto-widget-table td:first-child { border-top-left-radius: 12px; border-bottom-left-radius: 12px; }
.crypto-widget-table td:last-child { border-top-right-radius: 12px; border-bottom-right-radius: 12px; }

/* Stile asset */
.asset-icon {
    width: 42px; height: 42px;
    border-radius: 50%;
    padding: 2px;
    background: #fff;
    border: 1px solid #eee;
    margin-right: 15px;
    object-fit: cover;
}

/* Pulsante azione tondo */
.btn-action-circle {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: #f8f9fa;
    color: var(--primary);
    display: flex; align-items: center; justify-content: center;
    border: 1px solid #eee;
    transition: 0.2s;
}
.btn-action-circle:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* =========================================
   7. FOOTER
========================================= */
footer {
    background: var(--primary-dark);
    color: rgba(255,255,255,0.7);
    border-top: 4px solid var(--accent);
}
footer h5 { color: #fff; margin-bottom: 1.2rem; }
footer a { color: rgba(255,255,255,0.6); }
footer a:hover { color: #fff; text-decoration: underline; }

/* =========================================
   8. MOBILE OPTIMIZATIONS
========================================= */
@media (max-width: 991px) {
    /* Header Adjustment for Mobile */
    :root { 
        --nav-height: 60px;
        --header-total-height: 140px; 
    }
    
    .navbar-collapse {
        background: var(--primary-dark);
        position: absolute;
        top: var(--nav-height); left: 0;
        width: 100%;
        padding: 20px;
        box-shadow: 0 15px 30px rgba(0,0,0,0.5);
        border-top: 1px solid rgba(255,255,255,0.1);
    }

    .nav-link {
        height: auto;
        padding: 15px 0 !important;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }

    .hero-dashboard h1 { font-size: 2.2rem; }
    
    /* Nascondi colonne meno importanti */
    .table .d-none-mobile { display: none; }
    
    /* Sidebar Broker va sotto il contenuto */
    .sticky-sidebar { position: static; margin-top: 2rem; }
}

/* Button Pulse Animation */
.animate-pulse { animation: pulse-green 2s infinite; }
@keyframes pulse-green {
    0% { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(0, 184, 148, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 184, 148, 0); }
}