/* Main Plugin Wrapper - Keeps everything compact and centered */
.finviz-plugin-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
}

@media (max-width: 768px) {
    .finviz-plugin-wrapper {
        padding: 0 10px;
    }
}

/* Financial News Header Styles */
.finviz-headlines-header {
    background: linear-gradient(120deg, #020617 0%, #0f172a 40%, #0ea5e9 100%);
    padding: 24px 28px;
    border-radius: 16px 16px 0 0;
    -webkit-border-radius: 16px 16px 0 0;
    -moz-border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9), 0 0 40px rgba(14, 165, 233, 0.4);
    -webkit-box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9), 0 0 40px rgba(14, 165, 233, 0.4);
}

.finviz-headlines-header::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 60%;
    height: 180%;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.6), transparent 60%);
    opacity: 0.4;
    filter: blur(12px);
    -webkit-filter: blur(12px);
    pointer-events: none;
}

.finviz-headlines-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1.5px;
    margin: 0;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.finviz-headlines-wrapper {
    width: 100%;
    margin-bottom: 32px;
}

.finviz-headlines-content {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-top: none;
    border-radius: 0 0 14px 14px;
    -webkit-border-radius: 0 0 14px 14px;
    -moz-border-radius: 0 0 14px 14px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
    -webkit-box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
}

/* Trump Social Posts Tracker Styles */
.finviz-trump-tracker-container {
    margin-top: 32px;
}

.finviz-trump-tracker-header {
    background: linear-gradient(120deg, #0f172a 0%, #0ea5e9 100%);
    padding: 18px 24px;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 8px 24px rgba(14, 165, 233, 0.18);
}

.finviz-trump-tracker-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: 1.2px;
    margin: 0;
    text-transform: uppercase;
}

.finviz-trump-tracker-content {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-top: none;
    border-radius: 0 0 14px 14px;
    padding: 0;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
}

.finviz-trump-tracker-list {
    max-height: 27em;
    min-height: 12em;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px 0 10px 0;
    /* Firefox */
    scrollbar-width: thin;
    scrollbar-color: #0ea5e9 #1e293b;
    /* Smooth scrolling for all browsers */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

/* Webkit browsers (Chrome, Safari, Edge, Opera) */
.finviz-trump-tracker-list::-webkit-scrollbar {
    width: 8px;
    background: #1e293b;
}

.finviz-trump-tracker-list::-webkit-scrollbar-thumb {
    background: #0ea5e9;
    border-radius: 8px;
    -webkit-border-radius: 8px;
}

.finviz-trump-tracker-list::-webkit-scrollbar-thumb:hover {
    background: #38bdf8;
}

.finviz-trump-tracker-item {
    padding: 7px 18px 7px 12px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.08);
    color: #e2e8f0;
    font-size: 13px;
    line-height: 1.25;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: none;
    transition: background 0.2s;
    -webkit-transition: background 0.2s;
    -moz-transition: background 0.2s;
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.finviz-trump-tracker-item:last-child {
    border-bottom: none;
}

.finviz-trump-tracker-date {
    color: #60a5fa;
    font-size: 11px;
    margin-right: 8px;
    font-family: 'JetBrains Mono', monospace;
}

.finviz-trump-tracker-loading {
    color: #64748b;
    text-align: center;
    padding: 24px 0;
    font-size: 14px;
}

/* Calendar container: match news section sizing/centering, but do not affect news section */
.finviz-calendar-container {
    width: 100%;
    margin: 0;
}

.finviz-headline-item {
    padding: 16px 12px;
    margin-bottom: 8px;
    border-radius: 12px;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    border: 1px solid rgba(56, 189, 248, 0.1);
    background: rgba(15, 23, 42, 0.4);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -webkit-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    -moz-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    word-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.finviz-headline-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, #60a5fa, #a78bfa);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.finviz-headline-item:hover {
    background: rgba(30, 58, 138, 0.3);
    border-color: rgba(56, 189, 248, 0.4);
    transform: translateX(4px);
    box-shadow:
        0 4px 12px rgba(0, 0, 0, 0.3),
        0 0 20px rgba(56, 189, 248, 0.2);
}

.finviz-headline-item:hover::before {
    opacity: 1;
}

.finviz-headline-item:last-child {
    margin-bottom: 0;
}

.finviz-headline-link {
    display: flex;
    align-items: flex-start;
    text-decoration: none;
    color: #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.finviz-headline-link:hover {
    color: #ffffff;
    text-decoration: none;
}

.finviz-headline-link:visited {
    color: #94a3b8;
}

.finviz-headline-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-weight: 600;
    font-size: 13px;
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(167, 139, 246, 0.2));
    color: #60a5fa;
    margin-right: 14px;
    border-radius: 8px;
    border: 1px solid rgba(96, 165, 250, 0.3);
    box-shadow: 0 2px 8px rgba(96, 165, 250, 0.2);
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.finviz-headline-item:hover .finviz-headline-number {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.3), rgba(167, 139, 246, 0.3));
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.4);
    transform: scale(1.05);
}

