/* Crypto Live Widget - Main Styles */
.crypto-live-widget-container,
.crypto-live-shortcode {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    margin: 0 0 20px 0;
    box-sizing: border-box;
}

/* Color Schemes */
.crypto-live-widget-container[data-scheme="light"],
.crypto-live-shortcode[data-scheme="light"] {
    background: #ffffff;
    border: 1px solid #e1e5e9;
    color: #2d3748;
}

.crypto-live-widget-container[data-scheme="dark"],
.crypto-live-shortcode[data-scheme="dark"] {
    background: #1a202c;
    color: #e2e8f0;
}

.crypto-live-widget-container[data-scheme="gradient"],
.crypto-live-shortcode[data-scheme="gradient"] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Header */
.crypto-widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.crypto-live-widget-container[data-scheme="light"] .crypto-widget-header {
    border-bottom-color: #e1e5e9;
}

.crypto-widget-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 16px;
}

.crypto-widget-controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.crypto-update-status {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    opacity: 0.8;
}

.crypto-status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #f59e0b;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.crypto-status-indicator.connected {
    background: #10b981;
    animation: pulse 2s infinite;
}

.crypto-status-indicator.error {
    background: #ef4444;
}

.crypto-refresh-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 6px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: inherit;
    transition: all 0.2s ease;
}

.crypto-refresh-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.crypto-live-widget-container[data-scheme="light"] .crypto-refresh-btn {
    background: #f1f5f9;
    color: #64748b;
}

/* Content */
.crypto-widget-content {
    padding: 15px 20px;
}

.crypto-loading {
    text-align: center;
    padding: 30px 20px;
}

.crypto-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #667eea;
    animation: crypto-spin 1s ease-in-out infinite;
    margin: 0 auto 15px;
}

.crypto-live-widget-container[data-scheme="light"] .crypto-spinner {
    border: 3px solid #e2e8f0;
    border-top-color: #667eea;
}

.crypto-rates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.crypto-rate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.crypto-live-widget-container[data-scheme="light"] .crypto-rate-item {
    background: #f8fafc;
    border: 1px solid #f1f5f9;
}

.crypto-rate-item:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.crypto-live-widget-container[data-scheme="light"] .crypto-rate-item:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
}

.crypto-rate-item.updating {
    animation: highlightUpdate 1s ease;
}

.crypto-coin-info {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 120px;
}

.crypto-coin-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.crypto-live-widget-container[data-scheme="light"] .crypto-coin-icon {
    background: #e2e8f0;
    color: #4a5568;
}

.crypto-coin-details {
    display: flex;
    flex-direction: column;
}

.crypto-coin-name {
    font-weight: 600;
    font-size: 14px;
}

.crypto-coin-symbol {
    font-size: 12px;
    opacity: 0.7;
}

.crypto-price-info {
    text-align: right;
    min-width: 100px;
}

.crypto-price {
    font-weight: 700;
    font-size: 16px;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
}

.crypto-price-change {
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    margin-top: 4px;
    font-weight: 600;
}

.crypto-price-change.positive {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.crypto-price-change.negative {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.crypto-update-time {
    font-size: 11px;
    opacity: 0.6;
    margin-top: 2px;
}

/* Footer */
.crypto-widget-footer {
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.crypto-live-widget-container[data-scheme="light"] .crypto-widget-footer {
    border-top-color: #e2e8f0;
}

.crypto-disclaimer {
    font-size: 11px;
    opacity: 0.6;
}

/* Shortcode specific */
.crypto-shortcode-title {
    margin: 0 0 15px 0;
    padding: 20px 20px 0;
    font-size: 18px;
}

.crypto-update-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.crypto-live-shortcode[data-scheme="light"] .crypto-update-info {
    border-top-color: #e2e8f0;
}

.crypto-manual-refresh {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 5px;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.crypto-manual-refresh:hover {
    opacity: 1;
}

/* Icons */
.crypto-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.crypto-icon-chart {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16z'%3E%3C/path%3E%3Cpolyline points='3.27 6.96 12 12.01 20.73 6.96'%3E%3C/polyline%3E%3Cline x1='12' y1='22.08' x2='12' y2='12'%3E%3C/line%3E%3C/svg%3E");
}

.crypto-icon-refresh {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M23 4v6h-6'%3E%3C/path%3E%3Cpath d='M20.49 15a9 9 0 1 1-2.12-9.36L23 10'%3E%3C/path%3E%3C/svg%3E");
}

/* Animations */
@keyframes crypto-spin {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes highlightUpdate {
    0% { background: rgba(59, 130, 246, 0.3); }
    100% { background: transparent; }
}

/* Responsive */
@media (max-width: 768px) {
    .crypto-live-widget-container,
    .crypto-live-shortcode {
        border-radius: 8px;
    }
    
    .crypto-widget-header {
        padding: 12px 15px;
    }
    
    .crypto-widget-content {
        padding: 12px 15px;
    }
    
    .crypto-rate-item {
        padding: 10px 12px;
    }
    
    .crypto-price {
        font-size: 15px;
    }
}

/* Coin specific colors */
.crypto-rate-item[data-coin='BTC'] .crypto-coin-icon {
    background: rgba(247, 147, 26, 0.2);
    color: #f7931a;
}

.crypto-rate-item[data-coin='ETH'] .crypto-coin-icon {
    background: rgba(98, 126, 234, 0.2);
    color: #627eea;
}

.crypto-rate-item[data-coin='USDT'] .crypto-coin-icon {
    background: rgba(38, 161, 123, 0.2);
    color: #26a17b;
}

.crypto-rate-item[data-coin='SOL'] .crypto-coin-icon {
    background: rgba(0, 0, 0, 0.2);
    color: #000000;
}

/* Дополнительные стили в crypto-widget.css */

/* Сообщения об ошибках и предупреждениях */
.crypto-error-message {
    text-align: center;
    padding: 20px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 8px;
    margin: 10px 0;
}

.crypto-error-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.crypto-retry-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    margin-top: 10px;
    cursor: pointer;
    font-weight: 600;
}

.crypto-retry-btn:hover {
    background: #dc2626;
}

.crypto-warning-message {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    border-radius: 6px;
    padding: 10px 15px;
    margin-bottom: 10px;
    font-size: 13px;
    transition: opacity 0.5s ease;
}

/* Индикаторы статуса */
.crypto-status-indicator.updating {
    animation: pulse 1s infinite;
}

.crypto-status-indicator.retrying {
    background: #f59e0b;
    animation: pulse 0.5s infinite;
}

.crypto-status-indicator.error {
    background: #ef4444;
}

/* Анимации для цен */
@keyframes priceUp {
    0% { color: inherit; }
    50% { color: #10b981; }
    100% { color: inherit; }
}

@keyframes priceDown {
    0% { color: inherit; }
    50% { color: #ef4444; }
    100% { color: inherit; }
}

.price-up {
    animation: priceUp 2s ease;
}

.price-down {
    animation: priceDown 2s ease;
}

/* Плавное появление элементов */
.crypto-rate-item {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Стили для элементов с ошибками */
.crypto-error-item {
    position: relative;
}

.crypto-error-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        transparent 100%);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}