/**
 * Crypto Price Styles - Multi Fetcher Plugin
 * Version: 3.0.0
 * Professional cryptocurrency market table design
 */

/* ===================================
   MAIN WRAPPER
   =================================== */
.mf-crypto-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    margin: 20px 0;
}

.mf-crypto-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    padding: 20px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.mf-crypto-title {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.mf-crypto-meta {
    display: flex;
    gap: 15px;
    font-size: 13px;
    opacity: 0.9;
}

.mf-crypto-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
}

/* ===================================
   CONTROLS (Search & Sort)
   =================================== */
.mf-crypto-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    flex-wrap: wrap;
    gap: 10px;
}

.mf-crypto-search {
    flex: 1;
    max-width: 300px;
}

.mf-crypto-search-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s;
}

.mf-crypto-search-input:focus {
    outline: none;
    border-color: #4361ee;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.mf-crypto-sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mf-crypto-sort label {
    font-size: 13px;
    color: #6c757d;
    font-weight: 500;
}

.mf-crypto-sort-select {
    padding: 8px 30px 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 13px;
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 10px center;
    cursor: pointer;
    appearance: none;
}

/* ===================================
   TABLE STYLES
   =================================== */
.mf-crypto-table-wrapper {
    overflow-x: auto;
}

.mf-crypto-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.mf-crypto-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mf-crypto-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mf-crypto-table th.mf-crypto-th-rank {
    width: 50px;
    text-align: center;
}

.mf-crypto-table th.mf-crypto-th-price,
.mf-crypto-table th.mf-crypto-th-volume,
.mf-crypto-table th.mf-crypto-th-cap {
    text-align: right;
}

.mf-crypto-table th.mf-crypto-th-change {
    text-align: center;
    width: 80px;
}

.mf-crypto-table td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.mf-crypto-row {
    transition: background 0.15s;
}

.mf-crypto-row:hover {
    background: #f8f9fa;
}

/* Rank column */
.mf-crypto-td-rank {
    text-align: center;
    font-weight: 600;
    color: #6c757d;
    font-size: 13px;
}

/* Coin column */
.mf-crypto-td-coin {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mf-crypto-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
}

.mf-crypto-coin-info {
    display: flex;
    flex-direction: column;
}

.mf-crypto-name {
    font-weight: 600;
    color: #1a1a2e;
    font-size: 14px;
    line-height: 1.3;
}

