/* Main Container */
.vg-1x2-stats-container {
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
    background: #f8f9fa;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.1);
}

/* Header */
.vg-1x2-stats-header {
    background: linear-gradient(135deg, #2c3e50 0%, #4a6491 100%);
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 6px 15px rgba(0,0,0,0.15);
    color: white;
    text-align: center;
}

.vg-1x2-stats-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.vg-1x2-stats-subtitle {
    margin: 0;
    font-size: 16px;
    opacity: 0.9;
    font-weight: 300;
}

/* Controls */
.vg-1x2-stats-controls {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border: 1px solid #e1e8ed;
}

.vg-1x2-stats-control-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.vg-1x2-stats-control-label {
    font-weight: 600;
    color: #2c3e50;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.vg-1x2-stats-control-icon {
    font-size: 20px;
}

.vg-1x2-stats-select {
    padding: 12px 20px;
    border: 2px solid #4a6491;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 220px;
}

.vg-1x2-stats-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.vg-1x2-stats-button {
    padding: 12px 24px;
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(40, 167, 69, 0.2);
}

.vg-1x2-stats-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(40, 167, 69, 0.3);
    background: linear-gradient(135deg, #20c997 0%, #28a745 100%);
}

.vg-1x2-stats-button-icon {
    font-size: 18px;
}

.vg-1x2-stats-total-info {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #e3f2fd;
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 4px solid #2196f3;
}

.vg-1x2-stats-total-icon {
    font-size: 20px;
}

.vg-1x2-stats-total-text {
    font-size: 14px;
    color: #2c3e50;
}

.vg-1x2-stats-total-text strong {
    color: #2196f3;
}

/* Summary */
.vg-1x2-stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.vg-1x2-stats-summary-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease;
}

.vg-1x2-stats-summary-item:hover {
    transform: translateY(-5px);
}

.vg-1x2-stats-summary-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    font-size: 28px;
    font-weight: 700;
    color: white;
}

