/* Estilos personalizados para Duelos Gaming */

body {
    background-color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
    min-height: 100svh; /* Usa viewport estável quando disponível */
    display: flex;
    flex-direction: column;
}

@supports (height: 100svh) {
    body { min-height: 100svh; }
}

main {
    flex: 1;
}

/* Utilitários de altura baseados em --vh */
.h-screen { height: calc(var(--vh, 1vh) * 100); }
.min-h-screen { min-height: calc(var(--vh, 1vh) * 100); }

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.card {
    border: none;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    border-radius: 0.5rem;
}

.card-header {
    border-bottom: none;
    font-weight: 600;
}

.btn {
    border-radius: 0.375rem;
    font-weight: 500;
}

.btn-lg {
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
    padding: 1rem;
}

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

.badge {
    font-size: 0.75rem;
    padding: 0.375rem 0.75rem;
}

.progress {
    border-radius: 0.375rem;
}

.table th {
    border-top: none;
    font-weight: 600;
}

.table td {
    vertical-align: middle;
}

.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid #ced4da;
}

.form-control:focus,
.form-select:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.alert {
    border: none;
    border-radius: 0.5rem;
}

/* Animações */
.card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-in-out;
}

.btn:hover {
    transform: translateY(-1px);
    transition: transform 0.1s ease-in-out;
}

/* ===== SISTEMA DE CORES PADRONIZADO ===== */

/* Cores principais */
:root {
    --primary-blue: #1e3c72;
    --secondary-blue: #2a5298;
    --primary-purple: #667eea;
    --secondary-purple: #764ba2;
    --primary-pink: #f093fb;
    --secondary-pink: #f5576c;
    --primary-orange: #ff9a9e;
    --secondary-orange: #fecfef;
    --primary-green: #4facfe;
    --secondary-green: #00f2fe;
    --primary-yellow: #fa709a;
    --secondary-yellow: #fee140;
    --primary-red: #ff6b6b;
    --secondary-red: #ee5a24;

    /* Cores de texto */
    --text-white: #ffffff;
    --text-light: rgba(255, 255, 255, 0.8);
    --text-muted: #6c757d;

    /* Cores de fundo */
    --bg-dark: #1a1a1a;
    --bg-card: rgba(255, 255, 255, 0.1);
    --bg-overlay: rgba(255, 255, 255, 0.05);

    /* Unidade de altura de viewport para mobile */
    --vh: 1vh;
}

/* ===== HERO SECTION (cores globais) ===== */
/* Garante legibilidade do texto em heros com fundo de gradiente */
.hero-section .hero-title,
.hero-section .hero-subtitle {
    color: var(--text-white);
}

/* Utilitário para subtítulo levemente mais claro */
.hero-section .hero-subtitle.text-light,
.hero-section .text-light {
    color: var(--text-light);
}

/* Garantir empilhamento correto no hero */
.hero-section { position: relative; z-index: 0; isolation: isolate; }
.hero-section::before { z-index: -1; }
.hero-section .hero-content, .hero-content { position: relative; z-index: 1; }

/* Gradientes principais */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
}

.bg-gradient-accent {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--secondary-pink) 100%);
}

.bg-gradient-warm {
    background: linear-gradient(135deg, var(--primary-orange) 0%, var(--secondary-orange) 100%);
}

.bg-gradient-cool {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
}

.bg-gradient-sunset {
    background: linear-gradient(135deg, var(--primary-yellow) 0%, var(--secondary-yellow) 100%);
}

.bg-gradient-fire {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--secondary-red) 100%);
}

/* Cards com fundo translúcido */
.card-glass {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card-glass-header {
    background: var(--bg-overlay);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Fundo translúcido para o corpo dos cards */
.card-glass-body {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Estilo para cards com gradiente e corpo translúcido */
.card-gradient {
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    overflow: hidden;
}

.card-gradient .card-body {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
}

/* Cores de texto */
.text-white {
    color: var(--text-white) !important;
}

.text-light {
    color: var(--text-light) !important;
}

/* Botões personalizados */
.btn-gradient-primary {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    border: none;
    color: var(--text-white);
}

/* Botão Ver Detalhes */
.btn-ver-detalhes {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-white);
    transition: all 0.3s ease;
}

.btn-ver-detalhes:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-white);
}

.btn-gradient-secondary {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
    border: none;
    color: var(--text-white);
}

.btn-gradient-accent {
    background: linear-gradient(135deg, var(--primary-pink) 0%, var(--secondary-pink) 100%);
    border: none;
    color: var(--text-white);
}

/* Cores personalizadas (mantidas para compatibilidade) */
.bg-gaming {
    background: linear-gradient(135deg, var(--primary-purple) 0%, var(--secondary-purple) 100%);
}

.text-gaming {
    color: var(--primary-purple);
}

