/* ============================================================
   TF Strategic Trading Desk v1.1 - Styles
   ============================================================ */

/* Reset & Base */
#tf-strategic-desk {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    color: #1a1a2e;
}

#tf-strategic-desk * {
    box-sizing: border-box;
}

/* ============================================================
   HEADER - Stile trading-facile.it (Antracite scuro)
   ============================================================ */
.tf-header {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 30px;
    background: #1e293b;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.tf-header h1 {
    font-size: 28px;
    margin: 0 0 8px 0;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: #ffffff;
}

.tf-header p {
    font-size: 15px;
    margin: 0;
    color: #f8fafc;
    opacity: 0.9;
}

/* Module Layout */
.tf-module {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8f0;
}

.tf-module-header {
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f8;
}

.tf-module-header h2 {
    font-size: 20px;
    margin: 0 0 4px 0;
    font-weight: 600;
    color: #0f0f23;
}

.tf-module-subtitle {
    font-size: 13px;
    color: #8888a0;
}

/* ============================================================
   MODULO 1: Calendario Macro
   ============================================================ */
.tf-calendar-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tf-event-row {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: #f8f8fc;
    border-radius: 10px;
    border-left: 4px solid #d0d0e0;
    transition: all 0.3s ease;
}

.tf-event-row:hover {
    background: #f0f0ff;
    transform: translateX(4px);
}

.tf-event-row.status-upcoming {
    border-left-color: #f59e0b;
    background: #fffdf5;
}

.tf-event-row.status-concluded {
    border-left-color: #22c55e;
    background: #f0fdf4;
}

.tf-event-row.status-future {
    border-left-color: #6366f1;
    background: #f5f3ff;
}

/* Pulse animation - Arancione/Giallo ambra intenso */
.tf-event-row.pulse {
    animation: tf-pulse 2s ease-in-out infinite;
}

@keyframes tf-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

/* Badge lampeggiante - testo scuro su sfondo ambra */
.tf-event-row.status-upcoming .tf-event-status {
    background: #f59e0b;
    color: #1e293b;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    display: inline-block;
}

.tf-event-time {
    min-width: 80px;
    font-size: 16px;
    font-weight: 600;
    color: #0f0f23;
}

.tf-event-hour {
    display: block;
}

.tf-event-date-badge {
    display: inline-block;
    margin-top: 2px;
    font-size: 11px;
    color: #8888a0;
    background: #e8e8f0;
    padding: 1px 6px;
    border-radius: 4px;
}

.tf-event-info {
    flex: 1;
    margin: 0 16px;
}

.tf-event-currency {
    display: inline-block;
    background: #1e293b;
    color: #ffffff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 8px;
}

.tf-event-name {
    font-size: 14px;
    color: #333350;
}

.tf-event-status {
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}

.tf-event-status.status-concluded {
    color: #16a34a;
}

.tf-event-status.status-future {
    color: #4f46e5;
}

/* ============================================================
   MODULO 2: Termometro Volatilità
   ============================================================ */
.tf-volatility-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.tf-market-section {
    background: #f8f8fc;
    border-radius: 12px;
    padding: 16px;
}

.tf-market-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f0f23;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e8e8f0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.tf-volatility-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.tf-volatility-table th {
    text-align: left;
    padding: 8px 10px;
    font-weight: 600;
    color: #666680;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e8e8f0;
}

.tf-volatility-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f8;
    vertical-align: middle;
}

.tf-volatility-table tbody tr {
    transition: background 0.2s ease;
}

.tf-volatility-table tbody tr:hover {
    background: #f0f0ff;
}

.tf-asset-name {
    font-weight: 600;
    color: #1a1a2e;
    display: block;
}

.tf-asset-ticker {
    font-size: 11px;
    color: #8888a0;
    background: #e8e8f0;
    padding: 1px 6px;
    border-radius: 3px;
    margin-top: 2px;
    display: inline-block;
}

