/* ===== CupPilot – Modern Tournament Planner Styles ===== */

/* ---------- CSS Variables / Theme ---------- */
:root {
    --bg-primary: #0f1118;
    --bg-secondary: #161822;
    --bg-card: #1c1f2e;
    --bg-card-hover: #232740;
    --bg-input: #1c1f2e;
    --border: #2a2e42;
    --border-focus: #6366f1;
    --text-primary: #e8eaf0;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --green: #22c55e;
    --green-bg: rgba(34, 197, 94, 0.15);
    --blue: #3b82f6;
    --blue-bg: rgba(59, 130, 246, 0.15);
    --yellow: #eab308;
    --yellow-bg: rgba(234, 179, 8, 0.15);
    --red: #ef4444;
    --red-bg: rgba(239, 68, 68, 0.15);
    --gray: #6b7280;
    --gray-bg: rgba(107, 114, 128, 0.15);
    --gold: #fbbf24;
    --silver: #9ca3af;
    --bronze: #d97706;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; }

main { flex: 1; }

/* ---------- Container ---------- */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.container-narrow { max-width: 800px; }

/* ---------- Navbar ---------- */
.navbar {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

.navbar-brand i {
    color: var(--accent);
    font-size: 1.2rem;
}

.navbar-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
}

.nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.nav-link-accent {
    background: var(--accent);
    color: white !important;
}

.nav-link-accent:hover {
    background: var(--accent-hover);
    color: white !important;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0.5rem;
}

/* ---------- Hero ---------- */
.hero {
    padding: 4rem 0 3rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 50%, var(--bg-primary) 100%);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, var(--accent-glow) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(5%, -5%); }
}

.hero .container {
    position: relative;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.hero-content { flex: 1; }

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 0.75rem;
}

.hero-icon {
    color: var(--accent);
    margin-right: 0.25rem;
}

.accent { color: var(--accent); }

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 500px;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-visual { flex: 1; }

.hero-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.hero-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    transition: all var(--transition);
}

.hero-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(99, 102, 241, 0.15);
}

.hero-card i {
    font-size: 1.6rem;
    color: var(--accent);
}

.hero-card span {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ---------- Sections ---------- */
.section { padding: 2.5rem 0; }

.section-alt {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
}

.section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i { color: var(--accent); }

/* ---------- Features Grid ---------- */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: all var(--transition);
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 56px;
    height: 56px;
    background: var(--accent-glow);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.4rem;
    color: var(--accent);
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

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

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    text-decoration: none;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-primary);
}

.btn-outline:hover {
    border-color: var(--accent);
    color: var(--accent);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    padding: 0.4rem 0.6rem;
}

.btn-ghost:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.btn-danger {
    background: var(--red);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
    color: white;
}

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

.btn-sm {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
}

.btn-danger-text { color: var(--red) !important; }
.btn-danger-text:hover { background: var(--red-bg) !important; }

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.card h2, .card h3 {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Tournament Grid ---------- */
.tournament-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.25rem;
}

.tournament-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: all var(--transition);
    display: block;
    color: var(--text-primary);
}

.tournament-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
    color: var(--text-primary);
}

.tournament-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tournament-sport {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.tournament-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.tournament-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

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

.tournament-card-format {
    font-size: 0.75rem;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.tournament-card-completed { opacity: 0.8; }

/* ---------- Badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-green { background: var(--green-bg); color: var(--green); }
.badge-blue { background: var(--blue-bg); color: var(--blue); }
.badge-yellow { background: var(--yellow-bg); color: var(--yellow); }
.badge-gray { background: var(--gray-bg); color: var(--gray); }
.badge-red { background: var(--red-bg); color: var(--red); }

/* ---------- Page Header ---------- */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 2rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.page-header h1 {
    font-size: 1.8rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.page-header h1 i { color: var(--accent); font-size: 1.4rem; }

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

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb i { font-size: 0.65rem; }

/* ---------- Tournament Info Grid ---------- */
.tournament-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.info-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-icon {
    width: 40px;
    height: 40px;
    background: var(--accent-glow);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    flex-shrink: 0;
}

.info-content { display: flex; flex-direction: column; }
.info-label { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.info-value { font-weight: 600; font-size: 0.95rem; }

/* ---------- Actions Bar ---------- */
.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}

.actions-left, .actions-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.inline-form { display: inline-flex; align-items: center; gap: 0.5rem; }

/* ---------- Tabs ---------- */
.tabs {
    display: flex;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--border);
    overflow-x: auto;
}

.tab {
    padding: 0.75rem 1.25rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    white-space: nowrap;
}

.tab:hover { color: var(--text-primary); }

.tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---------- Matches ---------- */
.round-section { margin-bottom: 2rem; }

.round-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    border-left: 3px solid var(--accent);
}

.matches-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.match-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    transition: all var(--transition);
}

