/* Elementor Currency Rates Widget Styles */

/* CSS Custom Properties (set via inline style from widget) */
.ecr-container {
    --ecr-primary: #C6E450;
    --ecr-secondary: #F9FCED;
    --ecr-text: #49580E;
    --ecr-dark: #0E0F0C;
    --ecr-border: #E5E7E5;
    --ecr-radius: 12px;
}

/* Main Container */
.ecr-container {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 32px;
    max-width: 1440px;
    margin: 0 auto;
    padding: 24px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    box-sizing: border-box;
    background: #FFFFFF;
    border-radius: var(--ecr-radius);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* Left Panel */
.ecr-left-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ecr-header {
    text-align: center;
}

.ecr-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--ecr-dark);
    margin: 0 0 12px 0;
}

.ecr-rate-info {
    display: inline-block;
    background: var(--ecr-secondary);
    border-radius: 8px;
    padding: 8px 16px;
}

.ecr-current-rate {
    font-size: 13px;
    font-weight: 600;
    color: var(--ecr-text);
}

/* Input Section */
.ecr-input-section {
    width: 100%;
}

.ecr-input-group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 2px solid var(--ecr-border);
    border-radius: var(--ecr-radius);
    padding: 4px;
    background: #fff;
    transition: border-color 0.2s;
}

.ecr-input-group:focus-within {
    border-color: var(--ecr-primary);
}

.ecr-amount-input {
    flex: 1;
    min-width: 0;
    padding: 12px 16px;
    font-size: 18px;
    font-weight: 700;
    color: var(--ecr-dark);
    border: none;
    background: transparent;
    outline: none;
}

.ecr-amount-input::-webkit-outer-spin-button,
.ecr-amount-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ecr-amount-input[type=number] {
    -moz-appearance: textfield;
}

.ecr-currency-select-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 12px;
}

/* Result Display */
.ecr-result-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
    padding: 16px;
    background: var(--ecr-primary);
    border-radius: var(--ecr-radius);
}

.ecr-result-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--ecr-text);
}

.ecr-result-currency {
    font-size: 16px;
    font-weight: 600;
    color: var(--ecr-text);
}

/* Target Currency Selector in Result */
.ecr-target-currency-wrapper {
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    transition: background 0.2s;
}

.ecr-target-currency-wrapper:hover {
    background: rgba(255, 255, 255, 0.5);
}

.ecr-target-currency-select {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--ecr-text);
    cursor: pointer;
    padding: 2px 0;
    outline: none;
    min-width: 50px;
}

.ecr-target-currency-select option {
    background: #fff;
    color: var(--ecr-dark);
    padding: 8px;
}

.ecr-target-chevron {
    pointer-events: none;
    color: var(--ecr-text);
    opacity: 0.7;
    flex-shrink: 0;
}

.ecr-base-currency {
    appearance: none;
    -webkit-appearance: none;
    background: transparent;
    border: none;
    font-size: 16px;
    font-weight: 700;
    color: var(--ecr-dark);
    cursor: pointer;
    padding: 8px 4px;
    outline: none;
}

.ecr-chevron {
    pointer-events: none;
    color: var(--ecr-dark);
}

/* Currency Filters */
.ecr-currency-filters {
    background: var(--ecr-secondary);
    border-radius: var(--ecr-radius);
    padding: 16px;
}

.ecr-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ecr-text);
    margin-bottom: 12px;
}

.ecr-currency-checkboxes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ecr-checkbox-item {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
}

.ecr-checkbox-item input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--ecr-primary);
    cursor: pointer;
}

.ecr-checkbox-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--ecr-text);
}

/* Rates List */
.ecr-rates-list {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--ecr-border);
    border-radius: var(--ecr-radius);
    overflow: hidden;
}

.ecr-rates-header {
    display: flex;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--ecr-secondary);
    font-size: 11px;
    font-weight: 700;
    color: var(--ecr-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecr-rates-items {
    flex: 1;
    overflow-y: auto;
    max-height: 280px;
}

.ecr-rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ecr-border);
    cursor: pointer;
    transition: background 0.15s;
}

.ecr-rate-item:last-child {
    border-bottom: none;
}

.ecr-rate-item:hover {
    background: var(--ecr-secondary);
}

.ecr-rate-item.active {
    background: var(--ecr-primary);
}

.ecr-rate-item.active .ecr-rate-code,
.ecr-rate-item.active .ecr-rate-value {
    color: var(--ecr-text);
}

.ecr-rate-code {
    font-size: 14px;
    font-weight: 700;
    color: var(--ecr-dark);
}

.ecr-rate-name {
    font-size: 11px;
    font-weight: 400;
    color: #666;
    margin-top: 2px;
}

.ecr-rate-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--ecr-dark);
    text-align: right;
}

.ecr-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #999;
    font-size: 13px;
}

/* Update Info */
.ecr-update-info {
    font-size: 11px;
    color: #999;
    text-align: center;
}

/* Right Panel - Chart */
.ecr-right-panel {
    display: flex;
    flex-direction: column;
    background: var(--ecr-secondary);
    border-radius: var(--ecr-radius);
    padding: 24px;
}

.ecr-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ecr-chart-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ecr-text);
}

.ecr-chart-currency,
.ecr-chart-target {
    color: var(--ecr-text);
}

.ecr-period-buttons {
    display: flex;
    gap: 4px;
    background: #fff;
    border-radius: 8px;
    padding: 4px;
}

.ecr-period-btn {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    color: var(--ecr-text);
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.ecr-period-btn:hover {
    background: var(--ecr-secondary);
}

.ecr-period-btn.active {
    background: var(--ecr-primary);
    color: var(--ecr-text);
}

/* Chart Container */
.ecr-chart-container {
    flex: 1;
    min-height: 300px;
    background: #fff;
    border-radius: var(--ecr-radius);
    padding: 16px;
}

.ecr-chart {
    width: 100% !important;
    height: 100% !important;
}

/* Chart Info */
.ecr-chart-info {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.ecr-chart-value,
.ecr-chart-change {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ecr-value-label,
.ecr-change-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ecr-value-number {
    font-size: 24px;
    font-weight: 700;
    color: var(--ecr-text);
}

.ecr-change-number {
    font-size: 16px;
    font-weight: 600;
    color: var(--ecr-text);
}

.ecr-change-number.positive {
    color: #22C55E;
}

.ecr-change-number.negative {
    color: #EF4444;
}

/* Responsive */
@media (max-width: 1024px) {
    .ecr-container {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .ecr-right-panel {
        order: -1;
    }

    .ecr-chart-container {
        min-height: 250px;
    }
}

@media (max-width: 640px) {
    .ecr-container {
        padding: 16px;
    }

    .ecr-title {
        font-size: 16px;
    }

    .ecr-amount-input {
        font-size: 16px;
        padding: 10px 12px;
    }

    .ecr-period-buttons {
        flex-wrap: wrap;
    }

    .ecr-period-btn {
        padding: 6px 10px;
        font-size: 11px;
    }

    .ecr-chart-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .ecr-chart-container {
        min-height: 200px;
    }

    .ecr-value-number {
        font-size: 20px;
    }

    .ecr-currency-checkboxes {
        gap: 6px;
    }

    .ecr-checkbox-label {
        font-size: 11px;
    }
}