.col-md-6,
.col-lg-4,
.col-md-3 {
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1.1rem;
    color: #ffffff;
}

.container {
    max-width: 100%;
    padding-left: 15px;
    padding-right: 15px;
}

/* Responsividade */
@media (max-width: 768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px;
    }

    .card-body {
        padding: 1rem;
    }

    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }

    /* Espaçamento entre cards no mobile - reduzido */
    .card {
        margin-bottom: 0.5rem;
    }

    .col-md-6,
    .col-lg-4,
    .col-md-3 {
        margin-bottom: 0.5rem;
    }

    /* Ajustes para cards de estatísticas */
    .stats-card {
        margin-bottom: 0.5rem;
    }

    /* Ajustes para tabelas */
    .table-responsive {
        font-size: 0.875rem;
    }

    /* Ajustes para botões */
    .btn {
        margin-bottom: 0.25rem;
    }

    .d-grid .btn {
        margin-bottom: 0;
    }

    /* Ajustes para badges */
    .badge {
        margin-bottom: 0.25rem;
        display: inline-block;
    }

    /* Ajustes para formulários */
    .form-control,
    .form-select {
        margin-bottom: 0.5rem;
    }

    /* Ajustes para listas */
    .list-group-item {
        margin-bottom: 0.25rem;
    }

    /* Ajustes para imagens */
    .card-img-top {
        height: 150px !important;
    }

    .game-cover {
        height: 250px !important;
    }

    /* Ajustes para texto */
    .card-title {
        font-size: 1.1rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.3rem;
    }

    h3 {
        font-size: 1.1rem;
    }

    /* Ajustes para espaçamento geral - reduzido */
    .row {
        margin-left: -5px;
        margin-right: -5px;
    }

    .col-md-6,
    .col-lg-4,
    .col-md-3,
    .col-6 {
        padding-left: 5px;
        padding-right: 5px;
    }

    /* Ajustes para container */
    .container {
        max-width: 100%;
    }

    /* Ajustes para navbar */
    .navbar-brand {
        font-size: 1.2rem;
    }

    /* Ajustes para footer */
    footer {
        margin-top: auto;
    }
}

/* Ícones personalizados */
.fas.fa-sword::before {
    content: "⚔";
}

.fas.fa-vs::before {
    content: "⚔";
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Tooltips personalizados */
.tooltip {
    font-size: 0.875rem;
}

/* Modal personalizado */
.modal-content {
    border: none;
    border-radius: 0.5rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #dee2e6;
    border-radius: 0.5rem 0.5rem 0 0;
}

.modal-footer {
    border-top: 1px solid #dee2e6;
    border-radius: 0 0 0.5rem 0.5rem;
}

/* Footer sempre no final */
footer {
    margin-top: auto;
    flex-shrink: 0;
}

/* ===== Tema escuro utilitário para páginas específicas ===== */
.theme-dark {
    background-color: #0e172a;
    background-image: radial-gradient(1400px circle at 0% 0%, rgba(102, 126, 234, 0.08), transparent 60%),
                      linear-gradient(135deg, #0b1220 0%, #0e172a 100%);
    color: var(--text-white);
}

.theme-dark main {
    color: var(--text-white);
}

/* Ajustes de componentes no tema escuro */
.theme-dark .card,
.theme-dark .card-glass,
.theme-dark .card-gradient,
.theme-dark .card-ghost {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-dark .card-header,
.theme-dark .card-glass-header {
    background: var(--bg-overlay);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.theme-dark .list-group-item {
    border-bottom-color: rgba(255, 255, 255, 0.12);
    background-color: transparent;
}

.theme-dark .btn,
.theme-dark .btn-ver-detalhes {
    color: var(--text-white);
}

/* Prévia de links de redes sociais (alto contraste em fundo escuro) */
.profile-card .form-text.text-muted,
.form-section .form-text.text-muted { color: rgba(255, 255, 255, 0.8) !important; }
.profile-card .form-text .link-preview,
.form-section .form-text .link-preview { color: #e6edf3; text-decoration: underline dotted; word-break: break-word; }
.profile-card .form-text .link-preview.text-danger,
.form-section .form-text .link-preview.text-danger { color: var(--primary-red) !important; }

/* New: badge over the avatar frame */
.avatar-level-badge { position: absolute; bottom: -6px; right: -6px; background: linear-gradient(135deg,#00d2ff,#3a7bd5); color: #fff; border-radius: 999px; padding: 4px 10px; font-weight: 800; font-size: 0.8rem; line-height: 1; z-index: 3; box-shadow: 0 6px 16px rgba(0,0,0,.35), inset 0 -2px 4px rgba(0,0,0,.2); border: 2px solid rgba(255,255,255,.25); }

/* New: level title line near the username */
.nivel-title-line { font-weight: 600; color: rgba(255,255,255,.9); }