.finviz-headline-text {
    flex: 1;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    font-weight: 400;
    color: #cbd5e1;
    transition: color 0.3s ease;
}

.finviz-headline-item:hover .finviz-headline-text {
    color: #ffffff;
}

.finviz-headlines-footer {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(56, 189, 248, 0.2);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: #64748b;
    flex-wrap: wrap;
    gap: 12px;
    font-family: 'JetBrains Mono', monospace;
}

.finviz-headlines-source {
    font-size: 11px;
    color: #94a3b8;
}

.finviz-headlines-source a {
    color: #60a5fa;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.finviz-headlines-source a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    transition: width 0.3s ease;
}

.finviz-headlines-source a:hover {
    color: #a78bfa;
    text-shadow: 0 0 8px rgba(96, 165, 250, 0.5);
}

.finviz-headlines-source a:hover::after {
    width: 100%;
}

.finviz-headlines-update {
    font-size: 11px;
    color: #64748b;
    font-style: normal;
    display: flex;
    align-items: center;
    gap: 6px;
}

.finviz-headlines-update::before {
    content: '●';
    color: #34d399;
    font-size: 8px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

.finviz-headlines-loading {
    padding: 32px;
    text-align: center;
    color: #94a3b8;
    font-style: normal;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.finviz-headlines-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.finviz-headlines-error {
    padding: 24px;
    text-align: center;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 14px;

    .finviz-headlines-title {
        font-size: 16px;
        letter-spacing: 1px;
    }

    .finviz-headline-text {
        font-size: 14px;
    }

    .finviz-headline-number {
        min-width: 28px;
        height: 28px;
        font-size: 12px;
        margin-right: 12px;
    }

    .finviz-headlines-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .finviz-headline-item {
        padding: 14px 10px;
    }
}

/* Animation for updates */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.finviz-headline-item {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Glow effect on hover for futuristic feel */
.finviz-headline-item:hover {
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.3),
            0 0 20px rgba(56, 189, 248, 0.2);
    }

    50% {
        box-shadow:
            0 4px 12px rgba(0, 0, 0, 0.3),
            0 0 30px rgba(56, 189, 248, 0.4);
    }
}

/* Economic Calendar Styles */

.finviz-calendar-wrapper {
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.finviz-calendar-wrapper .finviz-calendar-header {
    background: linear-gradient(120deg, #020617 0%, #0f172a 40%, #0ea5e9 100%);
    padding: 24px 28px;
    border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 20px 40px rgba(15, 23, 42, 0.9),
        0 0 40px rgba(14, 165, 233, 0.4);
}

.finviz-calendar-wrapper .finviz-calendar-header::before {
    content: '';
    position: absolute;
    top: -40%;
    left: -20%;
    width: 60%;
    height: 180%;
    background: radial-gradient(circle at center, rgba(56, 189, 248, 0.6), transparent 60%);
    opacity: 0.4;
    filter: blur(12px);
    pointer-events: none;
}

.finviz-calendar-title {
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #ffffff;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.finviz-calendar-content {
    background: radial-gradient(circle at top left, rgba(59, 130, 246, 0.10), transparent 55%),
        radial-gradient(circle at bottom right, rgba(14, 165, 233, 0.10), transparent 50%),
        linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(56, 189, 248, 0.18);
    border-top: none;
    border-radius: 0 0 14px 14px;
    padding: 12px 8px 18px 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.5), 0 0 0 1px rgba(56, 189, 248, 0.10);
}

.finviz-calendar-table-container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    margin-bottom: 6px;
    border-radius: 8px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10), 0 0 0 1px rgba(15, 23, 42, 0.10);
    -webkit-box-shadow: 0 1px 4px rgba(15, 23, 42, 0.10), 0 0 0 1px rgba(15, 23, 42, 0.10);
    background: radial-gradient(circle at top, rgba(15, 23, 42, 0.93), rgba(15, 23, 42, 0.98));
    -webkit-overflow-scrolling: touch;
}