.vg-1x2-stats-summary-1 {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.vg-1x2-stats-summary-X {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
}

.vg-1x2-stats-summary-2 {
    background: linear-gradient(135deg, #dc3545 0%, #e91e63 100%);
}

.vg-1x2-stats-summary-balance {
    background: linear-gradient(135deg, #6f42c1 0%, #9c27b0 100%);
}

.vg-1x2-stats-summary-content {
    flex: 1;
}

.vg-1x2-stats-summary-value {
    font-size: 32px;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
    margin-bottom: 5px;
}

.vg-1x2-stats-summary-label {
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

/* Filters */
.vg-1x2-stats-filters {
    background: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.vg-1x2-stats-search {
    flex: 1;
    min-width: 250px;
}

.vg-1x2-stats-search-input {
    width: 100%;
    padding: 12px 20px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.vg-1x2-stats-search-input:focus {
    outline: none;
    border-color: #4a6491;
    box-shadow: 0 0 0 3px rgba(74, 100, 145, 0.2);
}

.vg-1x2-stats-filter-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.vg-1x2-stats-filter-btn {
    padding: 10px 16px;
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: #495057;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.vg-1x2-stats-filter-btn:hover,
.vg-1x2-stats-filter-btn.active {
    background: #4a6491;
    color: white;
    border-color: #4a6491;
}

.vg-1x2-stats-filter-icon {
    font-size: 16px;
}

/* Table Container */
.vg-1x2-stats-table-container {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    overflow-x: auto;
}

/* Table */
.vg-1x2-stats-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

.vg-1x2-stats-table th {
    background: #f8f9fa;
    padding: 18px 15px;
    text-align: center;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 3px solid #dee2e6;
    font-size: 15px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.vg-1x2-stats-sortable {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    user-select: none;
}

.vg-1x2-stats-sort-icon {
    font-size: 14px;
    opacity: 0.6;
}

.vg-1x2-stats-table td {
    padding: 16px 15px;
    border-bottom: 1px solid #e9ecef;
    font-size: 14px;
    text-align: center;
    vertical-align: middle;
    transition: background-color 0.2s ease;
}

.vg-1x2-stats-table tbody tr {
    transition: all 0.3s ease;
}

.vg-1x2-stats-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.vg-1x2-stats-table tbody tr.vg-1x2-stats-balanced {
    background-color: rgba(111, 66, 193, 0.05);
}

.vg-1x2-stats-table tbody tr:last-child td {
    border-bottom: none;
}

/* Code Column */
.vg-1x2-stats-td-code {
    text-align: center;
}

.vg-1x2-stats-code-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.vg-1x2-stats-code-number {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
    min-width: 50px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.vg-1x2-stats-code-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 600;
}

.vg-1x2-stats-code-badge.balanced {
    background: #6f42c1;
    color: white;
}

/* Result Columns */
.vg-1x2-stats-td-result {
    text-align: center;
}

.vg-1x2-stats-result-box {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.vg-1x2-stats-result-count {
    font-size: 22px;
    font-weight: 700;
}

.vg-1x2-stats-result-percent {
    font-size: 16px;
    font-weight: 600;
}

.vg-1x2-stats-result-1 .vg-1x2-stats-result-count,
.vg-1x2-stats-result-1 .vg-1x2-stats-result-percent {
    color: #28a745;
}

.vg-1x2-stats-result-X .vg-1x2-stats-result-count,
.vg-1x2-stats-result-X .vg-1x2-stats-result-percent {
    color: #ffc107;
}

.vg-1x2-stats-result-2 .vg-1x2-stats-result-count,
.vg-1x2-stats-result-2 .vg-1x2-stats-result-percent {
    color: #dc3545;
}

.vg-1x2-stats-result-bar {
    width: 100%;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.vg-1x2-stats-result-fill {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease;
}

.vg-1x2-stats-result-1 .vg-1x2-stats-result-fill {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.vg-1x2-stats-result-X .vg-1x2-stats-result-fill {
    background: linear-gradient(90deg, #ffc107, #ff9800);
}

.vg-1x2-stats-result-2 .vg-1x2-stats-result-fill {
    background: linear-gradient(90deg, #dc3545, #e91e63);
}

/* Total Column */
.vg-1x2-stats-td-total {
    text-align: center;
}

.vg-1x2-stats-total-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px solid #dee2e6;
}

.vg-1x2-stats-total-number {
    font-size: 20px;
    font-weight: 700;
    color: #2c3e50;
}

.vg-1x2-stats-total-label {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Distribution Column */
.vg-1x2-stats-td-distribution {
    min-width: 200px;
}

.vg-1x2-stats-distribution {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vg-1x2-stats-distribution-bars {
    display: flex;
    height: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.vg-1x2-stats-distribution-bar {
    height: 100%;
    transition: width 0.5s ease;
}

.vg-1x2-stats-dist-1 {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.vg-1x2-stats-dist-X {
    background: linear-gradient(90deg, #ffc107, #ff9800);
}

.vg-1x2-stats-dist-2 {
    background: linear-gradient(90deg, #dc3545, #e91e63);
}

.vg-1x2-stats-distribution-percents {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 600;
}

.vg-1x2-stats-dist-percent {
    padding: 2px 6px;
    border-radius: 4px;
    min-width: 50px;
    text-align: center;
}

.vg-1x2-stats-dist-1 {
    color: #28a745;
    background: rgba(40, 167, 69, 0.1);
}

.vg-1x2-stats-dist-X {
    color: #ffc107;
    background: rgba(255, 193, 7, 0.1);
}

.vg-1x2-stats-dist-2 {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

/* Tendency Column */
.vg-1x2-stats-td-tendency {
    text-align: center;
}

.vg-1x2-stats-tendency-box {
    padding: 10px 15px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    transition: all 0.3s ease;
}

.vg-1x2-stats-tendency-box:hover {
    transform: scale(1.05);
}

.vg-1x2-stats-tendency-balanced {
    background: rgba(111, 66, 193, 0.1);
    border: 2px solid #6f42c1;
}

.vg-1x2-stats-tendency-1 {
    background: rgba(40, 167, 69, 0.1);
    border: 2px solid #28a745;
}

.vg-1x2-stats-tendency-X {
    background: rgba(255, 193, 7, 0.1);
    border: 2px solid #ffc107;
}

.vg-1x2-stats-tendency-2 {
    background: rgba(220, 53, 69, 0.1);
    border: 2px solid #dc3545;
}

.vg-1x2-stats-tendency-icon {
    font-size: 20px;
}

.vg-1x2-stats-tendency-text {
    font-size: 12px;
    font-weight: 600;
}

.vg-1x2-stats-tendency-diff {
    font-size: 10px;
    color: #666;
    font-weight: 500;
}

/* Insights */
.vg-1x2-stats-insights {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.vg-1x2-stats-insights h3 {
    margin: 0 0 20px 0;
    color: #2c3e50;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vg-1x2-stats-insights-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.vg-1x2-stats-insight-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    transition: transform 0.3s ease;
}

.vg-1x2-stats-insight-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.vg-1x2-stats-insight-card h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vg-1x2-stats-insight-icon {
    font-size: 18px;
}

.vg-1x2-stats-insight-card p {
    margin: 0 0 10px 0;
    color: #666;
    font-size: 14px;
}

.vg-1x2-stats-code-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.vg-1x2-stats-code-item {
    background: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #4a6491;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.vg-1x2-stats-code-item:hover {
    background: #4a6491;
    color: white;
    border-color: #4a6491;
}

.vg-1x2-stats-code-more {
    font-size: 12px;
    color: #666;
    align-self: center;
}

.vg-1x2-stats-no-codes {
    color: #dc3545;
    font-size: 13px;
    font-style: italic;
    margin-top: 10px;
}

.vg-1x2-stats-top-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.vg-1x2-stats-top-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    background: white;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.vg-1x2-stats-top-rank {
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #4a6491;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 600;
}

.vg-1x2-stats-top-code {
    flex: 1;
    font-weight: 600;
    color: #2c3e50;
}

.vg-1x2-stats-top-value {
    font-size: 12px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
}

.vg-1x2-stats-top-item:nth-child(1) .vg-1x2-stats-top-value {
    background: rgba(255, 215, 0, 0.2);
    color: #ffc107;
}

.vg-1x2-stats-top-item:nth-child(2) .vg-1x2-stats-top-value {
    background: rgba(192, 192, 192, 0.2);
    color: #6c757d;
}

.vg-1x2-stats-top-item:nth-child(3) .vg-1x2-stats-top-value {
    background: rgba(205, 127, 50, 0.2);
    color: #cd7f32;
}

/* Export */
.vg-1x2-stats-export {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.vg-1x2-stats-export-btn {
    padding: 12px 24px;
    background: white;
    border: 2px solid #4a6491;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #4a6491;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vg-1x2-stats-export-btn:hover {
    background: #4a6491;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(74, 100, 145, 0.3);
}

.vg-1x2-stats-export-icon {
    font-size: 18px;
}

/* Footer */
.vg-1x2-stats-footer {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.vg-1x2-stats-footer strong {
    color: #4a6491;
}

/* No Data */
.vg-1x2-stats-no-data {
    text-align: center;
    padding: 40px;
    color: #dc3545;
    font-size: 16px;
    background: rgba(220, 53, 69, 0.05);
    border-radius: 8px;
    border: 2px dashed #dc3545;
    margin-top: 20px;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .vg-1x2-stats-container {
        padding: 15px;
    }
    
    .vg-1x2-stats-table-container {
        overflow-x: auto;
    }
}

@media (max-width: 1200px) {
    .vg-1x2-stats-summary {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vg-1x2-stats-insights-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    .vg-1x2-stats-control-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .vg-1x2-stats-total-info {
        margin-left: 0;
        justify-content: center;
    }
    
    .vg-1x2-stats-filters {
        flex-direction: column;
        align-items: stretch;
    }
}

@media (max-width: 768px) {
    .vg-1x2-stats-container {
        padding: 10px;
    }
    
    .vg-1x2-stats-header {
        padding: 20px;
    }
    
    .vg-1x2-stats-header h2 {
        font-size: 22px;
    }
    
    .vg-1x2-stats-summary {
        grid-template-columns: 1fr;
    }
    
    .vg-1x2-stats-summary-item {
        padding: 15px;
    }
    
    .vg-1x2-stats-controls,
    .vg-1x2-stats-table-container,
    .vg-1x2-stats-insights {
        padding: 15px;
    }
    
    .vg-1x2-stats-table th,
    .vg-1x2-stats-table td {
        padding: 12px 10px;
        font-size: 13px;
    }
    
    .vg-1x2-stats-code-number {
        font-size: 16px;
        min-width: 40px;
        padding: 6px;
    }
    
    .vg-1x2-stats-result-count {
        font-size: 18px;
    }
    
    .vg-1x2-stats-export-btn {
        padding: 10px 20px;
        font-size: 14px;
    }
}

@media (max-width: 576px) {
    .vg-1x2-stats-header h2 {
        font-size: 20px;
    }
    
    .vg-1x2-stats-subtitle {
        font-size: 14px;
    }
    
    .vg-1x2-stats-control-label {
        font-size: 14px;
    }
    
    .vg-1x2-stats-select,
    .vg-1x2-stats-button {
        width: 100%;
        justify-content: center;
    }
    
    .vg-1x2-stats-filter-options {
        flex-direction: column;
    }
    
    .vg-1x2-stats-filter-btn {
        width: 100%;
        justify-content: center;
    }
    
    .vg-1x2-stats-summary-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .vg-1x2-stats-summary-value {
        font-size: 24px;
    }
}