.eco-popup-container {
    position: fixed;
    top: 130px;
    right: 20px;
    z-index: 9000;

    width: 50px;
    height: 50px;
    background: radial-gradient(#3b82f6, #1e40af, #1e3a8a);
    color: white;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);

    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
    cursor: pointer;
    animation: pulseEco 2s infinite;
}

@keyframes pulseEco {
    0% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
        transform: scale(1);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(59, 130, 246, 0);
        transform: scale(1.1);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
        transform: scale(1);
    }
}

.eco-popup-container:hover,
.eco-popup-container.active {
    animation: none;
    transform: scale(1.05);
}

/* EXPANDED STATE - WIDER NOW */
.eco-popup-container.active {
    width: 400px;
    /* Increased width for table data */
    height: 500px;
    /* Fixed height for scrolling inside */
    border-radius: 12px;
    background: #0b111a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #e0e6ed;
    cursor: default;
    transform: none;
    display: flex;
    flex-direction: column;
}

.eco-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    position: absolute;
    top: 0;
    right: 0;
    transition: opacity 0.2s;
}

.eco-popup-container.active .eco-icon {
    opacity: 0;
    pointer-events: none;
}

/* Content Layout */
.eco-content {
    opacity: 0;
    padding: 0;
    transition: opacity 0.3s ease 0.1s;
    visibility: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.eco-popup-container.active .eco-content {
    opacity: 1;
    visibility: visible;
}

/* Header */
.eco-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
}

.eco-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #3b82f6;
}

.close-btn {
    font-size: 20px;
    cursor: pointer;
    color: #9ca3af;
}

.close-btn:hover {
    color: white;
}

/* Toolbar */
.eco-toolbar {
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 8px;
    overflow-x: auto;
}

.eco-badge {
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 10px;
    border-radius: 20px;
    color: #9ca3af;
    border: 1px solid transparent;
    cursor: pointer;
    transition: 0.3s;
}

.eco-badge:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Active Filter State */
.eco-badge.active {
    background: rgba(9, 169, 75, 0.2);
    color: #09a94b;
    border-color: #09a94b;
}

.text-green.active {
    background: rgba(239, 68, 68, 0.2);
    /* Red for High Impact Active */
    color: #ef4444;
    border-color: #ef4444;
}

/* Body - Scrollable Area */
.eco-body {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.eco-body::-webkit-scrollbar {
    width: 4px;
}

.eco-body::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 2px;
}

/* Calendar Items */
.date-header {
    background: rgba(255, 255, 255, 0.03);
    padding: 8px 15px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #e0e6ed;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 5;
    backdrop-filter: blur(5px);
}

.eco-date-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #e0e6ed;
    margin-top: 5px;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.eco-row {
    display: grid;
    grid-template-columns: 40px 1fr 70px;
    /* Time | Event | Data */
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    align-items: center;
    transition: background 0.2s;
}

.eco-row:hover {
    background: rgba(255, 255, 255, 0.02);
}

.eco-time-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.eco-time {
    font-size: 0.75rem;
    color: #9ca3af;
}

.eco-flag {
    font-size: 1rem;
}

.eco-event-col {
    display: flex;
    flex-direction: column;
}

.eco-title {
    font-size: 0.85rem;
    font-weight: 600;
    color: #e0e6ed;
    line-height: 1.2;
}

.volatility-bar {
    display: flex;
    gap: 2px;
    margin-top: 4px;
}

.vol-dot {
    width: 12px;
    height: 3px;
    background: #333;
    border-radius: 1px;
}

/* Volatility Levels */
.vol-1 .vol-dot:nth-child(1) {
    background: #facc15;
}

/* Yellow */
.vol-2 .vol-dot:nth-child(1),
.vol-2 .vol-dot:nth-child(2) {
    background: #fb923c;
}

/* Orange */
.vol-3 .vol-dot {
    background: #ef4444;
}

/* Red */

.eco-data-col {
    text-align: right;
    font-size: 0.75rem;
    color: #9ca3af;
    display: flex;
    flex-direction: column;
}

.data-actual {
    font-weight: 700;
    color: white;
    font-size: 0.8rem;
}

.data-actual.better {
    color: #09a94b;
}

.data-actual.worse {
    color: #ef4444;
}

/* Footer */
.eco-footer {
    padding: 10px 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.eco-btn {
    display: block;
    width: 100%;
    padding: 8px;
    background-color: #09a94b;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.3s;
}

.eco-btn:hover {
    background-color: #078c3e;
}

:root[data-theme="light"] .eco-popup-container {
    background: radial-gradient(#60a5fa, #3b82f6, #1d4ed8);
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.2);
}

:root[data-theme="light"] .eco-popup-container.active {
    background: #ffffff;
    border: 1px solid rgba(15, 23, 42, 0.14);
    color: #334155;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.2);
}

:root[data-theme="light"] .eco-header {
    border-bottom: 1px solid rgba(15, 23, 42, 0.1);
    background: rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .eco-header h3 {
    color: #1d4ed8;
}

:root[data-theme="light"] .close-btn {
    color: #64748b;
}

:root[data-theme="light"] .close-btn:hover {
    color: #0f172a;
}

:root[data-theme="light"] .eco-toolbar {
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .eco-badge {
    background: rgba(15, 23, 42, 0.05);
    color: #475569;
}

:root[data-theme="light"] .eco-badge:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

:root[data-theme="light"] .eco-date-header {
    background: rgba(15, 23, 42, 0.06);
    color: #0f172a;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

:root[data-theme="light"] .eco-row {
    border-bottom: 1px solid rgba(15, 23, 42, 0.07);
}

:root[data-theme="light"] .eco-row:hover {
    background: rgba(15, 23, 42, 0.04);
}

:root[data-theme="light"] .eco-time,
:root[data-theme="light"] .eco-data-col {
    color: #64748b;
}

:root[data-theme="light"] .eco-title {
    color: #0f172a;
}

:root[data-theme="light"] .data-actual {
    color: #0f172a;
}

:root[data-theme="light"] .eco-footer {
    border-top: 1px solid rgba(15, 23, 42, 0.1);
}