.finviz-calendar-table {
    width: 100%;
    min-width: 320px;
    border-collapse: collapse;
    font-size: 12px;
    color: #e2e8f0;
    table-layout: auto;
    margin: 0 auto;
}

.finviz-calendar-table thead {
    background: linear-gradient(90deg, rgba(15, 23, 42, 0.95), rgba(30, 64, 175, 0.75));
}

.finviz-calendar-table th {
    padding: 4px 2px !important;
    text-align: left;
    font-weight: 700;
    color: #60a5fa;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.3px;
    border-bottom: 1.5px solid rgba(56, 189, 248, 0.22);
}

.finviz-calendar-table td {
    padding: 3px 2px !important;
    border-bottom: 1px solid rgba(56, 189, 248, 0.06);
    vertical-align: middle;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

.finviz-calendar-table tbody tr {
    transition: all 0.25s ease;
}

.finviz-calendar-table tbody tr:hover {
    background: radial-gradient(circle at left, rgba(37, 99, 235, 0.18), transparent 55%);
}

.finviz-calendar-table tbody tr.impact-high {
    border-left: 3px solid #ef4444;
}

.finviz-calendar-table tbody tr.impact-medium {
    border-left: 3px solid #f97316;
}

.finviz-calendar-table tbody tr.impact-low {
    border-left: 3px solid #eab308;
}

.calendar-time {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: #94a3b8;
    white-space: nowrap;
}


.calendar-event {
    color: #e2e8f0;
    font-size: 14px;
    max-width: 400px;
}

.calendar-impact {
    text-align: center;
}

.impact-flag {
    font-size: 18px;
    display: inline-block;
    line-height: 1;
}

.finviz-calendar-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(56, 189, 248, 0.25);
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.15);
}

.finviz-calendar-update {
    font-size: 11px;
    color: #64748b;
    font-style: normal;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.finviz-calendar-update::before {
    content: '●';
    color: #34d399;
    font-size: 8px;
    animation: pulse 2s ease-in-out infinite;
}

.finviz-calendar-loading {
    padding: 32px;
    text-align: center;
    color: #94a3b8;
    font-style: normal;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.finviz-calendar-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.finviz-calendar-error {
    padding: 24px;
    text-align: center;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Calendar day/week separators and enhanced styling */
.finviz-calendar-week-range {
    margin-top: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #a5b4fc;
    font-family: 'JetBrains Mono', monospace;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(30, 64, 175, 0.45), rgba(59, 130, 246, 0.35));
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.5);
}

.finviz-calendar-week-range::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.finviz-calendar-week-range-next {
    margin-top: 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding-top: 14px;
}

/* Enhanced day separator for calendar */
.finviz-calendar-day-separator td {
    padding: 10px 6px 4px 6px;
    font-weight: 800 !important;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
    background: linear-gradient(90deg, #0ea5e9 0%, #6366f1 100%);
    border-top: 2.5px solid #38bdf8;
    border-bottom: 1.5px solid #6366f1;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 6px rgba(56, 189, 248, 0.08), 0 1px 0 #6366f1;
    position: relative;
    margin-top: 10px;
}

.finviz-calendar-day-separator td::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8 0%, #6366f1 100%);
    opacity: 0.85;
    border-radius: 0 0 8px 8px;
}

.finviz-calendar-day-separator:hover td {
    background: linear-gradient(90deg, #38bdf8 0%, #6366f1 100%);
    filter: brightness(1.08);
}

.finviz-calendar-table tbody tr.finviz-calendar-day-separator td {
    border-top: 0;
    border-bottom: 0;
}

.finviz-calendar-table tbody tr:not(.finviz-calendar-day-separator) td {
    border-bottom: 1.5px solid rgba(56, 189, 248, 0.18);
    font-size: 15px;
    font-weight: 500;
}

/* Calendar Responsive Design */
@media (max-width: 768px) {
    .finviz-calendar-wrapper {
        margin: 0;
        max-width: 100vw;
    }

    .finviz-calendar-wrapper .finviz-calendar-header {
        padding: 7px 4px;
        border-radius: 7px 7px 0 0;
    }

    .finviz-calendar-content {
        padding: 4px 0 8px 0;
        border-radius: 0 0 7px 7px;
    }

    .finviz-calendar-title {
        font-size: 12px;
        letter-spacing: 0.2px;
    }

    .finviz-calendar-table {
        font-size: 10px;
        min-width: 260px;
        width: 100%;
        max-width: 100vw;
    }

    .finviz-calendar-table th,
    .finviz-calendar-table td {
        padding: 3px 1px;
        font-size: 9px;
    }

    .calendar-event {
        max-width: 90px;
        word-wrap: break-word;
    }
}

/* --- CALENDAR WIDTH & ALIGNMENT FIX --- */
/* removed all calendar wrapper max-width/margin except container */
.finviz-calendar-table {
    table-layout: fixed;
    width: 100%;
    color: #e2e8f0;
    font-size: 14px;
    max-width: 400px;
}

.calendar-impact {
    text-align: center;
}

.impact-flag {
    font-size: 18px;
    display: inline-block;
    line-height: 1;
}

.finviz-calendar-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(56, 189, 248, 0.25);
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.15);
}

