/* Professional Chart Table Widget - Optimized CSS */

.ma-chart-table-wrapper {
    overflow-x: auto;
    margin: 20px 0;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.ma-chart-table {
    width: 100%;
    border-collapse: collapse;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Modern Dark Style */
.ma-chart-table.style-modern {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.ma-chart-table.style-modern thead th {
    background: linear-gradient(135deg, #16213e 0%, #0f172a 100%);
    color: #ffffff;
    position: relative;
}

.ma-chart-table.style-modern thead th::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #4fc3f7, #29b6f6, #03a9f4);
}

/* Classic Light Style */
.ma-chart-table.style-classic {
    background: #ffffff;
    color: #333333;
    border: 1px solid #e0e0e0;
}

.ma-chart-table.style-classic thead th {
    background: #f5f5f5;
    color: #333333;
    border-bottom: 2px solid #4fc3f7;
}

.ma-chart-table.style-classic tbody td {
    color: #333333;
    border-bottom: 1px solid #e0e0e0;
}

.ma-chart-table.style-classic .song-title {
    color: #1976d2;
}

/* Gradient Style */
.ma-chart-table.style-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.ma-chart-table.style-gradient thead th {
    background: rgba(0, 0, 0, 0.2);
    color: #ffffff;
}

.ma-chart-table.style-gradient tbody td {
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Minimal Clean Style */
.ma-chart-table.style-minimal {
    background: transparent;
    border: none;
    box-shadow: none;
}

.ma-chart-table.style-minimal thead th {
    background: transparent;
    color: #333333;
    border-bottom: 2px solid #4fc3f7;
    font-weight: 700;
}

.ma-chart-table.style-minimal tbody td {
    color: #333333;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

/* Header Styles */
.ma-chart-table thead th {
    padding: 20px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    position: relative;
    transition: all 0.3s ease;
}

.ma-chart-table thead th:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Body Styles */
.ma-chart-table tbody td {
    padding: 20px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    vertical-align: top;
}

/* Song Info */
.ma-chart-table .song-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.ma-chart-table .song-title {
    color: #4fc3f7;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.ma-chart-table .artist-name {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 400;
}

.ma-chart-table .release-date {
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-style: italic;
    margin-top: 8px;
    padding: 4px 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    display: inline-block;
}

/* Link Styles */
.ma-chart-table .song-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: all 0.3s ease;
    border-radius: 8px;
    padding: 4px;
    margin: -4px;
}

.ma-chart-table .song-link:hover {
    background: rgba(79, 195, 247, 0.1);
    transform: translateX(4px);
}

.ma-chart-table .song-link:hover .song-title {
    color: #29b6f6;
}

/* Hover Effects */
.ma-chart-table.hover-effects tbody tr {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.ma-chart-table.hover-effects tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.ma-chart-table.hover-effects tbody tr:hover td {
    border-color: rgba(79, 195, 247, 0.3);
}

/* Column Specific Styles */
.ma-chart-table .col-single {
    min-width: 200px;
    max-width: 250px;
}

.ma-chart-table .col-billboard {
    min-width: 120px;
    text-align: center;
    font-weight: 500;
}

.ma-chart-table .col-peak {
    min-width: 140px;
    text-align: center;
    font-weight: 500;
}

.ma-chart-table .col-additional {
    min-width: 200px;
    line-height: 1.6;
}

/* Responsive Design */
.ma-chart-table.responsive-table {
    min-width: 800px;
}

@media (max-width: 1024px) {
    .ma-chart-table-wrapper {
        margin: 15px 0;
    }
    
    .ma-chart-table thead th,
    .ma-chart-table tbody td {
        padding: 16px 12px;
    }
    
    .ma-chart-table .song-title {
        font-size: 15px;
    }
}

@media (max-width: 768px) {
    .ma-chart-table-wrapper {
        margin: 10px 0;
        border-radius: 12px;
    }
    
    .ma-chart-table {
        font-size: 13px;
        border-radius: 12px;
    }
    
    .ma-chart-table thead th,
    .ma-chart-table tbody td {
        padding: 12px 8px;
    }
    
    .ma-chart-table .song-title {
        font-size: 14px;
    }
    
    .ma-chart-table .artist-name {
        font-size: 12px;
    }
    
    .ma-chart-table .col-single {
        min-width: 150px;
    }
    
    .ma-chart-table .col-billboard,
    .ma-chart-table .col-peak {
        min-width: 100px;
    }
    
    .ma-chart-table .col-additional {
        min-width: 160px;
    }
}

@media (max-width: 480px) {
    .ma-chart-table {
        font-size: 12px;
    }
    
    .ma-chart-table thead th,
    .ma-chart-table tbody td {
        padding: 10px 6px;
    }
    
    .ma-chart-table .song-title {
        font-size: 13px;
    }
    
    .ma-chart-table .artist-name {
        font-size: 11px;
    }
    
    .ma-chart-table .release-date {
        font-size: 10px;
    }
}

/* Loading Animation */
.ma-chart-table-wrapper[data-lazy="true"] {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.ma-chart-table-wrapper[data-lazy="true"].loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Animation for rows */
.ma-chart-table tbody tr {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(20px);
}

.ma-chart-table tbody tr:nth-child(1) { animation-delay: 0.1s; }
.ma-chart-table tbody tr:nth-child(2) { animation-delay: 0.2s; }
.ma-chart-table tbody tr:nth-child(3) { animation-delay: 0.3s; }
.ma-chart-table tbody tr:nth-child(4) { animation-delay: 0.4s; }
.ma-chart-table tbody tr:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Print Styles */
@media print {
    .ma-chart-table-wrapper {
        box-shadow: none;
        margin: 0;
    }
    
    .ma-chart-table {
        background: white;
        color: black;
        box-shadow: none;
    }
    
    .ma-chart-table thead th {
        background: #f5f5f5;
        color: black;
    }
    
    .ma-chart-table tbody td {
        color: black;
        border-bottom: 1px solid #ddd;
    }
    
    .ma-chart-table .song-title {
        color: #1976d2;
    }
    
    .ma-chart-table .artist-name {
        color: #666;
    }
}