/* ================================
   ESTILOS PARA PÁGINA DE ESTATÍSTICAS
   Arquivo: stats-styles.css
   ================================ */

/* ================================
   HEADER DA PÁGINA
   ================================ */

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.page-header h1 {
    font-size: 2.5rem;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.page-header h1 i {
    font-size: 2rem;
}

.page-subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

/* ================================
   CARDS DE ESTATÍSTICAS
   ================================ */

.stats-overview {
    margin-bottom: 3rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-secondary) 100%);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    gap: 1.5rem;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--accent-color);
}

.stat-card.primary::before {
    background: linear-gradient(90deg, var(--accent-color), var(--accent-hover));
}

.stat-card.success::before {
    background: linear-gradient(90deg, var(--success-color), #28a745);
}

.stat-card.warning::before {
    background: linear-gradient(90deg, var(--warning-color), #ffc107);
}

.stat-card.info::before {
    background: linear-gradient(90deg, var(--info-color), #17a2b8);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-card.success .stat-icon {
    background: linear-gradient(135deg, var(--success-color) 0%, #28a745 100%);
}

.stat-card.warning .stat-icon {
    background: linear-gradient(135deg, var(--warning-color) 0%, #ffc107 100%);
    color: var(--primary-color);
}

.stat-card.info .stat-icon {
    background: linear-gradient(135deg, var(--info-color) 0%, #17a2b8 100%);
}

.stat-content {
    display: flex;
    flex-direction: column;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--accent-color);
    line-height: 1;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* ================================
   GRID PRINCIPAL DE ESTATÍSTICAS
   ================================ */

.stats-main-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.stats-section {
    background: var(--bg-card);
    border-radius: var(--border-radius-lg);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.section-header {
    padding: 1.5rem 2rem;
    background: linear-gradient(135deg, var(--bg-secondary) 0%, var(--bg-hover) 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-header h2 {
    color: var(--accent-color);
    font-size: 1.3rem;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* ================================
   TABELAS DE ESTATÍSTICAS
   ================================ */

.stats-table-container {
    padding: 0;
    overflow-x: auto;
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.stats-table th {
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--accent-color);
}

.stats-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
}

.stats-table tbody tr:hover {
    background-color: var(--bg-hover);
}

.stats-table .number {
    text-align: right;
    font-family: 'Courier New', monospace;
    font-weight: 500;
}

.stats-table .highlight {
    color: var(--accent-color);
    font-weight: bold;
}

.class-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 0.8rem;
    font-weight: 600;
}

/* ================================
   RANKING
   ================================ */

.ranking-container {
    padding: 1rem;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    margin-bottom: 0.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-fast);
}

.ranking-item:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
}

.ranking-position {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 60px;
}

.position-number {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--accent-color);
}

.fa-crown.gold { color: #ffd700; }
.fa-medal.silver { color: #c0c0c0; }
.fa-medal.bronze { color: #cd7f32; }

.ranking-info {
    flex: 1;
}

.char-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.char-details {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.char-class,
.char-level,
.char-overlord {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: var(--border-radius);
    background: var(--bg-hover);
    color: var(--text-secondary);
}

.char-overlord {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: var(--primary-color);
}

.char-account {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ranking-power {
    font-family: 'Courier New', monospace;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--accent-color);
    text-align: right;
}

/* ================================
   CARDS DE NAÇÃO
   ================================ */

.nation-stats {
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.nation-card {
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.nation-header {
    padding: 1rem;
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nation-header h3 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.nation-total {
    color: var(--primary-color);
    font-size: 0.9rem;
    opacity: 0.9;
}

.nation-details {
    padding: 1rem;
}

.nation-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.nation-stat .label {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nation-stat .value {
    color: var(--text-primary);
    font-weight: 600;
}

.nation-progress {
    margin-top: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    transition: width 1s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ================================
   CONTAS ATIVAS
   ================================ */

.active-accounts {
    padding: 1rem;
    display: grid;
    gap: 1rem;
}

.account-card {
    background: var(--bg-secondary);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition-fast);
}

.account-card:hover {
    background: var(--bg-hover);
    border-color: var(--accent-color);
}

.account-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--accent-color);
    margin-bottom: 1rem;
}

.account-stats {
    display: grid;
    gap: 0.5rem;
}

.account-stat {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.account-stat i {
    color: var(--accent-color);
    width: 16px;
}

/* ================================
   DISTRIBUIÇÃO POR NÍVEL
   ================================ */

.level-distribution {
    padding: 1.5rem;
}

.level-range {
    margin-bottom: 1rem;
}

.range-label {
    color: var(--text-primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.range-bar {
    position: relative;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    overflow: hidden;
    height: 40px;
}

.range-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    transition: width 1s ease;
    position: relative;
}

.range-text {
    position: absolute;
    top: 50%;
    left: 1rem;
    transform: translateY(-50%);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 2;
}

/* ================================
   ESTATÍSTICAS DE OVERLORD
   ================================ */

.overlord-stats {
    padding: 2rem;
}

.overlord-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1.5rem;
}

.overlord-item {
    text-align: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.overlord-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0.5rem;
}

.overlord-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ================================
   RESPONSIVIDADE
   ================================ */

@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .stats-main-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .stats-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1.5rem;
    }
    
    .stat-number {
        font-size: 2rem;
    }
    
    .section-header {
        padding: 1rem;
    }
    
    .section-header h2 {
        font-size: 1.1rem;
    }
    
    .stats-table {
        font-size: 0.8rem;
    }
    
    .stats-table th,
    .stats-table td {
        padding: 0.75rem;
    }
    
    .ranking-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .ranking-position {
        align-self: center;
    }
    
    .ranking-power {
        align-self: center;
        font-size: 1.2rem;
    }
    
    .char-details {
        flex-wrap: wrap;
    }
    
    .overlord-summary {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 1rem 0;
        margin-bottom: 2rem;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .overlord-summary {
        grid-template-columns: 1fr;
    }
}

/* ================================
   ANIMAÇÕES
   ================================ */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stats-section {
    animation: slideUp 0.6s ease-out;
}

.stats-section:nth-child(2) { animation-delay: 0.1s; }
.stats-section:nth-child(3) { animation-delay: 0.2s; }
.stats-section:nth-child(4) { animation-delay: 0.3s; }
.stats-section:nth-child(5) { animation-delay: 0.4s; }
.stats-section:nth-child(6) { animation-delay: 0.5s; }

.ranking-item {
    animation: slideUp 0.4s ease-out;
}

.ranking-item:nth-child(2) { animation-delay: 0.05s; }
.ranking-item:nth-child(3) { animation-delay: 0.1s; }
.ranking-item:nth-child(4) { animation-delay: 0.15s; }
.ranking-item:nth-child(5) { animation-delay: 0.2s; }

/* ================================
   EFEITOS ESPECIAIS
   ================================ */

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.stat-card:hover::after {
    left: 100%;
}

.ranking-item:first-child {
    background: linear-gradient(135deg, 
        rgba(255, 215, 0, 0.1) 0%, 
        var(--bg-secondary) 100%);
    border-color: rgba(255, 215, 0, 0.3);
}

.ranking-item:nth-child(2) {
    background: linear-gradient(135deg, 
        rgba(192, 192, 192, 0.1) 0%, 
        var(--bg-secondary) 100%);
    border-color: rgba(192, 192, 192, 0.3);
}

.ranking-item:nth-child(3) {
    background: linear-gradient(135deg, 
        rgba(205, 127, 50, 0.1) 0%, 
        var(--bg-secondary) 100%);
    border-color: rgba(205, 127, 50, 0.3);
}