.finviz-calendar-update {
    font-size: 11px;
    color: #64748b;
    font-style: normal;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.finviz-calendar-update::before {
    content: '●';
    color: #34d399;
    font-size: 8px;
    animation: pulse 2s ease-in-out infinite;
}

.finviz-calendar-loading {
    padding: 32px;
    text-align: center;
    color: #94a3b8;
    font-style: normal;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.finviz-calendar-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.finviz-calendar-error {
    padding: 24px;
    text-align: center;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Calendar day/week separators and enhanced styling */
.finviz-calendar-week-range {
    margin-top: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #a5b4fc;
    font-family: 'JetBrains Mono', monospace;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(30, 64, 175, 0.45), rgba(59, 130, 246, 0.35));
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.5);
}

.finviz-calendar-week-range::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.finviz-calendar-week-range-next {
    margin-top: 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding-top: 14px;
}

/* Enhanced day separator for calendar */
.finviz-calendar-day-separator td {
    padding: 10px 6px 4px 6px;
    font-weight: 800 !important;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
    background: linear-gradient(90deg, #0ea5e9 0%, #6366f1 100%);
    border-top: 2.5px solid #38bdf8;
    border-bottom: 1.5px solid #6366f1;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 6px rgba(56, 189, 248, 0.08), 0 1px 0 #6366f1;
    position: relative;
    margin-top: 10px;
}

.finviz-calendar-day-separator td::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8 0%, #6366f1 100%);
    opacity: 0.85;
    border-radius: 0 0 8px 8px;
}

.finviz-calendar-day-separator:hover td {
    background: linear-gradient(90deg, #38bdf8 0%, #6366f1 100%);
    filter: brightness(1.08);
}

.finviz-calendar-table tbody tr.finviz-calendar-day-separator td {
    border-top: 0;
    border-bottom: 0;
}

.finviz-calendar-table tbody tr:not(.finviz-calendar-day-separator) td {
    border-bottom: 1.5px solid rgba(56, 189, 248, 0.18);
    font-size: 15px;
    font-weight: 500;
}

/* Calendar Responsive Design */
@media (max-width: 768px) {
    .finviz-calendar-wrapper {
        margin: 0;
        max-width: 100vw;
    }

    .finviz-calendar-wrapper .finviz-calendar-header {
        padding: 7px 4px;
        border-radius: 7px 7px 0 0;
    }

    .finviz-calendar-content {
        padding: 4px 0 8px 0;
        border-radius: 0 0 7px 7px;
    }

    .finviz-calendar-title {
        font-size: 12px;
        letter-spacing: 0.2px;
    }

    .finviz-calendar-table {
        font-size: 10px;
        min-width: 260px;
        width: 100%;
        max-width: 100vw;
    }

    .finviz-calendar-table th,
    .finviz-calendar-table td {
        padding: 3px 1px;
        font-size: 9px;
    }

    .calendar-event {
        max-width: 90px;
        word-wrap: break-word;
    }
}

/* --- CALENDAR WIDTH & ALIGNMENT FIX --- */
/* removed all calendar wrapper max-width/margin except container */
.finviz-calendar-table {
    table-layout: fixed;
    width: 100%;
    color: #e2e8f0;
    font-size: 14px;
    max-width: 400px;
}

.calendar-impact {
    text-align: center;
}

.impact-flag {
    font-size: 18px;
    display: inline-block;
    line-height: 1;
}

.finviz-calendar-footer {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(56, 189, 248, 0.25);
    text-align: center;
    box-shadow: inset 0 1px 0 rgba(148, 163, 184, 0.15);
}

.finviz-calendar-update {
    font-size: 11px;
    color: #64748b;
    font-style: normal;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'JetBrains Mono', monospace;
}

.finviz-calendar-update::before {
    content: '●';
    color: #34d399;
    font-size: 8px;
    animation: pulse 2s ease-in-out infinite;
}

.finviz-calendar-loading {
    padding: 32px;
    text-align: center;
    color: #94a3b8;
    font-style: normal;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.finviz-calendar-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid rgba(96, 165, 250, 0.3);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.finviz-calendar-error {
    padding: 24px;
    text-align: center;
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2);
}

/* Calendar day/week separators and enhanced styling */
.finviz-calendar-week-range {
    margin-top: 10px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #a5b4fc;
    font-family: 'JetBrains Mono', monospace;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    background: linear-gradient(120deg, rgba(30, 64, 175, 0.45), rgba(59, 130, 246, 0.35));
    box-shadow: 0 0 16px rgba(37, 99, 235, 0.5);
}

.finviz-calendar-week-range::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 10px rgba(34, 197, 94, 0.9);
}

.finviz-calendar-week-range-next {
    margin-top: 28px;
    border-top: 1px solid rgba(148, 163, 184, 0.35);
    padding-top: 14px;
}

/* Enhanced day separator for calendar */
.finviz-calendar-day-separator td {
    padding: 10px 6px 4px 6px;
    font-weight: 800 !important;
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: #fff;
    background: linear-gradient(90deg, #0ea5e9 0%, #6366f1 100%);
    border-top: 2.5px solid #38bdf8;
    border-bottom: 1.5px solid #6366f1;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 1px 6px rgba(56, 189, 248, 0.08), 0 1px 0 #6366f1;
    position: relative;
    margin-top: 10px;
}

.finviz-calendar-day-separator td::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 3px;
    background: linear-gradient(90deg, #38bdf8 0%, #6366f1 100%);
    opacity: 0.85;
    border-radius: 0 0 8px 8px;
}

.finviz-calendar-day-separator:hover td {
    background: linear-gradient(90deg, #38bdf8 0%, #6366f1 100%);
    filter: brightness(1.08);
}

.finviz-calendar-table tbody tr.finviz-calendar-day-separator td {
    border-top: 0;
    border-bottom: 0;
}

.finviz-calendar-table tbody tr:not(.finviz-calendar-day-separator) td {
    border-bottom: 1.5px solid rgba(56, 189, 248, 0.18);
    font-size: 15px;
    font-weight: 500;
}

/* Calendar Responsive Design */
@media (max-width: 768px) {
    .finviz-calendar-wrapper {
        margin: 0;
        max-width: 100vw;
    }

    .finviz-calendar-wrapper .finviz-calendar-header {
        padding: 7px 4px;
        border-radius: 7px 7px 0 0;
    }

    .finviz-calendar-content {
        padding: 4px 0 8px 0;
        border-radius: 0 0 7px 7px;
    }

    .finviz-calendar-title {
        font-size: 12px;
        letter-spacing: 0.2px;
    }

    .finviz-calendar-table {
        font-size: 10px;
        min-width: 260px;
        width: 100%;
        max-width: 100vw;
    }

    .finviz-calendar-table th,
    .finviz-calendar-table td {
        padding: 3px 1px;
        font-size: 9px;
    }

    .calendar-event {
        max-width: 90px;
        word-wrap: break-word;
    }
}

/* --- CALENDAR WIDTH & ALIGNMENT FIX --- */
/* removed all calendar wrapper max-width/margin except container */
.finviz-calendar-table {
    table-layout: fixed;
    width: 100%;
    margin: 0 auto;
    max-width: 100%;
}

/* Column Widths */
.finviz-calendar-table th:nth-child(1),
.finviz-calendar-table td:nth-child(1) {
    width: 15%;
    /* Time */
    white-space: nowrap;
}

.finviz-calendar-table th:nth-child(2),
.finviz-calendar-table td:nth-child(2) {
    width: 70%;
    /* Report */
    white-space: nowrap;
    /* Revert wrapping */
    overflow: hidden;
    text-overflow: ellipsis;
}

.finviz-calendar-table th:nth-child(3),
.finviz-calendar-table td:nth-child(3) {
    width: 15%;
    /* Period */
    white-space: nowrap;
}

.finviz-calendar-table th,
.finviz-calendar-table td {
    padding: 10px 8px !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    /* Default for others */
}

.finviz-calendar-table-container {
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.5), 0 0 0 1px rgba(15, 23, 42, 0.7);
}

@media (max-width: 768px) {
    .finviz-calendar-wrapper {
        margin: 20px auto !important;
        max-width: 98vw !important;
    }
}

/* --- END CALENDAR WIDTH & ALIGNMENT FIX --- */

/* Hi
ghlighted Trump posts (trade-related keywords) */
.finviz-trump-tracker-highlighted {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.15), rgba(245, 158, 11, 0.10)) !important;
    border-left: 3px solid #fbbf24 !important;
    padding-left: 9px !important;
}

