/**
 * Top 10 Frontend Styles
 * Styles for Top 10 Fabrics and Colors display
 */

.tkaniny-top10-container {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Toggle Buttons Header */
.tkaniny-top10-header {
    display: flex;
    gap: 15px;
    margin-bottom: 30px;
    justify-content: center;
}

.tkaniny-top10-toggle {
    background: #FFD700;
    color: #000;
    border: none;
    padding: 15px 40px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 5px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.tkaniny-top10-toggle:hover {
    background: #1E90FF;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.tkaniny-top10-toggle.active {
    background: #1E90FF;
    color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Table Wrapper */
.tkaniny-top10-table-wrapper {
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.tkaniny-top10-table-wrapper.active {
    display: block;
    opacity: 1;
}

/* Table Styles */
.tkaniny-top10-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.tkaniny-top10-table thead {
    background: #333;
    color: #fff;
}

.tkaniny-top10-table thead th {
    padding: 15px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 16px;
}

.tkaniny-top10-table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    transition: background-color 0.2s ease;
}

.tkaniny-top10-table tbody tr:hover {
    background-color: #f5f5f5;
}

.tkaniny-top10-table tbody tr:last-child {
    border-bottom: none;
}

.tkaniny-top10-table tbody td {
    padding: 15px 20px;
    font-size: 15px;
}

/* Column widths */
.tkaniny-top10-table .position-col {
    width: 100px;
    text-align: center;
    font-weight: bold;
    color: #1E90FF;
}

.tkaniny-top10-table .name-col {
    width: auto;
}

.tkaniny-top10-table .count-col {
    width: 200px;
    text-align: right;
    font-weight: 600;
}

/* Links in table */
.tkaniny-top10-table .name-col a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s ease;
}

.tkaniny-top10-table .name-col a:hover {
    color: #1E90FF;
    text-decoration: underline;
}

/* Top 3 highlighting */
.tkaniny-top10-table tbody tr:nth-child(1) .position-col {
    color: #FFD700;
    font-size: 18px;
}

.tkaniny-top10-table tbody tr:nth-child(2) .position-col {
    color: #C0C0C0;
    font-size: 17px;
}

.tkaniny-top10-table tbody tr:nth-child(3) .position-col {
    color: #CD7F32;
    font-size: 16px;
}

/* Empty state */
.tkaniny-top10-table tbody td[colspan="3"] {
    text-align: center;
    padding: 40px;
    color: #999;
    font-style: italic;
}

/* Responsive */
@media (max-width: 768px) {
    .tkaniny-top10-header {
        flex-direction: column;
        gap: 10px;
    }

    .tkaniny-top10-toggle {
        width: 100%;
        padding: 12px 20px;
        font-size: 16px;
    }

    .tkaniny-top10-table thead th,
    .tkaniny-top10-table tbody td {
        padding: 10px 12px;
        font-size: 14px;
    }

    .tkaniny-top10-table .position-col {
        width: 60px;
    }

    .tkaniny-top10-table .count-col {
        width: 100px;
        font-size: 13px;
    }
}

/* ========================================
   TOP 10 GRID SHORTCODES
   [tkaniny_top10_colors_grid] and [tkaniny_top10_fabrics_grid]
   ======================================== */

/* Grid Container */
.tkaniny-top10-colors-grid,
.tkaniny-top10-fabrics-grid {
    max-width: 1200px;
    margin: 0 auto;
}

/* Grid Items */
.tkaniny-top10-color-item,
.tkaniny-top10-fabric-item {
    position: relative;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tkaniny-top10-color-item:hover,
.tkaniny-top10-fabric-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Links */
.tkaniny-top10-color-link,
.tkaniny-top10-fabric-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* Position Badge */
.tkaniny-top10-color-position,
.tkaniny-top10-fabric-position {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    background: #1E90FF;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Top 3 Position Badges */
.tkaniny-top10-color-item:nth-child(1) .tkaniny-top10-color-position,
.tkaniny-top10-fabric-item:nth-child(1) .tkaniny-top10-fabric-position {
    background: linear-gradient(135deg, #FFD700, #FFA500);
    width: 36px;
    height: 36px;
    font-size: 16px;
}

.tkaniny-top10-color-item:nth-child(2) .tkaniny-top10-color-position,
.tkaniny-top10-fabric-item:nth-child(2) .tkaniny-top10-fabric-position {
    background: linear-gradient(135deg, #C0C0C0, #A9A9A9);
}

.tkaniny-top10-color-item:nth-child(3) .tkaniny-top10-color-position,
.tkaniny-top10-fabric-item:nth-child(3) .tkaniny-top10-fabric-position {
    background: linear-gradient(135deg, #CD7F32, #8B4513);
}

/* Images */
.tkaniny-top10-color-image,
.tkaniny-top10-fabric-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

/* Names */
.tkaniny-top10-color-name,
.tkaniny-top10-fabric-name {
    padding: 12px 15px;
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    background: #f8f9fa;
    color: #333;
    border-top: 1px solid #eee;
}

/* No Data Message */
.tkaniny-no-data {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
}

/* Responsive Grid */
@media (max-width: 992px) {
    .tkaniny-top10-colors-grid,
    .tkaniny-top10-fabrics-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .tkaniny-top10-colors-grid,
    .tkaniny-top10-fabrics-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .tkaniny-top10-color-name,
    .tkaniny-top10-fabric-name {
        font-size: 13px;
        padding: 10px 12px;
    }
}

@media (max-width: 480px) {
    .tkaniny-top10-colors-grid,
    .tkaniny-top10-fabrics-grid {
        grid-template-columns: 1fr !important;
    }
}
