/**
 * CSS para Cloud Gaming Compare - Frontend
 * Versão 2.1.0
 */

/* ====== RESET & BASE ====== */
.cg-comparison-table * {
    box-sizing: border-box;
}

.cg-comparison-table {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 20px 0;
    clear: both;
}

/* ====== CABEÇALHO DA TABELA ====== */
.cg-table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.cg-table-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.cg-table-controls {
    display: flex;
    gap: 10px;
}

.cg-toggle-scores,
.cg-filter-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: 1px solid rgba(255,255,255,0.3);
    padding: 10px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.cg-toggle-scores:hover,
.cg-filter-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

/* ====== WRAPPER DA TABELA ====== */
.cg-table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    background: white;
}

/* ====== TABELA PRINCIPAL ====== */
.cg-services-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
    min-width: 800px;
}

.cg-services-table th {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    padding: 18px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 3px solid #1565C0;
}

.cg-services-table td {
    padding: 18px 15px;
    border-bottom: 1px solid #e3f2fd;
    vertical-align: top;
    transition: background-color 0.3s ease;
}

.service-row:hover td {
    background: #f8f9ff;
}

.service-row:nth-child(even) td {
    background: #fafbff;
}

.service-row:nth-child(even):hover td {
    background: #f0f4ff;
}

/* ====== CÉLULA DE SCORE ====== */
.service-score {
    text-align: center;
    min-width: 140px;
    position: relative;
}

.score-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.score-value {
    font-size: 32px;
    font-weight: 700;
    color: #2196F3;
    text-shadow: 0 2px 4px rgba(33, 150, 243, 0.2);
}

.score-classification {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Classificações por cor */
.classification-excelente,
.classification-excellent {
    background: linear-gradient(135deg, #4CAF50, #45a049);
    color: white;
}

.classification-muito-bom,
.classification-very-good {
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
}

.classification-bom,
.classification-good {
    background: linear-gradient(135deg, #FF9800, #F57C00);
    color: white;
}

.classification-razoavel,
.classification-average {
    background: linear-gradient(135deg, #FFC107, #FFA000);
    color: #333;
}

.classification-ruim,
.classification-poor {
    background: linear-gradient(135deg, #F44336, #D32F2F);
    color: white;
}

.score-na {
    color: #999;
    font-style: italic;
    font-size: 18px;
}

/* ====== BREAKDOWN DE SCORES ====== */
.score-breakdown {
    margin-top: 10px;
    text-align: left;
}

.score-breakdown details {
    cursor: pointer;
}

.score-breakdown summary {
    background: #f5f5f5;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #666;
    list-style: none;
}

.score-breakdown summary::-webkit-details-marker {
    display: none;
}

.score-breakdown summary::before {
    content: '▶';
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.score-breakdown details[open] summary::before {
    transform: rotate(90deg);
}

.score-breakdown ul {
    margin: 10px 0 0 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    list-style: none;
    font-size: 12px;
}

.score-breakdown li {
    margin: 6px 0;
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px solid #e9ecef;
}

.score-breakdown li:last-child {
    border-bottom: none;
}

/* ====== SEÇÃO DE INFORMAÇÕES ====== */
.service-name h4 {
    margin: 0 0 8px 0;
    color: #1976D2;
    font-size: 18px;
    font-weight: 600;
}

.service-excerpt {
    margin: 0;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.service-info {
    max-width: 350px;
}

.service-info-details {
    display: grid;
    gap: 8px;
}

.info-item {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 13px;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: #555;
}

.info-value {
    color: #333;
    text-align: right;
}

/* ====== RANKING WIDGET ====== */
.cg-ranking-widget {
    background: linear-gradient(135deg, #f8f9fa, #ffffff);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.08);
    margin: 25px 0;
    border: 1px solid #e3f2fd;
}

.cg-ranking-widget h3 {
    margin: 0 0 20px 0;
    color: #1976D2;
    font-size: 22px;
    font-weight: 600;
    text-align: center;
}

.cg-ranking-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ranking-item {
    display: flex;
    align-items: center;
    padding: 16px;
    border-bottom: 1px solid #e3f2fd;
    transition: all 0.3s ease;
    border-radius: 8px;
    margin-bottom: 8px;
}

.ranking-item:hover {
    background: linear-gradient(135deg, #e3f2fd, #f8f9ff);
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.1);
}

.ranking-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.ranking-position {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2196F3, #1976D2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    margin-right: 18px;
    box-shadow: 0 4px 12px rgba(33, 150, 243, 0.3);
}

.ranking-position.gold {
    background: linear-gradient(135deg, #FFD700, #FFA500);
}

.ranking-position.silver {
    background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
}

.ranking-position.bronze {
    background: linear-gradient(135deg, #CD7F32, #B8860B);
}

.ranking-info {
    flex: 1;
}

.ranking-info h4 {
    margin: 0 0 6px 0;
    color: #333;
    font-size: 16px;
    font-weight: 600;
}

.ranking-score {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ranking-score .score-value {
    font-size: 18px;
    font-weight: 700;
    color: #2196F3;
}

/* ====== RESPONSIVIDADE ====== */
@media (max-width: 768px) {
    .cg-table-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .cg-table-header h3 {
        font-size: 20px;
    }
    
    .cg-services-table {
        font-size: 12px;
        min-width: 600px;
    }
    
    .cg-services-table th,
    .cg-services-table td {
        padding: 12px 8px;
    }
    
    .score-value {
        font-size: 24px;
    }
    
    .service-name h4 {
        font-size: 16px;
    }
    
    .ranking-position {
        width: 40px;
        height: 40px;
        font-size: 16px;
        margin-right: 12px;
    }
    
    .ranking-info h4 {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .cg-comparison-table {
        margin: 15px -15px;
    }
    
    .cg-table-header {
        margin: 0 15px 15px 15px;
        padding: 15px;
    }
    
    .cg-table-wrapper {
        margin: 0 15px;
        border-radius: 8px;
    }
    
    .service-info {
        max-width: 250px;
    }
    
    .info-item {
        grid-template-columns: 1fr;
        gap: 4px;
    }
    
    .info-value {
        text-align: left;
        font-weight: 600;
        color: #2196F3;
    }
}

/* ====== ANIMAÇÕES ====== */
@keyframes scoreAppear {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.score-display {
    animation: scoreAppear 0.5s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.service-row {
    animation: slideIn 0.6s ease-out;
}

.service-row:nth-child(2) { animation-delay: 0.1s; }
.service-row:nth-child(3) { animation-delay: 0.2s; }
.service-row:nth-child(4) { animation-delay: 0.3s; }
.service-row:nth-child(5) { animation-delay: 0.4s; }

/* ====== LOADING STATES ====== */
.cg-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

.cg-loading::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e3f2fd;
    border-top: 2px solid #2196F3;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* ====== PRINT STYLES ====== */
@media print {
    .cg-table-controls,
    .cg-toggle-scores {
        display: none !important;
    }
    
    .cg-services-table {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .service-row:nth-child(even) td {
        background: #f9f9f9 !important;
    }
} 