﻿/* ========================================
   🎾 TENNIS RANKING - TEMA PRINCIPAL
   ======================================== */

:root {
    /* Cores principais - Tema Tênis */
    --primary: #1e6f5c;
    --primary-dark: #145246;
    --primary-light: #289672;
    --secondary: #e8871e;
    --secondary-light: #f5a623;
    --accent: #ffc93c;
    
    /* Cores de fundo */
    --bg-main: #f0f4f3;
    --bg-card: #ffffff;
    --bg-dark: #1a1a2e;
    
    /* Cores de texto */
    --text-primary: #2d3436;
    --text-secondary: #636e72;
    --text-light: #b2bec3;
    --text-muted: #a0a0a0;
    
    /* Cores de status */
    --success: #00b894;
    --warning: #fdcb6e;
    --danger: #e17055;
    --info: #74b9ff;
    
    /* Sombras */
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.16);
    
    /* Bordas */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;
}

/* ========================================
   RESET E BASE
   ======================================== */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
}

/* ========================================
   LAYOUT - SIDEBAR
   ======================================== */
.sidebar {
    background: linear-gradient(180deg, var(--primary-dark) 0%, var(--primary) 100%) !important;
}

.sidebar .navbar-brand {
    font-weight: 700;
    font-size: 1.1rem;
}

.sidebar .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    border-radius: var(--radius-sm);
    margin: 4px 8px;
    transition: all 0.2s ease;
}

.sidebar .nav-link:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white !important;
    transform: translateX(4px);
}

.sidebar .nav-link.active {
    background: var(--secondary) !important;
    color: white !important;
    font-weight: 600;
}

/* ========================================
   CABEÇALHO DA PÁGINA
   ======================================== */
.page-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding: 2rem 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-lg);
    color: white;
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '🎾';
    position: absolute;
    font-size: 8rem;
    opacity: 0.1;
    right: -20px;
    top: -20px;
}

.page-header h1 {
    color: white;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 2rem;
}