.match-card:hover { border-color: var(--accent); }

.match-completed { border-left: 3px solid var(--green); }
.match-pending { border-left: 3px solid var(--border); }

.match-players {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.match-player {
    flex: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
}

.match-player:last-child { flex-direction: row-reverse; }

.player-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.player-score {
    font-size: 1.3rem;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
    min-width: 2rem;
    text-align: center;
}

.match-player.winner .player-name { color: var(--green); }
.match-player.winner .player-score { color: var(--green); }

.match-vs {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
    width: 40px;
    text-align: center;
}

.match-vs i.fa-check-circle { color: var(--green); font-size: 1rem; }
.match-vs i.fa-play-circle { color: var(--accent); font-size: 1rem; }

.match-actions {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.result-form {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: center;
}

.score-input {
    width: 60px;
    padding: 0.4rem 0.5rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
}

.score-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.score-separator {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-muted);
}

.match-meta {
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.match-meta span {
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* ---------- Bracket ---------- */
.bracket-container {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding: 1rem 0;
}

.bracket-round {
    min-width: 220px;
    flex-shrink: 0;
}

.bracket-round-title {
    text-align: center;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.bracket-matches {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    justify-content: space-around;
    min-height: 100%;
}

.bracket-match {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.bracket-match.completed { border-color: var(--green); }

.bracket-player {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.bracket-player:last-child { border-bottom: none; }

.bracket-player.winner {
    background: var(--green-bg);
    font-weight: 700;
}

.bracket-score {
    font-weight: 700;
    min-width: 1.5rem;
    text-align: right;
    font-variant-numeric: tabular-nums;
}

/* ---------- Standings Table ---------- */
.standings-table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.standings-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.standings-table th {
    background: var(--bg-secondary);
    padding: 0.65rem 0.75rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.standings-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.standings-table tr:last-child td { border-bottom: none; }

.standings-table tr:hover { background: var(--bg-card-hover); }

.standings-table .col-rank { width: 50px; text-align: center; }
.standings-table .col-name { font-weight: 600; }
.standings-table .col-num { text-align: center; font-variant-numeric: tabular-nums; }
.standings-table .col-points { font-weight: 800; color: var(--accent); }

.rank-top td { background: var(--accent-glow); }

.rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 0.75rem;
}

.rank-gold { background: rgba(251, 191, 36, 0.2); color: var(--gold); }
.rank-silver { background: rgba(156, 163, 175, 0.2); color: var(--silver); }
.rank-bronze { background: rgba(217, 119, 6, 0.2); color: var(--bronze); }

.positive { color: var(--green); }
.negative { color: var(--red); }

/* ---------- Forms ---------- */
.form-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.form-section:last-of-type { border-bottom: none; margin-bottom: 0; }

.form-section-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section-title i { color: var(--accent); }

.form-group { margin-bottom: 1rem; }

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font);
    font-size: 0.9rem;
    transition: all var(--transition);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%239ca3af' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2rem;
}

.form-select-sm {
    padding: 0.35rem 2rem 0.35rem 0.6rem;
    font-size: 0.8rem;
}

.form-textarea { min-height: 100px; resize: vertical; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row-3 { grid-template-columns: 1fr 1fr 1fr; }

.form-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}

.form-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

/* ---------- Filter Bar ---------- */
.filter-bar {
    margin-bottom: 1.5rem;
}

.filter-form {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-form .form-select {
    width: auto;
    min-width: 180px;
}

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

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--accent-glow);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--accent);
}

.stat-card-yellow .stat-icon { background: var(--yellow-bg); color: var(--yellow); }
.stat-card-green .stat-icon { background: var(--green-bg); color: var(--green); }
.stat-card-blue .stat-icon { background: var(--blue-bg); color: var(--blue); }

.stat-content { display: flex; flex-direction: column; }
.stat-value { font-size: 1.8rem; font-weight: 800; line-height: 1; }
.stat-label { font-size: 0.8rem; color: var(--text-secondary); margin-top: 0.15rem; }

/* ---------- Admin Table ---------- */
.admin-table-wrapper { overflow-x: auto; }

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    text-align: left;
    padding: 0.65rem 0.75rem;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border);
}

.admin-table td {
    padding: 0.65rem 0.75rem;
    border-bottom: 1px solid var(--border);
}

.admin-table tr:hover { background: var(--bg-card-hover); }
.admin-table a { font-weight: 600; }

