/**
 * Complete Visual Cards CSS
 * Clean, professional design with Calibri font
 * No emojis, proper spacing, smooth scrolling
 */

/* Base Visual Card Container */
.sffc-visual-card {
    background: #f8f5f0;
    border: 1px solid #d4c4a8;
    border-radius: 6px;
    padding: 18px;
    margin: 12px 0;
    font-family: 'Calibri', 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #2d3748;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    max-height: 500px;
    overflow-y: auto;
    scroll-behavior: smooth;
}

/* Custom scrollbar for visual cards */
.sffc-visual-card::-webkit-scrollbar {
    width: 6px;
}

.sffc-visual-card::-webkit-scrollbar-track {
    background: #e8e2d5;
    border-radius: 3px;
}

.sffc-visual-card::-webkit-scrollbar-thumb {
    background: #a89984;
    border-radius: 3px;
}

.sffc-visual-card::-webkit-scrollbar-thumb:hover {
    background: #8b7355;
}

/* Visual Card Header */
.sffc-visual-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    margin-bottom: 12px;
    border-bottom: 1px solid #2c5282;
}

.sffc-visual-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a365d;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sffc-visual-timestamp {
    font-size: 12px;
    color: #718096;
    font-style: normal;
}

/* Market Headlines */
.sffc-headlines-container {
    margin: 8px 0;
}

.sffc-headline-item {
    display: flex;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #e8e2d5;
}

.sffc-headline-item:last-child {
    border-bottom: none;
}

.sffc-headline-time {
    font-size: 11px;
    color: #718096;
    min-width: 60px;
    flex-shrink: 0;
}

.sffc-headline-content {
    flex: 1;
}

.sffc-headline-text {
    font-size: 13px;
    color: #2d3748;
    margin-bottom: 3px;
    line-height: 1.4;
}

