/**
 * DDEX Analytics - Frontend Styles
 */

/* Base Shortcode Styles */
.ddex-shortcode {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    margin: 20px 0;
}

/* Chart Container */
.ddex-chart-container {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
}

.ddex-chart-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1d2327;
}

/* Loading State */
.ddex-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.ddex-loading::before {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 10px;
    border: 2px solid #3498db;
    border-top-color: transparent;
    border-radius: 50%;
    animation: ddex-spin 0.8s linear infinite;
    vertical-align: middle;
}

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

/* Error Message */
.ddex-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
}

/* Stats Shortcode */
.ddex-stat-single {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    padding: 30px;
    border-radius: 12px;
    text-align: center;
}

.ddex-stat-label {
    display: block;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
    margin-bottom: 8px;
}

.ddex-stat-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
}

/* Royalty Summary */
.ddex-royalty-summary {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.ddex-stat-box {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.ddex-stat-box .ddex-stat-label {
    color: #6c757d;
    font-size: 12px;
}

.ddex-stat-box .ddex-stat-value {
    color: #2c3e50;
    font-size: 24px;
}

/* Tables */
.ddex-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.ddex-table thead {
    background: #f8f9fa;
}

.ddex-table th,
.ddex-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.ddex-table th {
    font-weight: 600;
    color: #495057;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ddex-table tbody tr:hover {
    background: #f8f9fa;
}

.ddex-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.ddex-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.ddex-status-paid {
    background: #d4edda;
    color: #155724;
}

.ddex-status-pending {
    background: #fff3cd;
    color: #856404;
}

.ddex-status-processing {
    background: #cce5ff;
    color: #004085;
}

/* Top Tracks List */
.ddex-tracks-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ddex-track-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

.ddex-track-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.ddex-track-rank {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #3498db;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
}

.ddex-track-artwork {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.ddex-track-info {
    flex: 1;
    min-width: 0;
}

.ddex-track-title {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ddex-track-artist {
    display: block;
    font-size: 13px;
    color: #6c757d;
    margin-top: 2px;
}

.ddex-track-stats {
    text-align: right;
    flex-shrink: 0;
}

.ddex-track-streams {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

/* Single Track Detail */
.ddex-track-detail {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ddex-track-artwork-large {
    width: 150px;
    height: 150px;
    border-radius: 8px;
    object-fit: cover;
}

.ddex-track-metadata h3 {
    margin: 0 0 5px 0;
    font-size: 24px;
    color: #2c3e50;
}

.ddex-track-metadata p {
    margin: 5px 0;
    color: #6c757d;
}

.ddex-track-performance {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    .ddex-royalty-summary {
        grid-template-columns: 1fr;
    }
    
    .ddex-track-item {
        flex-wrap: wrap;
    }
    
    .ddex-track-stats {
        width: 100%;
        text-align: left;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px solid #eee;
    }
    
    .ddex-track-detail {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .ddex-track-artwork-large {
        margin: 0 auto;
    }
    
    .ddex-track-performance {
        flex-direction: row;
        justify-content: center;
    }
    
    .ddex-stat-value {
        font-size: 28px;
    }
}

@media (max-width: 480px) {
    .ddex-table {
        font-size: 13px;
    }
    
    .ddex-table th,
    .ddex-table td {
        padding: 10px;
    }
}