.finviz-trump-tracker-highlighted .finviz-trump-tracker-date {
    color: #fbbf24;
    font-weight: 600;
}

.finviz-trump-tracker-highlighted .finviz-trump-tracker-text {
    color: #fef3c7;
}


/* Highlighted keywords (not the entire post) */
.keyword-highlight {
    background: linear-gradient(90deg, rgba(251, 191, 36, 0.35), rgba(245, 158, 11, 0.25));
    color: #fbbf24;
    font-weight: 700;
    padding: 2px 4px;
    border-radius: 3px;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
    -webkit-box-shadow: 0 0 8px rgba(251, 191, 36, 0.3);
}


/* Market Charts Section */
.finviz-markets-container {
    margin-top: 32px;
}

.finviz-markets-header {
    background: linear-gradient(120deg, #020617 0%, #0f172a 40%, #10b981 100%);
    padding: 24px 28px;
    border-radius: 16px 16px 0 0;
    -webkit-border-radius: 16px 16px 0 0;
    -moz-border-radius: 16px 16px 0 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9), 0 0 40px rgba(16, 185, 129, 0.4);
    -webkit-box-shadow: 0 20px 40px rgba(15, 23, 42, 0.9), 0 0 40px rgba(16, 185, 129, 0.4);
}

.finviz-markets-header::before {
    content: '';
    position: absolute;
    top: -40%;
    right: -20%;
    width: 60%;
    height: 180%;
    background: radial-gradient(circle at center, rgba(16, 185, 129, 0.6), transparent 60%);
    opacity: 0.4;
    filter: blur(12px);
    -webkit-filter: blur(12px);
    pointer-events: none;
}