.sffc-headline-impact {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.sffc-headline-impact.positive {
    color: #16a34a;
}

.sffc-headline-impact.negative {
    color: #dc2626;
}

.sffc-headline-impact.neutral {
    color: #6b7280;
}

/* Market Tone */
.sffc-market-tone {
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #e8e2d5;
    font-size: 13px;
}

.sffc-tone-label {
    color: #6b7280;
    font-weight: 600;
}

.sffc-tone-value {
    color: #1a365d;
    font-weight: 600;
    text-transform: uppercase;
}

/* Indices Grid */
.sffc-indices-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.sffc-index-item {
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.sffc-index-name {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 3px;
    text-transform: uppercase;
}

.sffc-index-value {
    font-size: 16px;
    font-weight: bold;
    color: #1a365d;
    margin-bottom: 2px;
}

.sffc-index-change {
    font-size: 13px;
    font-weight: 500;
}

.sffc-index-change.up {
    color: #16a34a;
}

.sffc-index-change.down {
    color: #dc2626;
}

/* Commodity Grid */
.sffc-commodity-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.sffc-commodity-section {
    background: white;
    padding: 12px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.sffc-commodity-title {
    font-size: 13px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
}

.sffc-commodity-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 12px;
}

.sffc-commodity-name {
    color: #4a5568;
    font-weight: 500;
}

.sffc-commodity-price {
    color: #1a365d;
    font-weight: 600;
}

.sffc-commodity-change {
    font-weight: 500;
}

.sffc-commodity-change.positive {
    color: #16a34a;
}

.sffc-commodity-change.negative {
    color: #dc2626;
}

/* Breaking News Section */
.sffc-breaking-section {
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    padding: 12px;
    border-radius: 4px;
    margin-top: 12px;
}

.sffc-breaking-label {
    font-size: 11px;
    font-weight: 700;
    color: #991b1b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

.sffc-breaking-headline {
    font-size: 14px;
    color: #7f1d1d;
    font-weight: 600;
    margin-bottom: 4px;
}

.sffc-breaking-subtext {
    font-size: 12px;
    color: #991b1b;
}

/* Sector Heatmap */
.sffc-sector-heatmap {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 6px;
}

.sffc-sector-tile {
    padding: 10px;
    text-align: center;
    border-radius: 4px;
    cursor: default;
    transition: transform 0.15s ease;
}

.sffc-sector-tile:hover {
    transform: translateY(-2px);
}

.sffc-sector-tile.positive {
    background: #dcfce7;
    border: 1px solid #86efac;
}

.sffc-sector-tile.negative {
    background: #fee2e2;
    border: 1px solid #fca5a5;
}

.sffc-sector-tile.neutral {
    background: #f3f4f6;
    border: 1px solid #d1d5db;
}

.sffc-sector-name {
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 3px;
    color: #374151;
}

.sffc-sector-return {
    font-size: 15px;
    font-weight: bold;
    color: #111827;
}

.sffc-sector-signal {
    font-size: 10px;
    color: #6b7280;
    margin-top: 2px;
}

/* Deals List */
.sffc-deals-list {
    margin: 8px 0;
}

.sffc-deals-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a365d;
    margin: 12px 0 8px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.sffc-deal-item {
    padding: 10px;
    background: white;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    margin-bottom: 8px;
}

.sffc-deal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sffc-deal-buyer {
    font-size: 13px;
    font-weight: 600;
    color: #1a365d;
}

.sffc-deal-value {
    font-size: 13px;
    font-weight: 600;
    color: #059669;
}

.sffc-deal-target {
    font-size: 12px;
    color: #4a5568;
    margin-bottom: 2px;
}

.sffc-deal-sector {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
}

/* Credit Spreads */
.sffc-spreads-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin: 12px 0;
}

.sffc-spread-item {
    background: white;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

.sffc-spread-grade {
    font-size: 12px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 3px;
}

.sffc-spread-value {
    font-size: 18px;
    font-weight: bold;
    color: #1a365d;
}

.sffc-spread-change {
    font-size: 12px;
    font-weight: 500;
    margin-right: 5px;
}

.sffc-spread-change.widening {
    color: #dc2626;
}

.sffc-spread-change.tightening {
    color: #16a34a;
}

.sffc-spread-trend {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
}

/* Default Content (Fallback) */
.sffc-default-content {
    padding: 8px 0;
}

.sffc-data-section {
    margin-bottom: 12px;
}

.sffc-data-label {
    font-size: 12px;
    font-weight: 600;
    color: #1a365d;
    margin-bottom: 6px;
    text-transform: uppercase;
}

.sffc-data-list {
    padding-left: 12px;
}

.sffc-data-list-item {
    font-size: 12px;
    color: #4a5568;
    padding: 3px 0;
}

.sffc-data-item {
    font-size: 12px;
    padding: 4px 0;
}

.sffc-item-key {
    color: #6b7280;
    margin-right: 6px;
}

.sffc-item-value {
    color: #1a365d;
    font-weight: 500;
}

.sffc-item-field {
    display: inline-block;
    margin-right: 8px;
    color: #4a5568;
}

/* Error Card */
.sffc-error-card {
    background: #fef2f2;
    border-color: #fca5a5;
}

.sffc-error-message {
    color: #991b1b;
    font-size: 13px;
    text-align: center;
    padding: 12px;
}

/* Loading Animation */
.sffc-visual-loading {
    min-height: 120px;
    display: block;
    width: 100%;
    margin-top: 15px;
    clear: both;
}

.sffc-visual-loading .sffc-visual-card {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
}

.sffc-loading-spinner {
    width: 24px;
    height: 24px;
    border: 2px solid #e2e8f0;
    border-top-color: #2c5282;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Smooth transitions */
.sffc-visual-card * {
    transition: color 0.15s ease, background-color 0.15s ease;
}

/* Mobile responsiveness */
@media (max-width: 640px) {
    .sffc-visual-card {
        padding: 12px;
        font-size: 13px;
    }
    
    .sffc-visual-title {
        font-size: 14px;
    }
    
    .sffc-indices-grid,
    .sffc-commodity-grid,
    .sffc-spreads-container {
        grid-template-columns: 1fr;
    }
    
    .sffc-sector-heatmap {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Print styles */
@media print {
    .sffc-visual-card {
        box-shadow: none;
        page-break-inside: avoid;
    }
}