/* Main Container */
.vgaps-container {
    max-width: 1600px;
    margin: 30px auto;
    padding: 25px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

/* Header */
.vgaps-header {
    background: linear-gradient(135deg, #2c3e50 0%, #4a6491 100%);
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    color: white;
    text-align: center;
    border: 5px solid rgba(255,255,255,0.1);
}

.vgaps-header h2 {
    margin: 0 0 15px 0;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.vgaps-subtitle {
    margin: 0;
    font-size: 18px;
    opacity: 0.9;
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto;
}

/* Summary Stats */
.vgaps-summary-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.vgaps-stat-box {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.vgaps-stat-box:hover {
    transform: translateY(-10px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.15);
    border-color: #4a6491;
}

.vgaps-stat-icon {
    font-size: 40px;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.vgaps-stat-content {
    flex: 1;
}

.vgaps-stat-number {
    font-size: 36px;
    font-weight: 800;
    color: #2c3e50;
    line-height: 1.2;
    margin-bottom: 5px;
}

.vgaps-stat-label {
    font-size: 16px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Pattern Groups */
.vgaps-patterns-results {
    margin-bottom: 40px;
}

.vgaps-pattern-group {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-left: 8px solid #4a6491;
    transition: transform 0.3s ease;
}

.vgaps-pattern-group:hover {
    transform: translateY(-5px);
}

.vgaps-pattern-header {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.vgaps-pattern-header h3 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.vgaps-pattern-icon {
    font-size: 28px;
}

.vgaps-pattern-count {
    font-size: 16px;
    color: #6c757d;
    font-weight: 600;
    background: #e9ecef;
    padding: 5px 15px;
    border-radius: 20px;
    margin-left: 10px;
}

.vgaps-pattern-desc {
    margin: 0;
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    padding-left: 45px;
}

/* Table */
.vgaps-table-container {
    overflow-x: auto;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.vgaps-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 1200px;
}

.vgaps-table th {
    background: linear-gradient(135deg, #2c3e50 0%, #4a6491 100%);
    padding: 18px 15px;
    text-align: center;
    font-weight: 700;
    color: white;
    border-bottom: 3px solid rgba(255,255,255,0.2);
    font-size: 15px;
    white-space: nowrap;
    position: sticky;
    top: 0;
    z-index: 10;
}

.vgaps-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;
}

.vgaps-table tbody tr {
    transition: all 0.2s ease;
}

.vgaps-table tbody tr:hover {
    background-color: #f8f9fa;
    transform: scale(1.002);
}

.vgaps-table tbody tr:nth-child(even) {
    background-color: #fcfcfc;
}

/* Pattern Display */
.vgaps-pattern-display-cell {
    min-width: 200px;
}

.vgaps-pattern-display {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vgaps-pattern-char {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    font-weight: 800;
    font-size: 18px;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.vgaps-pattern-char:hover {
    transform: scale(1.2) rotate(5deg);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* Result Colors */
.vgaps-result-1,
.vgaps-result-X,
.vgaps-result-2,
.vgaps-result-na {
    color: white;
    border: 2px solid rgba(0,0,0,0.2);
}

.vgaps-result-1 {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border-color: #1e7e34;
}

.vgaps-result-X {
    background: linear-gradient(135deg, #ffc107 0%, #ffd54f 100%);
    color: #333;
    border-color: #e0a800;
}

.vgaps-result-2 {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    border-color: #bd2130;
}

/* Codes Display */
.vgaps-codes-cell {
    min-width: 250px;
    max-width: 250px;
}

.vgaps-codes-list {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 8px;
    justify-content: center;
}

.vgaps-code-badge {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: pointer;
}

.vgaps-code-badge:hover {
    transform: scale(1.1);
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
}

.vgaps-codes-count {
    font-size: 12px;
    color: #6c757d;
    text-align: center;
    font-style: italic;
}

.vgaps-codes-count-num {
    font-size: 20px;
    font-weight: 800;
    color: #2c3e50;
}

/* Percent Cells */
.vgaps-percent-cell {
    font-weight: 700;
    padding: 12px 8px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.vgaps-percent-high {
    background-color: #d4edda !important;
    color: #155724 !important;
    border: 2px solid #c3e6cb !important;
}

.vgaps-percent-medium {
    background-color: #fff3cd !important;
    color: #856404 !important;
    border: 2px solid #ffeaa7 !important;
}

.vgaps-percent-low {
    background-color: #f8d7da !important;
    color: #721c24 !important;
    border: 2px solid #f5c6cb !important;
}

/* Interesting Patterns */
.vgaps-interesting-patterns {
    background: white;
    padding: 30px;
    border-radius: 15px;
    margin-bottom: 40px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-left: 8px solid #28a745;
}

.vgaps-interesting-patterns h3 {
    margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 26px;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.vgaps-interesting-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.vgaps-interesting-item {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.vgaps-interesting-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    border-color: #4a6491;
}

.vgaps-interesting-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.vgaps-interesting-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 700;
}

.vgaps-interesting-count {
    background: #28a745;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 13px;
    font-weight: 700;
}

.vgaps-interesting-pattern {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-bottom: 15px;
}

.vgaps-interesting-char {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 35px;
    height: 35px;
    border-radius: 8px;
    font-weight: 800;
    font-size: 16px;
}

.vgaps-interesting-codes {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.vgaps-interesting-code {
    background: #6c757d;
    color: white;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

.vgaps-interesting-more {
    background: #ffc107;
    color: #333;
    padding: 4px 10px;
    border-radius: 15px;
    font-size: 12px;
    font-weight: 600;
}

/* Legend */
.vgaps-legend {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border-left: 8px solid #ffc107;
}

.vgaps-legend h4 {
    margin: 0 0 25px 0;
    color: #2c3e50;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.vgaps-legend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.vgaps-legend-group h5 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.vgaps-legend-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.vgaps-legend-item {
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vgaps-legend-item::before {
    content: '';
    width: 15px;
    height: 15px;
    border-radius: 3px;
    display: inline-block;
}

.vgaps-result-1::before {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.vgaps-result-X::before {
    background: linear-gradient(135deg, #ffc107 0%, #ffd54f 100%);
}

.vgaps-result-2::before {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
}

.vgaps-percent-high::before {
    background-color: #d4edda;
    border: 2px solid #c3e6cb;
}

.vgaps-percent-medium::before {
    background-color: #fff3cd;
    border: 2px solid #ffeaa7;
}

.vgaps-percent-low::before {
    background-color: #f8d7da;
    border: 2px solid #f5c6cb;
}

/* Messages */
.vgaps-error,
.vgaps-no-data,
.vgaps-loading {
    background: white;
    padding: 40px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    margin-bottom: 30px;
}

.vgaps-error {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-left: 8px solid #dc3545;
}

.vgaps-no-data {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-left: 8px solid #ffc107;
}

.vgaps-loading {
    border-left: 8px solid #17a2b8;
}

.vgaps-error p,
.vgaps-no-data h3,
.vgaps-no-data p,
.vgaps-loading p {
    margin: 0 0 20px 0;
    font-weight: 500;
    color: #721c24;
    font-size: 18px;
}

.vgaps-no-data h3 {
    color: #856404;
    margin-bottom: 15px;
    font-size: 24px;
}

.vgaps-no-data p {
    color: #856404;
}

/* Loading Spinner */
.vgaps-spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #e9ecef;
    border-top: 6px solid #4a6491;
    border-radius: 50%;
    animation: vgaps-spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes vgaps-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1400px) {
    .vgaps-container {
        padding: 20px;
    }
    
    .vgaps-summary-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vgaps-table th,
    .vgaps-table td {
        padding: 14px 12px;
        font-size: 13px;
    }
    
    .vgaps-pattern-char {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }
}

@media (max-width: 1200px) {
    .vgaps-interesting-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .vgaps-legend-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .vgaps-header h2 {
        font-size: 28px;
    }
    
    .vgaps-subtitle {
        font-size: 16px;
    }
    
    .vgaps-stat-box {
        padding: 20px;
    }
    
    .vgaps-stat-icon {
        width: 60px;
        height: 60px;
        font-size: 32px;
    }
    
    .vgaps-stat-number {
        font-size: 30px;
    }
    
    .vgaps-pattern-group {
        padding: 20px;
    }
    
    .vgaps-pattern-header h3 {
        font-size: 20px;
    }
}

@media (max-width: 768px) {
    .vgaps-container {
        padding: 15px;
        border-radius: 15px;
    }
    
    .vgaps-header {
        padding: 20px;
    }
    
    .vgaps-summary-stats {
        grid-template-columns: 1fr;
    }
    
    .vgaps-pattern-char {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
    
    .vgaps-interesting-grid {
        grid-template-columns: 1fr;
    }
    
    .vgaps-legend-grid {
        grid-template-columns: 1fr;
    }
    
    .vgaps-code-badge {
        padding: 4px 8px;
        font-size: 12px;
    }
    
    .vgaps-codes-count-num {
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .vgaps-header h2 {
        font-size: 24px;
    }
    
    .vgaps-subtitle {
        font-size: 14px;
    }
    
    .vgaps-stat-box {
        padding: 15px;
    }
    
    .vgaps-stat-icon {
        width: 50px;
        height: 50px;
        font-size: 24px;
    }
    
    .vgaps-stat-number {
        font-size: 24px;
    }
    
    .vgaps-stat-label {
        font-size: 14px;
    }
    
    .vgaps-pattern-header h3 {
        font-size: 18px;
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .vgaps-pattern-count {
        margin-left: 0;
    }
    
    .vgaps-pattern-desc {
        padding-left: 0;
        font-size: 14px;
    }
    
    .vgaps-pattern-char {
        width: 25px;
        height: 25px;
        font-size: 12px;
    }
    
    .vgaps-interesting-char {
        width: 30px;
        height: 30px;
        font-size: 14px;
    }
}