.finviz-markets-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1.5px;
    margin: 0;
    text-transform: uppercase;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
}

.finviz-markets-content {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.98) 0%, rgba(15, 23, 42, 0.96) 100%);
    border: 1px solid rgba(16, 185, 129, 0.18);
    border-top: none;
    border-radius: 0 0 14px 14px;
    -webkit-border-radius: 0 0 14px 14px;
    -moz-border-radius: 0 0 14px 14px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
    -webkit-box-shadow: 0 8px 24px rgba(15, 23, 42, 0.3);
}

.finviz-markets-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    width: 100%;
}

.market-chart-item {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 12px;
    -webkit-border-radius: 12px;
    -moz-border-radius: 12px;
    padding: 15px;
    transition: all 0.3s ease;
    -webkit-transition: all 0.3s ease;
    -moz-transition: all 0.3s ease;
}

.market-chart-item:hover {
    border-color: rgba(16, 185, 129, 0.4);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    -webkit-box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
    -webkit-transform: translateY(-2px);
}

.market-chart-title {
    color: #10b981;
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 12px 0;
    text-align: center;
    letter-spacing: 0.5px;
}

.tradingview-widget-container {
    width: 100%;
    height: 400px;
    border-radius: 8px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    overflow: hidden;
}

@media (max-width: 768px) {
    .finviz-markets-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .tradingview-widget-container {
        height: 350px;
    }
}
