/* ============================================
   Economic Calendar Module v2.0
   Matching Investing.com/Bloomberg Style
   ============================================ */

.calendar-module {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #000000;
    overflow: hidden;
}

/* Header */
.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.calendar-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.calendar-main-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.calendar-main-title i {
    color: #F39C12;
}

.calendar-date-range {
    font-size: 11px;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
}

.calendar-header-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.calendar-header-controls select {
    padding: 6px 24px 6px 10px;
    background: rgba(255, 255, 255, 0.03) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E") no-repeat right 4px center;
    background-size: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    outline: none;
    appearance: none;
}

.calendar-header-controls select:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.calendar-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 4px;
    color: #888;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s;
}

.calendar-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

/* Table Wrapper */
.calendar-table-wrapper {
    flex: 1;
    overflow: auto;
    background: #000000;
}

.calendar-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.calendar-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.calendar-table th {
    background: #000000;
    color: #666;
    font-weight: 500;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    white-space: nowrap;
}

.calendar-table th.text-right {
    text-align: right;
}

.calendar-table th.text-center {
    text-align: center;
}

/* Calendar Rows */
.calendar-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    transition: background 0.15s;
    cursor: pointer;
}

.calendar-row:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.calendar-row:hover {
    background: rgba(255, 255, 255, 0.05);
}

.calendar-row.active,
.calendar-row.highlighted {
    background: rgba(139, 0, 0, 0.2);
}

.calendar-table td {
    padding: 10px 8px;
    color: #C0C4CF;
    vertical-align: middle;
    font-size: 12px;
}

/* Time Cell */
.time-cell {
    width: 50px;
    white-space: nowrap;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

/* Country Cell */
.country-cell {
    width: 40px;
    text-align: center;
}

.country-flag {
    font-size: 16px;
    line-height: 1;
}

/* Currency Cell */
.currency-cell {
    width: 45px;
    color: #888;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

/* Impact Cell */
.impact-cell {
    width: 50px;
}

.impact-dots {
    display: flex;
    gap: 3px;
}

.impact-dot {
    width: 8px;
    height: 8px;
    border-radius: 1px;
    background: #333;
}

.impact-dots.high .impact-dot {
    background: #ef4444;
}

.impact-dots.high .impact-dot:nth-child(3) {
    background: #ef4444;
}

.impact-dots.medium .impact-dot:nth-child(1),
.impact-dots.medium .impact-dot:nth-child(2) {
    background: #f59e0b;
}

.impact-dots.medium .impact-dot:nth-child(3) {
    background: #333;
}

.impact-dots.low .impact-dot:nth-child(1) {
    background: #666;
}

.impact-dots.low .impact-dot:nth-child(2),
.impact-dots.low .impact-dot:nth-child(3) {
    background: #333;
}

/* Event Cell */
.event-cell {
    color: #fff;
    font-weight: 400;
}

/* Data Cells */
.data-cell {
    width: 70px;
    text-align: right;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
}

.data-cell.actual {
    font-weight: 600;
}

.data-cell.positive {
    color: #22c55e;
}

.data-cell.negative {
    color: #ef4444;
}

.data-cell.neutral {
    color: #888;
}

/* Date Separator Row */
.date-separator {
    background: rgba(204, 102, 0, 0.3) !important;
    border-bottom: 1px solid rgba(204, 102, 0, 0.5);
}

.date-separator td {
    color: #fff;
    font-weight: 600;
    font-size: 12px;
    padding: 8px 12px;
}

/* Footer */
.calendar-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    background: #000000;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    font-size: 11px;
    color: #666;
}

.calendar-legend {
    display: flex;
    align-items: center;
    gap: 16px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10px;
    color: #888;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 1px;
}

.legend-dot.high {
    background: #ef4444;
}

.legend-dot.medium {
    background: #f59e0b;
}

.legend-dot.low {
    background: #666;
}

/* Responsive */
@media (max-width: 1200px) {
    .calendar-table td,
    .calendar-table th {
        padding: 8px 6px;
    }
    
    .data-cell {
        width: 60px;
    }
}

@media (max-width: 900px) {
    .data-cell.high,
    .data-cell.low {
        display: none;
    }
    
    .calendar-header-controls select {
        min-width: 80px;
    }
}
