/**
 * MT5 Economic Calendar Styles
 */

/* Calendar Container */
.mt5ec-calendar-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 20px;
    color: #333;
}

/* Error Message */
.mt5ec-error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-bottom: 20px;
    border: 1px solid #f5c6cb;
}

/* Tabs */
.mt5ec-tabs {
    display: flex;
    border-bottom: 1px solid #ddd;
    margin-bottom: 15px;
}

.mt5ec-tab {
    padding: 8px 15px;
    cursor: pointer;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    margin-right: 5px;
    font-weight: 500;
    transition: background 0.3s;
}

.mt5ec-tab.active {
    background: #fff;
    border-bottom: 1px solid #fff;
    margin-bottom: -1px;
}

.mt5ec-tab input[type="radio"] {
    display: none;
}

/* Date Tabs */
.mt5ec-date-tabs {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 15px;
    gap: 5px;
}

.mt5ec-date-tab {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.mt5ec-date-tab.active {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.mt5ec-calendar-picker-btn,
.mt5ec-filter-btn {
    padding: 6px 10px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

/* Dropdown Filters */
.mt5ec-dropdown-filters {
    display: flex;
    flex-wrap: wrap;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
}

.mt5ec-filter-column {
    flex: 1;
    min-width: 200px;
    padding: 0 10px 10px;
}

.mt5ec-filter-column h4 {
    margin-top: 0;
    margin-bottom: 10px;
    font-size: 15px;
    font-weight: 500;
}

.mt5ec-date-range {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mt5ec-date-range input {
    padding: 6px;
    border: 1px solid #ddd;
    border-radius: 3px;
    flex: 1;
}

.mt5ec-countries-list,
.mt5ec-impact-filters {
    max-height: 200px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.mt5ec-filter-actions {
    width: 100%;
    text-align: right;
    padding: 10px;
    border-top: 1px solid #eee;
    margin-top: 10px;
}

.mt5ec-apply-filters {
    padding: 6px 15px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

/* Impact indicators styling */
.mt5ec-impact {
    padding-left: 5px;
    text-align: center;
}

.mt5ec-impact-filters-row {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.mt5ec-impact-filters-row .mt5ec-apply-filters {
    margin-left: auto;
    padding: 6px 15px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
}

.mt5ec-impact-filters-row .mt5ec-apply-filters:hover {
    background-color: #0069d9;
}

.mt5ec-impact-indicator {
    display: inline-flex;
    align-items: center;
}

.mt5ec-impact-indicator.low {
    color: #28a745;
}

.mt5ec-impact-indicator.medium {
    color: #ffc107;
}

.mt5ec-impact-indicator.high {
    color: #dc3545;
}

.mt5ec-impact-bullet {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 2px;
}

.mt5ec-impact.low .mt5ec-impact-bullet,
.mt5ec-impact-indicator.low .mt5ec-impact-bullet:not(.empty) {
    background-color: #28a745;
}

.mt5ec-impact.medium .mt5ec-impact-bullet,
.mt5ec-impact-indicator.medium .mt5ec-impact-bullet:not(.empty) {
    background-color: #ffc107;
}

.mt5ec-impact.high .mt5ec-impact-bullet,
.mt5ec-impact-indicator.high .mt5ec-impact-bullet:not(.empty) {
    background-color: #dc3545;
}

.mt5ec-impact-bullet.empty {
    border: 1px solid #ccc;
    background-color: transparent;
    width: 7px;
    height: 7px;
}

/* Data Source */
.mt5ec-data-source {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #777;
}

/* Table Styles */
.mt5ec-table-wrapper {
    overflow-x: auto;
    margin-bottom: 20px;
}

.mt5ec-calendar-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 14px;
    background-color: #fff;
    border: 1px solid #ddd;
}

.mt5ec-calendar-table th {
    background-color: #f5f5f5;
    border-bottom: 2px solid #ddd;
    padding: 8px 10px;
    text-align: left;
    font-weight: 600;
    white-space: nowrap;
}

.mt5ec-calendar-table td {
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
}

/* Column width and alignment - matching image layout */
.mt5ec-calendar-table th:nth-child(1),
.mt5ec-calendar-table td:nth-child(1) {
    width: 85px;
    text-align: left;
}

.mt5ec-calendar-table th:nth-child(2),
.mt5ec-calendar-table td:nth-child(2) {
    width: 130px;
    text-align: center;
}

.mt5ec-calendar-table th:nth-child(3),
.mt5ec-calendar-table td:nth-child(3) {
    min-width: 180px;
    text-align: left;
}

.mt5ec-calendar-table th:nth-child(4),
.mt5ec-calendar-table td:nth-child(4),
.mt5ec-calendar-table th:nth-child(5),
.mt5ec-calendar-table td:nth-child(5),
.mt5ec-calendar-table th:nth-child(6),
.mt5ec-calendar-table td:nth-child(6) {
    width: 100px;
    text-align: right;
}

.mt5ec-calendar-table th:nth-child(7),
.mt5ec-calendar-table td:nth-child(7) {
    width: 150px;
    text-align: center;
}

.mt5ec-date-row td {
    background-color: #e6e6e6;
    font-weight: 600;
    padding: 10px 12px;
    border-bottom: 1px solid #ccc;
    border-top: 1px solid #ccc;
    text-align: center;
    font-size: 14px;
    color: #333;
    text-transform: capitalize;
    letter-spacing: 0.3px;
}

.mt5ec-event-row {
    height: 40px;
}

.mt5ec-event-row:nth-child(even) {
    background-color: #f9f9f9;
}

.mt5ec-empty-value {
    color: #999;
}

/* Time column styling */
.mt5ec-time {
    display: flex;
    align-items: center;
    white-space: nowrap;
}

.mt5ec-country-flag {
    width: 16px;
    height: 12px;
    vertical-align: middle;
    border: 1px solid #eee;
    margin-right: 5px;
}

/* Event name styling */
.mt5ec-event-name {
    text-align: left;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Value columns styling */
.mt5ec-actual,
.mt5ec-forecast,
.mt5ec-previous {
    text-align: right;
    font-family: monospace;
}

/* Color coding for numeric values */
.mt5ec-positive-value {
    color: #28a745;
    font-weight: 500;
}

.mt5ec-negative-value {
    color: #dc3545;
    font-weight: 500;
}

.mt5ec-neutral-value {
    color: #333;
}

/* Related instruments column styling */
.mt5ec-instruments {
    text-align: center;
}

/* Currency Tags */
.mt5ec-currency-tag {
    display: inline-block;
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    white-space: nowrap;
}

/* Pagination */
.mt5ec-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.mt5ec-load-more {
    padding: 8px 16px;
    background: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.mt5ec-showing-count {
    font-size: 14px;
    color: #777;
}

/* Loading Spinner */
.mt5ec-loading {
    text-align: center;
    padding: 20px;
}

.mt5ec-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(0, 123, 255, 0.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

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

.mt5ec-no-events {
    text-align: center;
    padding: 30px;
    color: #777;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .mt5ec-filter-column {
        flex: 100%;
    }
    
    .mt5ec-date-tabs {
        overflow-x: auto;
        padding-bottom: 5px;
    }
    
    .mt5ec-calendar-table {
        font-size: 12px;
    }
    
    .mt5ec-calendar-table th:nth-child(5),
    .mt5ec-calendar-table th:nth-child(6),
    .mt5ec-calendar-table th:nth-child(7),
    .mt5ec-calendar-table td:nth-child(5),
    .mt5ec-calendar-table td:nth-child(6),
    .mt5ec-calendar-table td:nth-child(7) {
        display: none;
    }
}

/* Heading */
.mt5ec-heading {
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.mt5ec-heading h2 {
    font-size: 18px;
    margin: 0;
    padding: 0;
    color: #333;
    font-weight: 600;
}

td.mt5ec-impact {
    text-align: center;
}

/* Date Range Picker */
.mt5ec-date-range-picker {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    margin-top: 10px;
    padding: 0;
    width: 100%;
    max-width: 550px;
    z-index: 100;
    position: absolute;
}

.mt5ec-date-picker-header {
    background-color: #f5f5f5;
    border-bottom: 1px solid #ddd;
    padding: 12px 15px;
}

.mt5ec-date-picker-header h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.mt5ec-date-picker-content {
    padding: 15px;
}

.mt5ec-date-picker-inputs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
}

.mt5ec-date-input-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mt5ec-date-input-group label {
    font-weight: 500;
    margin-right: 5px;
    width: 50px;
}

.mt5ec-date-picker-from,
.mt5ec-date-picker-to {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 8px 10px;
    width: 150px;
    font-size: 14px;
}

.mt5ec-date-range-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid #ddd;
    padding-top: 15px;
}

.mt5ec-date-range-cancel {
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    padding: 8px 15px;
    text-align: center;
}

.mt5ec-date-range-submit {
    background-color: #007bff;
    border: none;
    border-radius: 4px;
    color: white;
    cursor: pointer;
    font-weight: 500;
    padding: 8px 15px;
    text-align: center;
}

.mt5ec-date-range-cancel:hover {
    background-color: #e9e9e9;
}

.mt5ec-date-range-submit:hover {
    background-color: #0069d9;
}

@media (max-width: 768px) {
    .mt5ec-date-picker-inputs {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .mt5ec-date-input-group {
        width: 100%;
    }
    
    .mt5ec-date-picker-from,
    .mt5ec-date-picker-to {
        width: 100%;
    }
}

/* Row background colors based on impact */
.mt5ec-high-impact-row {
    background-color: #fff5f5;
}

.mt5ec-medium-impact-row {
    background-color: #fffef5;
}

.mt5ec-low-impact-row {
    background-color: #f5fff5;
}

/* Improve value formatting */
.mt5ec-positive-value {
    color: #28a745;
    font-weight: 500;
}

.mt5ec-negative-value {
    color: #dc3545;
    font-weight: 500;
}

.mt5ec-neutral-value {
    color: #333;
}

/* Table cell padding and alignment */
.mt5ec-actual, 
.mt5ec-forecast, 
.mt5ec-previous {
    text-align: right;
    padding-right: 15px !important;
}

/* Ensure proper spacing for values */
.mt5ec-actual span, 
.mt5ec-forecast span, 
.mt5ec-previous span {
    display: inline-block;
    min-width: 60px;
}

/* Better empty value display */
.mt5ec-empty-value {
    color: #aaa;
    font-style: italic;
}

/* Error value styling */
.mt5ec-error-value {
    color: #aaa;
    font-style: italic;
}

/* Row with error values */
.mt5ec-error-values {
    opacity: 0.9;
}

/* Enhancement for large numbers */
.mt5ec-large-number {
    font-family: monospace;
    letter-spacing: -0.5px;
}

/* Currency multiplier styles */
.mt5ec-currency-multiplier {
    background-color: rgba(47, 133, 90, 0.05) !important;
}

.mt5ec-multiplier-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    background-color: rgba(47, 133, 90, 0.1);
    border-radius: 50%;
    margin-right: 5px;
    vertical-align: middle;
}

.mt5ec-multiplier-badge .dashicons {
    font-size: 14px;
    width: auto;
    height: auto;
    color: #28a745;
}

/* All-day events row styling */
.mt5ec-all-day-row td {
    background-color: #f5f5f5;
    font-weight: 500;
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    text-align: left;
    font-size: 13px;
    color: #555;
}

/* Add margin between date groups */
.mt5ec-date-row {
    margin-top: 15px;
}

/* Add spacing between rows of the same date */
.mt5ec-event-row + .mt5ec-date-row {
    margin-top: 15px;
} 