.page-header .text-muted {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ========================================
   CARDS DE ESTATÍSTICAS
   ======================================== */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.stat-number, .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ========================================
   TABELA DE RANKING
   ======================================== */
.ranking-container {
    max-width: 950px;
    margin: 0 auto 2.5rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    background: var(--bg-card);
}

.ranking-header {
    display: grid;
    grid-template-columns: 70px 1fr 90px 110px 120px 110px;
    padding: 1.25rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #2d2d44 100%);
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ranking-row {
    display: grid;
    grid-template-columns: 70px 1fr 90px 110px 120px 110px;
    padding: 1rem 1.5rem;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    transition: all 0.25s ease;
}

.ranking-row:last-child {
    border-bottom: none;
}

.ranking-row:hover {
    background: linear-gradient(90deg, rgba(30, 111, 92, 0.05) 0%, rgba(232, 135, 30, 0.05) 100%);
}

.ranking-row.top-three {
    background: linear-gradient(90deg, #fff9e6 0%, #fffbf0 100%);
    border-left: 4px solid var(--accent);
}

.ranking-row.paused {
    opacity: 0.5;
    background: #f9f9f9;
}

.pos {
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    color: var(--text-secondary);
}

.ranking-row.top-three .pos {
    color: var(--secondary);
}

.medal {
    font-size: 1.8rem;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.name a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05rem;
    transition: color 0.2s ease;
}

.name a:hover {
    color: var(--primary);
}

.apt {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.points {
    font-weight: 600;
    color: var(--primary);
}

.badge {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-lg);
    font-weight: 500;
}

.badge.bg-success {
    background: var(--success) !important;
}

.badge.bg-warning {
    background: var(--warning) !important;
    color: var(--text-primary) !important;
}

.actions {
    display: flex;
    gap: 0.5rem;
}

.actions .btn {
    padding: 0.4rem 0.6rem;
    font-size: 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.actions .btn:hover {
    transform: scale(1.1);
}

.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

.empty-state p {
    margin: 0.5rem 0;
}

/* ========================================
   BOTÕES DE AÇÃO
   ======================================== */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-success {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%) !important;
    border: none !important;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%) !important;
    border: none !important;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* ========================================
   MODAL MELHORADO
   ======================================== */
.modal.show {
    backdrop-filter: blur(4px);
}

.modal-content {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.modal-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border: none;
    padding: 1.25rem 1.5rem;
}

.modal-header .modal-title {
    font-weight: 600;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
    opacity: 0.8;
}

.modal-body {
    padding: 1.75rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    padding: 1rem 1.5rem;
    background: #f8f9fa;
}

/* Form inputs melhorados */
.form-control {
    border-radius: var(--radius-sm);
    border: 2px solid #e9ecef;
    padding: 0.75rem 1rem;
    transition: all 0.2s ease;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 111, 92, 0.15);
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* ========================================
   PÁGINA DE REGRAS
   ======================================== */
.rules-container {
    max-width: 800px;
    margin: 0 auto;
}

.rule-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.rule-card.expanded {
    box-shadow: var(--shadow-md);
}

.rule-header {
    display: flex;
    align-items: center;
    padding: 1.25rem 1.5rem;
    cursor: pointer;
    background: var(--bg-card);
    transition: background 0.2s ease;
    border-left: 4px solid transparent;
}

.rule-header:hover {
    background: #f8f9fa;
}

.rule-card.expanded .rule-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-left-color: var(--secondary);
}

.rule-icon {
    font-size: 1.75rem;
    margin-right: 1rem;
    width: 40px;
    text-align: center;
}

.rule-title {
    flex: 1;
    font-weight: 600;
    font-size: 1.1rem;
}

.rule-toggle {
    font-size: 0.9rem;
    opacity: 0.6;
    transition: transform 0.3s ease;
}

.rule-card.expanded .rule-toggle {
    transform: rotate(180deg);
}

.rule-body {
    padding: 1.25rem;
    background: #fafbfc;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    animation: slideDown 0.3s ease;
}

.rule-body ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.rule-body li {
    margin-bottom: 0.75rem;
    padding-left: 1.5rem;
    position: relative;
    line-height: 1.7;
}

.rule-body li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.rule-body li:last-child {
    margin-bottom: 0;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   PÁGINA DE PARTIDAS
   ======================================== */
.match-form-container {
    max-width: 900px;
    margin: 0 auto;
}

.match-form-container .card {
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.player-select-card {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-md);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
}

.player-select-card:hover {
    box-shadow: var(--shadow-md);
}

.player-select-card.challenger {
    border-top: 4px solid var(--danger);
}

.player-select-card.challenged {
    border-top: 4px solid var(--info);
}

.player-select-card h5 {
    font-weight: 600;
    margin-bottom: 1rem;
}

.player-info {
    margin-top: 1.25rem;
    padding: 1.25rem;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
}

.player-info .position {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
}

.player-info .name {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0.5rem 0;
}

.player-info .points {
    color: var(--text-secondary);
}

.vs-container {
    display: flex;
    align-items: center;
    justify-content: center;
}

.vs {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--text-light);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.score-section, .result-section {
    margin-top: 2rem;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: var(--radius-md);
}

.score-section h5, .result-section h5 {
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-primary);
}

.sets-container {
    display: flex;
    justify-content: center;
    gap: 2.5rem;
    flex-wrap: wrap;
}

.set-input {
    text-align: center;
}

.set-input label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.set-scores {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.set-scores input {
    width: 65px;
    height: 65px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    border: 2px solid #e9ecef;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.set-scores input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(30, 111, 92, 0.15);
}

.set-scores span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
}

.result-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.result-options .form-check {
    padding: 1rem 1rem 1rem 2.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.result-options .form-check:hover {
    background: #f0f4f3;
}

.result-options .form-check-input:checked + .form-check-label {
    font-weight: 600;
}

.form-actions {
    margin-top: 2.5rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* ========================================
   HISTÓRICO DE PARTIDAS
   ======================================== */
.filters-container {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.matches-list {
    max-width: 900px;
    margin: 0 auto;
}

.match-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary);
    transition: all 0.3s ease;
}

.match-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateX(4px);
}

.match-date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

.match-players {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.match-players .player {
    flex: 1;
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
}

.match-players .player.winner {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.match-players .player-name {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
}

.match-players .player-position {
    font-size: 0.85rem;
    opacity: 0.7;
}

.winner-badge {
    font-size: 1.25rem;
    margin-left: 0.5rem;
}

.match-score {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-sm);
    min-width: 140px;
    text-align: center;
}

.match-result {
    text-align: center;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.match-result.walkover {
    color: var(--danger);
}

/* ========================================
   PERFIL DO JOGADOR
   ======================================== */
.profile-container {
    max-width: 850px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 2.5rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, #f8f9fa 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.profile-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--secondary) 100%);
}

.profile-avatar {
    width: 110px;
    height: 110px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
}

.avatar-letter {
    font-size: 3.5rem;
    color: white;
    font-weight: 700;
}

.profile-info h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
}

.status-badge {
    display: inline-block;
    padding: 0.35rem 1rem;
    border-radius: var(--radius-lg);
    font-size: 0.85rem;
    font-weight: 600;
}

.status-badge.active {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
}

.status-badge.paused {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeeba 100%);
    color: #856404;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stats-grid .stat-card {
    padding: 1.25rem;
}

.stats-grid .stat-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.section h3 {
    margin: 0 0 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
}

/* ========================================
   MEUS TORNEIOS - LAYOUT COMPLETO
   ======================================== */

/* Stats Grid Mini */
.stats-grid.mini {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .stats-grid.mini {
        grid-template-columns: repeat(2, 1fr);
    }
}

.stats-grid.mini .stat-card {
    padding: 1rem;
}

.stats-grid.mini .stat-value {
    font-size: 1.75rem;
}

/* Action Bar Centered */
.action-bar.centered {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

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

/* Section */
.section {
    background: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
}

.section h3 {
    margin: 0 0 1.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
}

/* Tournament List View */
.tournaments-list-view {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Tournament List Item - Card Individual */
.tournament-list-item {
    display: grid;
    grid-template-columns: 70px 1fr auto auto;
    gap: 1.5rem;
    align-items: center;
    background: #ffffff;
    padding: 1.5rem;
    border-radius: var(--radius-lg);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #e9ecef;
    border-left: 5px solid var(--primary);
}

.tournament-list-item:hover {
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-left-color: var(--secondary);
}

.tournament-list-item.first-place {
    border-left-color: #ffd700;
    background: linear-gradient(90deg, #fffef5 0%, #ffffff 30%);
}

.tournament-list-item.top-three {
    border-left-color: var(--secondary);
    background: linear-gradient(90deg, #fff9f0 0%, #ffffff 30%);
}

/* Tournament Icon */
.tournament-icon-wrapper {
    display: flex;
    justify-content: center;
}

.tournament-icon {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    box-shadow: 0 4px 12px rgba(30, 111, 92, 0.3);
}

.tournament-icon.creator {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.tournament-icon.admin {
    background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    box-shadow: 0 4px 12px rgba(232, 135, 30, 0.3);
}

.tournament-icon.player {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

/* Tournament Main Info */
.tournament-main-info {
    flex: 1;
    min-width: 0;
}

.tournament-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.tournament-title-row h4 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary);
}

.tournament-desc {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tournament-meta-info {
    display: flex;
    gap: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    flex-wrap: wrap;
}

.tournament-meta-info span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Tournament Stats Mini - Seção de estatísticas dentro do card */
.tournament-stats-mini {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.stat-mini {
    text-align: center;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: var(--radius-sm);
    min-width: 70px;
    border: 1px solid #e0e0e0;
}

.stat-mini .value {
    display: block;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-mini .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 0.25rem;
}

/* Tournament Actions Mini */
.tournament-actions-mini {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tournament-actions-mini .btn {
    padding: 0.625rem 1.25rem;
    white-space: nowrap;
    font-size: 0.9rem;
}

.tournament-actions-mini .btn-secondary {
    padding: 0.625rem 0.875rem;
}

/* Role Badge */
.role-badge {
    padding: 0.35rem 0.875rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.role-badge.creator {
    background: linear-gradient(135deg, #ffd700, #ffaa00);
    color: #333;
}

.role-badge.admin {
    background: linear-gradient(135deg, var(--secondary), #ff8c00);
    color: white;
}

.role-badge.player {
    background: var(--primary-light);
    color: white;
}

/* ========================================
   RESPONSIVIDADE - MEUS TORNEIOS
   ======================================== */
@media (max-width: 1200px) {
    .tournament-list-item {
        grid-template-columns: 60px 1fr auto;
    }
    
    .tournament-stats-mini {
        display: none;
    }
}

@media (max-width: 900px) {
    .tournament-list-item {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1.25rem;
    }
    
    .tournament-icon-wrapper {
        display: none;
    }
    
    .tournament-stats-mini {
        display: flex;
        justify-content: flex-start;
    }
    
    .tournament-actions-mini {
        flex-direction: row;
        justify-content: flex-start;
    }
    
    .tournament-title-row {
        justify-content: flex-start;
    }
}

@media (max-width: 600px) {
    .tournament-list-item {
        padding: 1rem;
    }
    
    .stat-mini {
        padding: 0.5rem 0.75rem;
        min-width: 60px;
    }
    
    .tournament-title-row h4 {
        font-size: 1rem;
    }
    
    .tournament-meta-info {
        flex-direction: column;
        gap: 0.5rem;
    }
}

/* ========================================
   PERFIL - LAYOUT ATUALIZADO
   ======================================== */

/* Profile Card */
.profile-card {
    display: flex;
    align-items: center;
    gap: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-card) 0%, #f8f9fa 100%);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border-top: 5px solid var(--primary);
}

.profile-avatar-large {
    width: 100px;
    height: 100px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-md);
    flex-shrink: 0;
}

.profile-avatar-large .avatar-letter {
    font-size: 2.5rem;
    color: white;
    font-weight: 700;
}

.profile-details {
    flex: 1;
}

.profile-details h1 {
    margin: 0 0 0.5rem;
    font-size: 1.75rem;
    color: var(--text-primary);
}

.profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Compact versions for profile page */
.tournaments-list-view.compact {
    gap: 0.75rem;
}

.tournament-list-item.compact {
    padding: 1rem 1.25rem;
    grid-template-columns: 50px 1fr auto auto;
    gap: 1rem;
}

.tournament-list-item.compact .tournament-icon {
    width: 45px;
    height: 45px;
    font-size: 1.25rem;
}

.tournament-list-item.compact .tournament-title-row h4 {
    font-size: 1rem;
}

.tournament-list-item.compact .stat-mini {
    padding: 0.5rem 0.75rem;
    min-width: 55px;
}

.tournament-list-item.compact .stat-mini .value {
    font-size: 0.95rem;
}

.tournament-list-item.compact .stat-mini .label {
    font-size: 0.6rem;
}

/* Empty state inline */
.empty-state-inline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    background: #f8f9fa;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    gap: 1rem;
    flex-wrap: wrap;
}

/* View more link */
.view-more {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    padding: 0.5rem 1rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Matches List Compact */
.matches-list-compact {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.match-item-compact {
    display: grid;
    grid-template-columns: 35px 1fr auto auto;
    gap: 1rem;
    align-items: center;
    padding: 0.875rem 1.25rem;
    background: #ffffff;
    border-radius: var(--radius-md);
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.match-item-compact:hover {
    box-shadow: var(--shadow-sm);
    transform: translateX(4px);
}

.match-item-compact.win {
    border-left: 4px solid var(--success);
    background: linear-gradient(90deg, rgba(0, 184, 148, 0.05) 0%, #ffffff 20%);
}

.match-item-compact.loss {
    border-left: 4px solid var(--danger);
    background: linear-gradient(90deg, rgba(225, 112, 85, 0.05) 0%, #ffffff 20%);
}

.match-item-compact .result-icon {
    font-size: 1.25rem;
    text-align: center;
}

.match-item-compact .match-details {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.match-item-compact .opponent {
    font-weight: 600;
    color: var(--text-primary);
}

.match-item-compact .tournament-name-small {
    font-size: 0.75rem;
    color: var(--text-light);
}

.match-item-compact .score {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.95rem;
    padding: 0.25rem 0.75rem;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
}

.match-item-compact .date {
    font-size: 0.8rem;
    color: var(--text-light);
    white-space: nowrap;
}

/* Button sizes */
.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
}

/* Responsividade para Perfil */
@media (max-width: 768px) {
    .profile-card {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-meta {
        justify-content: center;
    }
    
    .tournament-list-item.compact {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        text-align: center;
    }
    
    .tournament-list-item.compact .tournament-icon-wrapper {
        display: none;
    }
    
    .tournament-list-item.compact .tournament-stats-mini {
        justify-content: center;
    }
    
    .tournament-list-item.compact .tournament-actions-mini {
        justify-content: center;
    }
    
    .tournament-list-item.compact .tournament-title-row {
        justify-content: center;
    }
    
    .match-item-compact {
        grid-template-columns: 30px 1fr auto;
    }
    
    .match-item-compact .date {
        display: none;
    }
    
    .empty-state-inline {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   GERENCIAR TORNEIO - LAYOUT COMPLETO
   ======================================== */

/* Tabs de Gerenciamento */
.manage-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    background: var(--bg-card);
    padding: 0.5rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.manage-tabs .tab {
    flex: 1;
    padding: 1rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.manage-tabs .tab:hover {
    background: #f0f4f3;
    color: var(--text-primary);
}

.manage-tabs .tab.active {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(30, 111, 92, 0.3);
}

/* Section Header */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e9ecef;
    flex-wrap: wrap;
    gap: 1rem;
}

.section-header h3 {
    margin: 0;
    padding: 0;
    border: none;
}

/* Players List */
.players-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.player-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
    border-radius: 6px;
}

.player-row.is-me {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.player-row .role-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    min-width: 100px;
}

.player-row .player-name {
    font-weight: 600;
    color: var(--text-primary);
}

.player-row .player-pos {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.player-row .me-badge {
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: auto;
}

.vs-divider {
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
    padding: 4px 0;
    font-weight: bold;
}

.challenger-row .role-label {
    color: #ef4444;
}

.challenged-row .role-label {
    color: #3b82f6;
}

/* ========================================
   CHALLENGE CARDS V2 - VISUAL APRIMORADO
   ======================================== */
.challenge-card-v2 {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.challenge-card-v2:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Header */
.challenge-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--bg-dark) 0%, #2d2d44 100%);
    color: white;
}

.tournament-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
}

.status-pill {
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Match Confrontation */
.match-confrontation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    align-items: center;
}

.player-side {
    text-align: center;
    padding: 1rem;
    border-radius: var(--radius-md);
    position: relative;
    background: #ffffff;
    border: 1px solid #e9ecef;
}

.player-side.is-you {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.08) 0%, rgba(16, 185, 129, 0.02) 100%);
    border: 2px solid rgba(16, 185, 129, 0.4);
}

.player-position-badge {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: var(--radius-full);
    font-size: 0.75rem;
    font-weight: 700;
    box-shadow: var(--shadow-sm);
}

.player-avatar-large {
    width: 60px;
    height: 60px;
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0.75rem auto 0.5rem;
    color: white;
    box-shadow: var(--shadow-sm);
}

.challenger-side .player-avatar-large {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.challenged-side .player-avatar-large {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
}

.player-name-full {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.player-role-tag {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    display: inline-block;
}

.challenger-tag {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.challenged-tag {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
}

.you-indicator {
    display: inline-block;
    background: var(--primary);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
    margin-top: 0.25rem;
}

.player-record {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* VS Center */
.vs-center {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0 0.5rem;
}

.vs-circle {
    width: 45px;
    height: 45px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.85rem;
    box-shadow: var(--shadow-md);
}

.match-date {
    margin-top: 0.5rem;
    text-align: center;
    background: rgba(30, 111, 92, 0.1);
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
}

.match-date .date-icon {
    font-size: 0.8rem;
}

.match-date .date-text {
    display: block;
    font-weight: 700;
    color: var(--primary);
    font-size: 0.8rem;
}

.match-date .time-text {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
}

/* Challenge Card Body */
.challenge-card-body {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    background: #ffffff;
}

.challenge-card-body .info-text {
    margin: 0 0 0.75rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.challenge-card-body .info-text.success {
    color: var(--success);
    font-weight: 600;
}

.challenge-card-body .info-text.warning {
    color: #f59e0b;
    font-weight: 600;
}

/* Date Options */
.date-options, .counter-dates {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.date-option-btn {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.date-option-btn:hover {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: white;
    border-color: var(--primary);
}

/* Proposed Dates */
.proposed-dates {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

.proposed-dates .dates-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.proposed-dates ul {
    margin: 0;
    padding-left: 1.25rem;
}

.proposed-dates li {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

/* Counter Proposal Section */
.counter-proposal-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #dee2e6;
}

.counter-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
}

.counter-form .date-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.counter-form input[type="datetime-local"],
.composition-input input[type="datetime-local"] {
    padding: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.counter-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 0.75rem;
}

/* Composition Input */
.composition-input {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Challenge Card Footer */
.challenge-card-footer {
    padding: 0.75rem 1.25rem;
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.created-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Message Text */
.message-text {
    font-style: italic;
    color: var(--text-secondary);
    background: #f0f4f3;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--primary);
}

/* Match Score in History */
.match-score {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    background: #f0f4f3;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* ========================================
   PAGE CONTENT - Container Principal
   ======================================== */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.page-content {
    width: 100%;
}

/* ========================================
   PÁGINA DE DESAFIOS - ESTILOS ESPECÍFICOS
   ======================================== */

/* Notifications Summary */
.notifications-summary {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.notification-badge {
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.notification-badge.received {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.notification-badge.action {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

/* Challenges List */
.challenges-list {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

/* Tournament Challenges Group */
.tournament-challenges-group {
    margin-bottom: 2rem;
}

.tournament-group-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary-light);
}

/* Status Pills para cards de desafio */
.status-pill.status-pending { background: #fef3c7; color: #92400e; }
.status-pill.status-accepted { background: #d1fae5; color: #065f46; }
.status-pill.status-counter { background: #dbeafe; color: #1e40af; }
.status-pill.status-composition { background: #fef3c7; color: #92400e; }
.status-pill.status-completed { background: #d1fae5; color: #065f46; }
.status-pill.status-walkover { background: #fee2e2; color: #991b1b; }
.status-pill.status-cancelled { background: #f3f4f6; color: #6b7280; }

/* Bordas coloridas por status para o card */
.challenge-card-v2.status-pending {
    border-left: 5px solid #f59e0b;
}

.challenge-card-v2.status-accepted {
    border-left: 5px solid var(--success);
}

.challenge-card-v2.status-counter {
    border-left: 5px solid #3b82f6;
}

.challenge-card-v2.status-composition {
    border-left: 5px solid #f59e0b;
}

.challenge-card-v2.status-completed {
    border-left: 5px solid var(--success);
}

.challenge-card-v2.status-walkover {
    border-left: 5px solid var(--danger);
}

.challenge-card-v2.status-cancelled {
    border-left: 5px solid #6b7280;
    opacity: 0.7;
}

/* Proposed Dates */
.proposed-dates {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: var(--radius-sm);
    margin-top: 0.5rem;
}

.proposed-dates .dates-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: block;
    margin-bottom: 0.5rem;
}

.proposed-dates ul {
    margin: 0;
    padding-left: 1.25rem;
}

.proposed-dates li {
    font-size: 0.9rem;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

/* Counter Proposal Section */
.counter-proposal-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px dashed #dee2e6;
}

.counter-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--radius-sm);
}

.counter-form .date-inputs {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.counter-form input[type="datetime-local"],
.composition-input input[type="datetime-local"] {
    padding: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.counter-form textarea {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #dee2e6;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    resize: vertical;
    min-height: 60px;
    margin-bottom: 0.75rem;
}

/* Composition Input */
.composition-input {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

/* Challenge Card Footer */
.challenge-card-footer {
    padding: 0.75rem 1.25rem;
    background: #f8f9fa;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.created-info {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Message Text */
.message-text {
    font-style: italic;
    color: var(--text-secondary);
    background: #f0f4f3;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.75rem;
    border-left: 3px solid var(--primary);
}

/* Match Score in History */
.match-score {
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--primary);
    background: #f0f4f3;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    display: inline-block;
}

/* Responsivo */
@media (max-width: 768px) {
    .match-confrontation {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .vs-center {
        flex-direction: row;
        gap: 1rem;
        padding: 0.5rem 0;
    }
    
    .manage-tabs {
        flex-wrap: wrap;
    }
    
    .manage-tabs .tab {
        flex: 1 1 calc(33.333% - 0.5rem);
        padding: 0.75rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .page-container {
        padding: 1rem;
    }
}