/* Exchange Rates Dashboard - Frontend Styles */

.exd-frontend-dashboard {
    background: #1a1a1a;
    color: #ffffff;
    border-radius: 12px;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    position: relative;
    overflow: hidden;
}

.exd-frontend-dashboard[data-theme="light"] {
    background: #ffffff;
    color: #333333;
}

/* Loading State */
.exd-loading {
    text-align: center;
    padding: 60px 20px;
    color: #b0b0b0;
}

.exd-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #2a2a2a;
    border-top: 4px solid #00d4aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Currency Selector */
.exd-currency-selector {
    margin-bottom: 30px;
}

.exd-currency-selector h3 {
    color: #ffffff;
    margin-bottom: 15px;
    font-size: 16px;
    font-weight: 600;
}

.exd-frontend-dashboard[data-theme="light"] .exd-currency-selector h3 {
    color: #333333;
}

.exd-currency-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

.exd-currency-btn {
    background: linear-gradient(135deg, #2a2a2a, #3a3a3a);
    border: 2px solid #3a3a3a;
    color: #ffffff;
    padding: 15px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    position: relative;
    overflow: hidden;
}

.exd-currency-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.exd-currency-btn:hover::before {
    left: 100%;
}

.exd-currency-btn:hover {
    background: linear-gradient(135deg, #3a3a3a, #4a4a4a);
    border-color: #00d4aa;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.3);
}

.exd-currency-btn.active {
    background: linear-gradient(135deg, #00d4aa, #00c299);
    border-color: #00d4aa;
    color: #000000;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 212, 170, 0.4);
}

.exd-currency-btn .currency-name {
    display: block;
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.8;
}

.exd-currency-btn .currency-change {
    display: block;
    font-size: 10px;
    margin-top: 2px;
    font-weight: bold;
}

/* Chart Container */
.exd-chart-container {
    background: linear-gradient(135deg, #242424, #2a2a2a);
    border-radius: 16px;
    padding: 25px;
    margin-bottom: 30px;
    position: relative;
    min-height: 400px;
    border: 1px solid #333333;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.exd-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333333;
}

.exd-chart-header h2 {
    color: #ffffff;
    font-size: 22px;
    margin: 0;
    font-weight: 700;
}

#exd-current-rate {
    display: flex;
    align-items: center;
    gap: 12px;
}

.rate-value {
    color: #ffffff;
    font-size: 28px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.exd-change {
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.exd-change.positive {
    background: linear-gradient(135deg, rgba(0, 212, 170, 0.2), rgba(0, 212, 170, 0.3));
    color: #00d4aa;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.exd-change.negative {
    background: linear-gradient(135deg, rgba(255, 82, 82, 0.2), rgba(255, 82, 82, 0.3));
    color: #ff5252;
    border: 1px solid rgba(255, 82, 82, 0.3);
}

#exd-main-chart {
    width: 100% !important;
    height: 300px !important;
}

/* Rates Grid */
.exd-rates-grid {
    margin-top: 30px;
}

.exd-rates-grid h3 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

#exd-rates-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.exd-rate-card {
    background: linear-gradient(135deg, #2a2a2a, #323232);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #3a3a3a;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.exd-rate-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #00d4aa, #00c299);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.exd-rate-card:hover::before {
    transform: scaleX(1);
}

.exd-rate-card:hover {
    border-color: #00d4aa;
    background: linear-gradient(135deg, #323232, #3a3a3a);
    transform: translateY(-4px);
    box-shadow: 0 12px 35px rgba(0, 212, 170, 0.2);
}

.exd-rate-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.exd-rate-pair {
    color: #ffffff;
    font-size: 16px;
    font-weight: bold;
}

.exd-rate-name {
    color: #b0b0b0;
    font-size: 12px;
    margin-top: 2px;
}

.exd-rate-value {
    color: #ffffff;
    font-size: 24px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.exd-rate-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 15px;
}

.exd-rate-change {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
}

/* Currency Converter Styles */
.exd-currency-converter {
    background: linear-gradient(135deg, #242424, #2a2a2a);
    border-radius: 16px;
    padding: 25px;
    margin: 20px 0;
    border: 1px solid #333333;
}

.exd-currency-converter h3 {
    color: #ffffff;
    margin-bottom: 20px;
    font-size: 20px;
    font-weight: 700;
    text-align: center;
}

.exd-converter-row {
    display: grid;
    grid-template-columns: 1fr 1fr auto 1fr;
    gap: 15px;
    align-items: end;
    margin-bottom: 20px;
}

.exd-input-group {
    display: flex;
    flex-direction: column;
}

.exd-input-group label {
    color: #b0b0b0;
    font-size: 12px;
    margin-bottom: 5px;
    font-weight: 600;
}

.exd-input-group input,
.exd-input-group select {
    background: #1a1a1a;
    border: 2px solid #3a3a3a;
    color: #ffffff;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.exd-input-group input:focus,
.exd-input-group select:focus {
    border-color: #00d4aa;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 212, 170, 0.2);
}

.exd-swap-btn button {
    background: #00d4aa;
    border: none;
    color: #000000;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.exd-swap-btn button:hover {
    background: #00c299;
    transform: rotate(180deg);
}

.exd-converter-result {
    text-align: center;
    padding: 20px;
    background: rgba(0, 212, 170, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(0, 212, 170, 0.3);
}

.exd-result-amount {
    color: #00d4aa;
    font-size: 32px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.exd-result-currency {
    color: #ffffff;
    font-size: 18px;
    margin-left: 8px;
}

.exd-conversion-rate {
    color: #b0b0b0;
    font-size: 14px;
    margin-top: 10px;
}

#exd-rate-display {
    color: #00d4aa;
    font-weight: bold;
}

/* Widget Styles */
.exd-rates-widget {
    background: linear-gradient(135deg, #242424, #2a2a2a);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #333333;
    max-width: 400px;
}

.exd-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #333333;
}

.exd-widget-header h4 {
    color: #ffffff;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.exd-last-update {
    color: #b0b0b0;
    font-size: 12px;
}

.exd-widget-rates {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.exd-widget-rate-item {
    display: flex;
    align-items: center;
    padding: 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.exd-widget-rate-item:hover {
    background: rgba(0, 212, 170, 0.1);
    transform: translateX(4px);
}

.exd-currency-flag {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    border-radius: 50%;
    background: #3a3a3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
}

.exd-currency-info {
    flex: 1;
}

.exd-currency-code {
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
}

.exd-currency-name {
    color: #b0b0b0;
    font-size: 12px;
    display: block;
}

.exd-rate-info {
    text-align: right;
}

.exd-rate-value {
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.exd-rate-change {
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 8px;
    font-weight: 600;
    display: block;
    margin-top: 2px;
}

/* Single Rate Display */
.exd-single-rate {
    background: linear-gradient(135deg, #2a2a2a, #323232);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid #3a3a3a;
    display: inline-block;
    min-width: 150px;
    text-align: center;
}

.exd-rate-header .exd-currency-pair {
    color: #b0b0b0;
    font-size: 12px;
    font-weight: 600;
    display: block;
    margin-bottom: 8px;
}

.exd-single-rate .exd-rate-value {
    color: #ffffff;
    font-size: 20px;
    font-weight: bold;
    font-family: 'Courier New', monospace;
}

.exd-single-rate .exd-change {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 10px;
    margin-left: 8px;
}

/* Error States */
.exd-error {
    color: #ff5252;
    background: rgba(255, 82, 82, 0.1);
    padding: 8px 12px;
    border-radius: 6px;
    border: 1px solid rgba(255, 82, 82, 0.3);
    font-size: 14px;
}

/* Light Theme Overrides */
.exd-frontend-dashboard[data-theme="light"] {
    background: #ffffff;
    color: #333333;
}

.exd-frontend-dashboard[data-theme="light"] .exd-currency-btn {
    background: linear-gradient(135deg, #f5f5f5, #e5e5e5);
    color: #333333;
    border-color: #d0d0d0;
}

.exd-frontend-dashboard[data-theme="light"] .exd-currency-btn:hover {
    background: linear-gradient(135deg, #e5e5e5, #d5d5d5);
}

.exd-frontend-dashboard[data-theme="light"] .exd-currency-btn.active {
    background: linear-gradient(135deg, #00d4aa, #00c299);
    color: #ffffff;
}

.exd-frontend-dashboard[data-theme="light"] .exd-chart-container {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-color: #e0e0e0;
}

.exd-frontend-dashboard[data-theme="light"] .exd-chart-header h2,
.exd-frontend-dashboard[data-theme="light"] .rate-value {
    color: #333333;
}

.exd-frontend-dashboard[data-theme="light"] .exd-rate-card {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    border-color: #e0e0e0;
}

.exd-frontend-dashboard[data-theme="light"] .exd-rate-pair,
.exd-frontend-dashboard[data-theme="light"] .exd-rate-value {
    color: #333333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .exd-currency-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .exd-currency-btn {
        width: 100%;
        min-width: auto;
    }
    
    .exd-chart-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    #exd-current-rate {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    #exd-rates-container {
        grid-template-columns: 1fr;
    }
    
    .exd-converter-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .exd-swap-btn {
        order: 3;
        text-align: center;
    }
    
    .exd-swap-btn button {
        transform: rotate(90deg);
    }
    
    .exd-swap-btn button:hover {
        transform: rotate(270deg);
    }
}

@media (max-width: 480px) {
    .exd-frontend-dashboard {
        padding: 15px;
        border-radius: 8px;
    }
    
    .exd-chart-container {
        padding: 15px;
        min-height: 300px;
    }
    
    #exd-main-chart {
        height: 250px !important;
    }
    
    .rate-value {
        font-size: 24px;
    }
    
    .exd-chart-header h2 {
        font-size: 18px;
    }
    
    .exd-rate-card {
        padding: 15px;
    }
}

/* Animation for data updates */
@keyframes dataUpdate {
    0% { background-color: rgba(0, 212, 170, 0.3); }
    100% { background-color: transparent; }
}

.exd-rate-updated {
    animation: dataUpdate 1s ease-out;
}

.exd-currency-updated {
    animation: dataUpdate 1s ease-out;
}

/* Accessibility improvements */
.exd-currency-btn:focus,
.exd-input-group input:focus,
.exd-input-group select:focus {
    outline: 2px solid #00d4aa;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .exd-frontend-dashboard {
        border: 2px solid #ffffff;
    }
    
    .exd-currency-btn {
        border-width: 2px;
    }
    
    .exd-change {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .exd-spinner {
        animation: none;
        border: 4px solid #00d4aa;
    }
}