.tf-asset-price {
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.tf-asset-change {
    font-weight: 600;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.tf-asset-change.positive {
    color: #16a34a;
}

.tf-asset-change.negative {
    color: #dc2626;
}

.tf-vol-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 6px;
    white-space: nowrap;
}

.tf-vol-badge.vol-high {
    background: #fee2e2;
    color: #dc2626;
}

.tf-vol-badge.vol-low {
    background: #dcfce7;
    color: #16a34a;
}

.tf-vol-badge.vol-normal {
    background: #f3f4f6;
    color: #6b7280;
}

/* ============================================================
   MODULO 3: Matrice Correlazioni Dinamica
   ============================================================ */
.tf-correlation-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tf-correlation-row {
    display: flex;
    align-items: center;
    padding: 16px;
    background: #f8f8fc;
    border-radius: 12px;
    border: 1px solid #e8e8f0;
    transition: all 0.3s ease;
    gap: 16px;
}

.tf-correlation-row:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Alta correlazione positiva (>80%) - Rosso */
.tf-correlation-row.tf-corr-high-pos {
    border-left: 4px solid #dc2626;
}

/* Alta correlazione negativa (<-80%) - Arancione */
.tf-correlation-row.tf-corr-high-neg {
    border-left: 4px solid #f59e0b;
}

/* Correlazione standard (30%-79%) - Neutro */
.tf-correlation-row.tf-corr-normal {
    border-left: 4px solid #94a3b8;
}

.tf-corr-pair {
    min-width: 160px;
}

.tf-corr-asset {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 14px;
}

.tf-corr-vs {
    color: #8888a0;
    margin: 0 6px;
    font-size: 12px;
}

.tf-corr-coefficient {
    min-width: 100px;
    text-align: center;
}

.tf-corr-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    font-family: 'SF Mono', 'Fira Code', monospace;
}

.tf-corr-value.positive {
    color: #16a34a;
}

.tf-corr-value.negative {
    color: #dc2626;
}

.tf-corr-icon {
    display: block;
    font-size: 18px;
    margin-top: 4px;
}

.tf-corr-message {
    flex: 1;
}

.tf-corr-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 4px;
}

/* Badge Rischi Duplicato - Rosso */
.tf-corr-high-pos .tf-corr-badge {
    background: #fee2e2;
    color: #dc2626;
}

/* Badge Rischio Annullamento - Arancione */
.tf-corr-high-neg .tf-corr-badge {
    background: #fef3c7;
    color: #d97706;
}

/* Badge Correlazione Standard - Grigio */
.tf-corr-normal .tf-corr-badge {
    background: #f1f5f9;
    color: #64748b;
}

.tf-corr-message p {
    margin: 4px 0 0 0;
    font-size: 13px;
    color: #555570;
    line-height: 1.4;
}

/* ============================================================
   Admin styles
   ============================================================ */
.tf-admin-card {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tf-admin-card h2 {
    margin: 0 0 12px 0;
    font-size: 18px;
}

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

.tf-admin-card code {
    background: #f0f0f8;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
}

.tf-admin-card label {
    display: block;
    margin: 12px 0 4px 0;
    font-weight: 500;
}

.tf-admin-card input.large-text {
    width: 100%;
    max-width: 600px;
}

/* ============================================================
   RESPONSIVE - Tablet
   ============================================================ */
@media (max-width: 1024px) {
    .tf-volatility-table {
        font-size: 12px;
    }

    .tf-volatility-table th,
    .tf-volatility-table td {
        padding: 8px 6px;
    }
}

/* ============================================================
   RESPONSIVE - Mobile
   ============================================================ */
@media (max-width: 768px) {
    #tf-strategic-desk {
        padding: 12px;
    }

    .tf-header h1 {
        font-size: 22px;
    }

    .tf-module {
        padding: 16px;
        margin-bottom: 16px;
    }

    .tf-module-header h2 {
        font-size: 17px;
    }

    .tf-event-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .tf-event-status {
        align-self: flex-end;
    }

    .tf-correlation-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .tf-corr-pair {
        min-width: auto;
    }

    .tf-corr-coefficient {
        min-width: auto;
        width: 100%;
        text-align: left;
        padding-left: 16px;
    }
}

@media (max-width: 480px) {
    .tf-header {
        padding: 20px 16px;
    }

    .tf-header h1 {
        font-size: 18px;
    }

    .tf-module {
        padding: 12px;
    }

    .tf-volatility-table th {
        display: none;
    }

    .tf-volatility-table tr {
        display: flex;
        flex-wrap: wrap;
        padding: 12px 0;
        border-bottom: 1px solid #e8e8f0;
        gap: 4px;
    }

    .tf-volatility-table td {
        display: block;
        padding: 2px 0;
        border-bottom: none;
    }

    .tf-volatility-table td::before {
        content: attr(data-label);
        font-weight: 600;
        font-size: 11px;
        color: #8888a0;
        display: block;
        margin-bottom: 2px;
    }

    .tf-asset-ticker {
        display: inline;
        margin-left: 4px;
    }
}
