/* Importiamo i tuoi token dal tema */
:root {
    --sp-white-glass: rgba(255, 255, 255, 0.92);
    --sp-dark-text: #1a1a1a;
    --sp-green: #2ecc71;
    --sp-red: #e74c3c;
}

/* Contenitore principale ora trasparente */
.sp-container.sp-transparent {
    background: transparent !important;
    padding: 40px 20px;
    min-height: 500px;
    /* Assicuriamoci che i testi base siano ancora visibili se lo sfondo del sito è scuro */
    color: white; 
    font-family: "Glacial Indifference", sans-serif;
}

.sp-main-title, .sp-section-title {
    font-family: "ST Nizhegorodsky", serif;
    font-weight: 400;
    margin-bottom: 30px;
    margin-top: 0;
}
.sp-main-title { font-size: 3rem; }
.sp-section-title { font-size: 2.5rem; margin-top: 50px; }

/* Griglia Card Preferiti */
.sp-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

/* Griglia Card Mercati (Orizzontale) */
.sp-indices-grid {
    display: flex;
    flex-direction: row; /* Layout orizzontale */
    justify-content: space-between;
    gap: 20px;
    margin-top: 20px;
}

/* CARD BIANCA LIQUID GLASS (Base) */
.sp-card, .sp-market-card {
    position: relative;
    background: var(--sp-white-glass);
    border-radius: 24px;
    color: var(--sp-dark-text);
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.4);
    overflow: hidden;
    transition: transform 0.3s ease;
    cursor: pointer;
}

.sp-card:hover, .sp-market-card:hover { transform: translateY(-5px); }

/* Riproduzione del tuo effetto Liquid Sheen sulla card bianca */
.sp-card::before, .sp-market-card::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at 30% 20%, rgba(0,0,0,0.05), transparent 60%);
    animation: liquidSheen 6.5s cubic-bezier(0.22, 1, 0.36, 1) infinite;
    pointer-events: none;
}

/* Stili specifici per Card Preferiti (Quadrate) */
.sp-card {
    width: 200px;
    height: 200px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Stili specifici per Card Mercati (Orizzontali) */
.sp-market-card {
    flex: 1; /* Ognuna prende uno spazio uguale */
    height: 220px; /* Più alte per il grafico */
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.sp-ticker, .sp-market-title {
    font-family: "ST Nizhegorodsky", serif;
    font-size: 2.2rem;
    line-height: 1;
}
.sp-market-title { font-size: 1.8rem; margin-bottom: 10px; }

.sp-change {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 5px;
}
.sp-market-change { font-size: 1.2rem; }

.sp-change.up { color: var(--sp-green); }
.sp-change.down { color: var(--sp-red); }

.sp-name, .sp-market-name {
    font-size: 0.9rem;
    opacity: 0.7;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sp-market-name { margin-bottom: 5px; }

/* Contenitore Grafico Sparkline */
.sp-sparkline {
    width: 100%;
    height: 60px; /* Altezza grafico */
    margin-top: auto;
    background: rgba(0,0,0,0.02); /* Sfondo ultra sottile per il grafico */
    border-radius: 8px;
    display: flex;
    align-items: flex-end;
}

/* Pulsante Rimuovi Preferito */
.sp-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0.3;
    z-index: 10;
}
.sp-remove:hover { opacity: 1; color: var(--sp-red); }

/* Modal & Search */
.sp-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(10px);
    display: none;
    place-items: center;
    z-index: 9999;
}

.sp-modal-content {
    width: 90%;
    max-width: 500px;
    padding: 40px;
    background: rgba(255,255,255,0.1);
    position: relative;
}

.sp-search-box input {
    width: 100%;
    padding: 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 12px;
    color: white;
    margin-top: 20px;
}

.sp-btn-add {
    background: none;
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 12px 24px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.3s;
}

.sp-btn-add:hover { background: white; color: black; }

.sp-results-list { margin-top: 20px; max-height: 300px; overflow-y: auto; }
.sp-res-item {
    padding: 12px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    cursor: pointer;
}
.sp-res-item:hover { background: rgba(255,255,255,0.1); }


/* News & Chat containers */
.sp-news-container, .sp-chat-wrapper {
    margin-top: 30px;
    padding: 25px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.sp-news-title {
    font-family: "ST Nizhegorodsky", serif;
    font-size: 1.8rem;
    margin-bottom: 20px;
}

.sp-news-list {
    list-style: none;
    padding: 0;
}

.sp-news-list li {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.sp-news-list li a {
    text-decoration: none;
    color: white;
    transition: opacity 0.3s;
}

.sp-news-list li a:hover { opacity: 0.7; }

.sp-news-date {
    font-size: 0.7rem;
    color: var(--sp-green);
    text-transform: uppercase;
    display: block;
    margin-bottom: 5px;
}

.sp-news-list p {
    margin: 0;
    font-size: 1rem;
    font-family: "Glacial Indifference", sans-serif;
}