.mf-crypto-symbol {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

/* Price column */
.mf-crypto-td-price {
    text-align: right;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: #1a1a2e;
}

/* Change columns */
.mf-crypto-td-change {
    text-align: center;
}

.mf-crypto-change {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.mf-crypto-change.up {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.mf-crypto-change.down {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

/* Volume & Cap columns */
.mf-crypto-td-volume,
.mf-crypto-td-cap {
    text-align: right;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: #495057;
    font-size: 13px;
}

/* ===================================
   PAGINATION
   =================================== */
.mf-crypto-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.mf-crypto-page-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: #fff;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.mf-crypto-page-btn:hover:not(:disabled) {
    background: #4361ee;
    border-color: #4361ee;
    color: #fff;
}

.mf-crypto-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.mf-crypto-page-info {
    padding: 0 15px;
    font-size: 14px;
    color: #495057;
}

.mf-crypto-current-page {
    font-weight: 700;
    color: #4361ee;
}

/* ===================================
   FOOTER
   =================================== */
.mf-crypto-footer {
    padding: 12px 20px;
    text-align: center;
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
}

.mf-crypto-footer a {
    color: #4361ee;
    text-decoration: none;
}

/* ===================================
   LOADING STATE
   =================================== */
.mf-crypto-loading {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.mf-crypto-tbody.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ===================================
   COIN CARD STYLES
   =================================== */
.mf-coin-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 16px;
    padding: 24px;
    max-width: 400px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.mf-coin-card-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.mf-coin-card-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #fff;
    padding: 4px;
}

.mf-coin-card-title {
    display: flex;
    flex-direction: column;
}

.mf-coin-card-name {
    font-size: 22px;
    font-weight: 700;
}

.mf-coin-card-symbol {
    font-size: 14px;
    opacity: 0.85;
    font-weight: 500;
}

.mf-coin-card-price {
    margin-bottom: 20px;
    display: flex;
    align-items: baseline;
    gap: 12px;
}

.mf-coin-card-price-value {
    font-size: 32px;
    font-weight: 700;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

.mf-coin-card .mf-crypto-change {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.mf-coin-card .mf-crypto-change.up {
    background: rgba(16, 185, 129, 0.3);
}

.mf-coin-card .mf-crypto-change.down {
    background: rgba(239, 68, 68, 0.3);
}

.mf-coin-card-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.mf-coin-stat {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 12px;
}

.mf-coin-stat-label {
    display: block;
    font-size: 11px;
    opacity: 0.8;
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mf-coin-stat-value {
    font-size: 15px;
    font-weight: 600;
    font-family: 'SF Mono', Monaco, Consolas, monospace;
}

/* ===================================
   COIN INLINE & COMPACT STYLES
   =================================== */
.mf-coin-inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 14px;
}

.mf-coin-inline-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
}

.mf-coin-compact {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    font-size: 14px;
}

.mf-coin-compact-icon {
    width: 24px;
    height: 24px;
    border-radius: 50%;
}

.mf-coin-compact-symbol {
    font-weight: 700;
    color: #1a1a2e;
}

.mf-coin-compact-price {
    font-family: 'SF Mono', Monaco, Consolas, monospace;
    color: #495057;
}

/* ===================================
   COIN FIELD INLINE STYLES
   =================================== */
.mf-coin-field-icon {
    width: 18px;
    height: 18px;
    vertical-align: middle;
    border-radius: 50%;
}

/* ===================================
   CHART WRAPPER
   =================================== */
.mf-coin-chart-wrapper {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    margin: 20px 0;
}

.mf-coin-chart-credit {
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: #6c757d;
    background: #f8f9fa;
}

.mf-coin-chart-credit a {
    color: #4361ee;
    text-decoration: none;
}

/* ===================================
   ERROR STATE
   =================================== */
.mf-coin-error {
    padding: 20px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 8px;
    color: #dc2626;
    text-align: center;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 992px) {
    .mf-crypto-table th.mf-crypto-th-cap,
    .mf-crypto-table td.mf-crypto-td-cap {
        display: none;
    }
}

@media (max-width: 768px) {
    .mf-crypto-header {
        flex-direction: column;
        text-align: center;
    }
    
    .mf-crypto-controls {
        flex-direction: column;
    }
    
    .mf-crypto-search {
        max-width: 100%;
        width: 100%;
    }
    
    .mf-crypto-table th.mf-crypto-th-change:nth-child(4),
    .mf-crypto-table td.mf-crypto-td-change:nth-child(4),
    .mf-crypto-table th.mf-crypto-th-change:nth-child(6),
    .mf-crypto-table td.mf-crypto-td-change:nth-child(6) {
        display: none;
    }
    
    .mf-crypto-table th,
    .mf-crypto-table td {
        padding: 10px 8px;
        font-size: 13px;
    }
    
    .mf-crypto-icon {
        width: 28px;
        height: 28px;
    }
    
    .mf-crypto-name {
        font-size: 13px;
    }
    
    .mf-crypto-pagination {
        flex-wrap: wrap;
    }
    
    .mf-coin-card {
        padding: 18px;
    }
    
    .mf-coin-card-price-value {
        font-size: 26px;
    }
    
    .mf-coin-card-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .mf-crypto-table th.mf-crypto-th-volume,
    .mf-crypto-table td.mf-crypto-td-volume {
        display: none;
    }
    
    .mf-crypto-td-coin {
        gap: 8px;
    }
    
    .mf-crypto-icon {
        width: 24px;
        height: 24px;
    }
    
    .mf-crypto-change {
        padding: 3px 6px;
        font-size: 11px;
    }
}

/* ===================================
   ANIMATIONS
   =================================== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.mf-crypto-row.updated {
    animation: rowHighlight 0.5s ease;
}

@keyframes rowHighlight {
    0% { background: #e0f2fe; }
    100% { background: transparent; }
}

/* Price flash effect */
.mf-crypto-td-price.flash-up {
    animation: flashUp 0.3s ease;
}

.mf-crypto-td-price.flash-down {
    animation: flashDown 0.3s ease;
}

@keyframes flashUp {
    0%, 100% { background: transparent; }
    50% { background: rgba(16, 185, 129, 0.2); }
}

@keyframes flashDown {
    0%, 100% { background: transparent; }
    50% { background: rgba(239, 68, 68, 0.2); }
}