.actions-cell {
    display: flex;
    gap: 0.25rem;
}

/* ---------- Participants ---------- */
.participant-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 1.5rem;
    align-items: start;
}

.add-form .form-group { margin-bottom: 0.75rem; }

.member-row { margin-bottom: 0.5rem; }

.participant-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.participant-item {
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: all var(--transition);
}

.participant-item:hover { border-color: var(--accent); }

.participant-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.participant-number {
    width: 28px;
    height: 28px;
    background: var(--accent-glow);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--accent);
    flex-shrink: 0;
}

.participant-name { font-weight: 600; }
.participant-meta { font-size: 0.8rem; color: var(--text-muted); display: block; }

.participant-actions {
    display: flex;
    gap: 0.25rem;
    margin-left: auto;
}

.participant-edit {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

.participant-edit .form-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.participant-edit .form-input,
.participant-edit .form-select {
    font-size: 0.8rem;
    padding: 0.35rem 0.5rem;
}

.capacity-bar {
    margin-top: 1rem;
    background: var(--bg-secondary);
    border-radius: 20px;
    height: 28px;
    position: relative;
    overflow: hidden;
}

.capacity-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-hover));
    border-radius: 20px;
    transition: width 0.5s ease;
}

.capacity-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 0.75rem;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* ---------- Empty State ---------- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-secondary);
}

.empty-state i {
    font-size: 3rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    display: block;
}

.empty-state h3 {
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.empty-state p { margin-bottom: 1.5rem; }
.empty-actions { display: flex; justify-content: center; gap: 0.75rem; }
.empty-text { color: var(--text-muted); font-size: 0.9rem; padding: 1rem 0; }

/* ---------- Group Section ---------- */
.group-section { margin-bottom: 2rem; }

/* ---------- Danger Zone ---------- */
.danger-zone {
    margin-top: 3rem;
    padding: 1.5rem;
    border: 1px solid var(--red);
    border-radius: var(--radius);
    background: var(--red-bg);
}

.danger-zone h3 {
    font-size: 0.95rem;
    color: var(--red);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ---------- Flash Messages ---------- */
.flash-container { margin-top: 1rem; }

.flash {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    animation: flashIn 0.3s ease;
}

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

.flash-success { background: var(--green-bg); color: var(--green); border: 1px solid rgba(34, 197, 94, 0.3); }
.flash-error { background: var(--red-bg); color: var(--red); border: 1px solid rgba(239, 68, 68, 0.3); }
.flash-info { background: var(--blue-bg); color: var(--blue); border: 1px solid rgba(59, 130, 246, 0.3); }

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    opacity: 0.6;
    padding: 0.25rem;
}

.flash-close:hover { opacity: 1; }

/* ---------- Footer ---------- */
.footer {
    padding: 2rem 0;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--border);
    margin-top: 3rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .navbar-toggle { display: block; }

    .navbar-links {
        display: none;
        position: absolute;
        top: 64px;
        left: 0;
        right: 0;
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--border);
        padding: 0.75rem;
        flex-direction: column;
        gap: 0.25rem;
    }

    .navbar-links.open { display: flex; }

    .nav-link { width: 100%; justify-content: flex-start; }

    .hero .container { flex-direction: column; text-align: center; }
    .hero-title { font-size: 2.5rem; }
    .hero-subtitle { margin: 0 auto 2rem; }
    .hero-actions { justify-content: center; }
    .hero-cards { grid-template-columns: repeat(3, 1fr); }

    .tournament-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .form-row-3 { grid-template-columns: 1fr; }

    .participant-layout { grid-template-columns: 1fr; }

    .tournament-info-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .actions-bar { flex-direction: column; }
    .actions-left, .actions-right { width: 100%; }

    .bracket-container { gap: 1rem; }
    .bracket-round { min-width: 180px; }

    .match-players { flex-direction: column; gap: 0.25rem; }
    .match-player, .match-player:last-child { flex-direction: row; }
    .match-vs { width: auto; }

    .stats-grid { grid-template-columns: repeat(2, 1fr); }

    .page-header { flex-direction: column; }
    .page-header h1 { font-size: 1.4rem; }
}

@media (max-width: 480px) {
    .hero-title { font-size: 2rem; }
    .hero-cards { grid-template-columns: repeat(2, 1fr); }
    .tournament-info-grid { grid-template-columns: 1fr; }
    .stats-grid { grid-template-columns: 1fr; }

    .btn-lg {
        width: 100%;
        justify-content: center;
    }

    .hero-actions { flex-direction: column; }
}

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ---------- Selection ---------- */
::selection { background: var(--accent); color: white; }
