body {
    font-family: Arial, sans-serif;
    margin: 40px;
}

h1, h2 {
    color: #333;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

th, td {
    padding: 8px;
    text-align: left;
}

th {
    background: #f2f2f2;
}

.place-1 { background: #ffcc00; }
.place-2 { background: #c0c0c0; }
.place-3 { background: #CD7F32; }

tr:not(.place-1):not(.place-2):not(.place-3) {
    background: #b0e0ff;
}

th {
    background: #000099;
    color: white;
}

a{
	color:black;
	text-decoration:none;
}
.tabs{
    margin-top:20px;
    margin-bottom:15px;
}
.tab-button {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 4px;
    margin-top: 15px;
    cursor: pointer;
    border: none;
    border-radius: 20px;
    background-color: #eee;
    color: #000;
    font-weight: bold;
}

.tab-button:hover {
    background-color: #000099;
	color:white;
}

.tab-button.active {
    background-color: #000099;
    color: #fff;
}

.flag{
    width: 24px;
    height: 16px;
    vertical-align: middle;
    margin-right: 4px;
}
.athlete-profile {
    display: flex;
    align-items: center;
    gap: 16px;
    /*margin-bottom: 24px;*/
	background-color: #000099;
	color: #ffffff;
	/*padding:20px;*/
	/*border-radius:10px;*/
}



header {
    display: flex;
    align-items: left;
	flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
	background-color: #000099;
	color: #ffffff;
	padding:20px;
	border-radius:10px;
}

#club-title{
	font-size: 30px;
	font-weight: bold;
	color: #ffffff;
}

#federation-title{
	font-size: 30px;
	font-weight: bold;
	color: #ffffff;
}

#ranking-title{
	font-size: 30px;
	font-weight: bold;
	color: #ffffff;
}

#competition-name{
	font-size: 30px;
	font-weight: bold;
	color: #ffffff;
}

.athlete-profile a{
	color:white;
	text-decoration:none;
}

.athlete-photo {
    width: 120px;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #ccc;
	background-color:#ffffff;
}

.athlete-info h2 {
    margin: 0 0 8px 0;
	color: #ffffff;
}

.athlete-info div {
    margin-bottom: 4px;
	color: #ffffff;
}

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    border: 2px solid #60c0ff;
    background: #eef8ff;
    padding: 12px;
    margin-bottom: 20px;
}

.filter-block {
    display: flex;
    flex-direction: column;
    min-width: 180px;
}

.filter-title {
    font-weight: bold;
    margin-bottom: 4px;
}

.filter-options label {
    display: inline-block;
    margin-right: 10px;
    white-space: nowrap;
}

.filter-actions {
    font-weight: normal;
    font-size: 0.85em;
    margin-left: 6px;
}

.filter-actions a {
    color: #0077cc;
    text-decoration: underline;
    cursor: pointer;
}

.filter-actions a:hover {
    color: #000099;
	
}

.filter-button {
    padding: 8px 14px;
    margin-bottom: 12px;
    cursor: pointer;
}

.filter-panel {
    background: #f5f5f5;
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 6px;
    max-width: 400px;
}

.hidden {
    display: none;
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 6px;
}

.filter-group div {
    max-height: 140px;
    overflow-y: auto;
}

.filter-group input {
    margin-right: 6px;
}

.clear-button {
    margin-top: 10px;
    padding: 6px 10px;
    cursor: pointer;
}

/* =========================
   Filter Button
========================= */
.filter-button {
    padding: 8px 14px;
    margin-bottom: 15px;
    cursor: pointer;
}

/* =========================
   Overlay
========================= */
.filter-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 998;
}

.hidden {
    display: none;
}

/* =========================
   Sidebar
========================= */
.filter-sidebar {
    position: fixed;
    top: 0;
    right: -350px;   /* hidden position */
    width: 320px;
    height: 100%;
    background: white;
    box-shadow: -2px 0 8px rgba(0,0,0,0.2);
    padding: 20px;
    overflow-y: auto;
    transition: right 0.3s ease;
    z-index: 999;
}

.filter-sidebar.open {
    right: 0;
}

/* =========================
   Sidebar Header
========================= */
.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.close-btn {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
}

/* =========================
   Filter Tags
========================= */
.filter-group {
    margin-bottom: 20px;
}

.filter-group label {
    font-weight: bold;
    display: block;
    margin-bottom: 8px;
}

.filter-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.filter-tag {
    padding: 6px 12px;
    border-radius: 20px;
    background: #e0e0e0;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    user-select: none;
}

.filter-tag:hover {
    background: #d0d0d0;
	color:white;
}

.filter-tag.active {
    background: #000099;
    color: white;
}

/* Clear button */
.clear-button {
    padding: 8px 12px;
    width: 100%;
    cursor: pointer;
}

.letter-section td {
    background-color: #000099;
    color: white;
    font-weight: 800;      /* extra bold */
    font-size: 20px;       /* bigger font */
    letter-spacing: 1px;   /* optional: cleaner look */
    padding: 8px 10px;
}

/* =========================
   Top Action Buttons (Tag Style)
========================= */
.top-actions {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.tag-action {
    padding: 6px 14px;
    border-radius: 20px;
    background: #e0e0e0;
    border: none;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.tag-action:hover {
    background: #000099;
    color: white;
}


.country-highlight {
   
    outline-offset: -3px;
    font-weight: bold;
	background-color: #ff8080 !important;
	
}

.filter-tag.clear-tag {
    background-color: #ff6b6b;
    color: white;
    cursor: pointer;
    border-radius: 4px;
    padding: 4px 10px;
    margin-right: 6px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.filter-tag.clear-tag:hover {
    background-color: #ff3b3b;
}

.results-table {
    border-collapse: collapse;
    table-layout: auto;
    width: 100%;
}


/* Default row colors (your current ones) */
.results-table tr {
    transition: background-color 0.3s;
	height: 34px;
}



/* Optional: smooth transition when highlighting/unhighlighting */
.results-table tr {
    transition: background-color 0.25s ease;
}

.results-table td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
	font-size: 18px;
	line-height: 1.2;
}

/* =========================================
   PROFESSIONAL MATCHPLAY BRACKET
========================================= */

.bracket-wrapper{
    overflow-x:auto;
    padding:30px 10px;
}
/*
.bracket{
    display:flex;
    gap:80px;
    align-items:flex-start;
}

.round{
    width:260px;
    flex-shrink:0;
    display:flex;
    flex-direction:column;
    gap:50px;
}

.round-title{
    text-align:center;
    font-weight:bold;
    font-size:16px;
    margin-bottom:10px;
    color:#000099;
}

/* MATCH CARD */
/*
.match-card{
    background:white;
    border:1px solid #ccc;
    border-radius:6px;
    padding:8px;
    box-shadow:0 1px 3px rgba(0,0,0,0.1);
    transition:all 0.2s ease;
}*/

.match-card:hover{
    transform:scale(1.02);
    background:#000099;
}

/* ATHLETE ROW */
/*
.athlete-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
    padding:4px 6px;
    font-size:14px;
}

.athlete-row.winner{
    font-weight:bold;
    background:#e8ffe8;
    border-radius:4px;
}*/

.athlete-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:5px 6px;
    font-size:14px;
}

.athlete-row.winner{
    background:#e8ffe8;
    font-weight:bold;
    border-radius:4px;
}

.athlete-left{
    display:flex;
    align-items:center;
    gap:6px;
}

.athlete-name{
    white-space:nowrap;
}

.athlete-score{
    font-weight:bold;
    width:25px;
    text-align:right;
}

/* FLAG */

.match-flag{
    width:20px;
    height:14px;
}

/* DETAILS BUTTON */

.match{
    min-height:70px;
}

.match-toggle{
    width:100%;
    border:none;
    background:#e0e0e0;
    border-radius:12px;
    margin-top:6px;
    padding:4px;
    font-size:12px;
    cursor:pointer;
}

.match-toggle:hover{
    background:#000099;
    color:white;
}

/* EXPANDED MATCH DETAILS */

.match-details{
    margin-top:8px;
    padding-top:8px;
    border-top:1px solid #ddd;
    display:none;
}

.match-details.open{
    display:block;
}

/* DETAIL ATHLETE */

.detail-athlete{
    display:flex;
    align-items:center;
    justify-content:space-between;
    /*margin-bottom:8px;*/
}

.detail-athlete img{
    width:60px;
    height:80px;
    object-fit:cover;
    border-radius:4px;
    border:1px solid #ccc;
}

.detail-info{
    flex:1;
    padding:0 8px;
}

.detail-name{
    font-weight:bold;
    font-size:14px;
	
}

.detail-name .flag{
    width:20px;
    height:14px;
    vertical-align:middle;
    margin-left:4px;
}

.sets{
    font-size:13px;
    color:#333;
    margin-top:4px;
}

/* BRONZE MATCH */

.bronze-round {
    margin-top: 30px; /* space below Gold Final */
    display: flex;
    flex-direction: column;
    gap: 20px;
	align-self: flex-start;
}

.bronze-round .round-title {
    font-weight: bold;
    text-align: left;
}

.category-bracket { margin-bottom: 50px; }
.bracket-rounds{
    display:flex;
    flex-direction:row;
    align-items:flex-start;
    gap:80px;
	position: relative; /* absolute relative to bracket container (was absolute)*/
    top: 100%;          /* below the rounds container */
    left: 50%;          /* temporarily center */
    transform: translateX(-50%); /* center under gold */
}

.round { display: flex; flex-direction: column; gap: 40px; position: relative; }

.match {
    width: 200px;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 5px;
    background: #f9f9f9;
    position: relative;
}

.upper-athlete, .lower-athlete { text-align: left; }

.upper-athlete img, .lower-athlete img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 5px;
}

.name-flag-points { font-weight: bold; margin: 3px 0; }

.sets { text-align: center; font-family: monospace; margin-bottom: 5px; }

.winner { background-color: #d0f0d0; border-radius: 5px; }

/* canvas connectors will be drawn above everything */
.category-bracket canvas { z-index: 1; position: absolute; top:0; left:0; }

/* ========================================
   MATCHPLAY BRACKET SYSTEM
======================================== */

.category-bracket{
    margin-bottom:60px;
}

.category-header{
    display:flex;
    justify-content:center;
    align-items:center;
    gap:20px;
    margin-bottom:20px;
}

.category-header button{
    padding:6px 12px;
    cursor:pointer;
}

.bracket-viewport{
    position:relative;
    overflow:hidden;
	overflow-x:auto;
    overflow-y:visible;
}

.bracket-rounds{
    display:flex;
    gap:30px;
	min-width:max-content;
	position: relative;
    transition:transform 0.35s ease;
}

.round{
    width:260px;
    flex-shrink:0;
    display:flex;
    flex-direction:column;
    gap:30px;
}

.round-title{
    text-align:center;
    font-weight:bold;
    color:#000099;
	margin-bottom:10px;
}
/*
.match{
    border:1px solid #ccc;
    border-radius:6px;
    padding:6px;
    background:white;
}*/
.match{
    width:230px;
    border:1px solid #d0d0d0;
    border-radius:8px;
    padding:6px;
    background:white;
    box-shadow:0 2px 4px rgba(0,0,0,0.08);
    transition:all 0.2s ease;
}

.match:hover{
    transform:scale(1.02);
    box-shadow:0 4px 8px rgba(0,0,0,0.12);
}

.athlete-row{
    display:flex;
    justify-content:space-between;
    align-items:center;
    padding:4px;
}

.athlete-row.winner{
    background:#e8ffe8;
    font-weight:bold;
}

.right{
    display:flex;
    align-items:center;
    gap:6px;
}

.points{
    font-weight:bold;
}
/*
.details-btn{
    width:100%;
    border:none;
    background:#e0e0e0;
    border-radius:12px;
    margin:6px 0;
    cursor:pointer;
}
*/
.details-btn{
    width:100%;
    border:none;
    background:#e9eef6;
    border-radius:14px;
    padding:4px;
    font-size:12px;
    margin:6px 0;
    cursor:pointer;
    transition:all 0.2s ease;
}

.details-btn:hover{
    background:#000099;
    color:white;
}
.match-details{
    display:none;
    margin-top:10px;
}
.match.open .match-summary{
    display:none;
}


.match.open .match-details{
    display:block;
}
/*
.detail-row{
    display:flex;
    align-items:center;
    justify-content:space-between;
}

.detail-row.reverse{
    flex-direction:row-reverse;
}
*/
/*New details*/
.detail-athlete{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    text-align:left;
    margin-bottom:18px;
}

.detail-photo{
    width:95px;
    height:125px;
    object-fit:cover;
    border-radius:8px;
    border:2px solid #888;
    margin-bottom:6px;
}

.detail-name{
    font-weight:bold;
    margin-bottom:4px;
    font-size:14px;
}

.sets{
    font-family:monospace;
    font-size:14px;
    letter-spacing:1px;
}

/*
.detail-photo{
    width:70px;
    height:90px;
    object-fit:cover;
    border-radius:6px;
	border: 2px solid gray;
}
*/
.detail-info{
    text-align:center;
}

.sets{
    font-family:monospace;
}

.bracket-lines{
    position:absolute;
    top:0;
    left:0;
    pointer-events:none;
}

.round:nth-child(1){ margin-top:0px; }
.round:nth-child(2){ margin-top:60px; }
.round:nth-child(3){ margin-top:120px; }
.round:nth-child(4){ margin-top:180px; }
.round:nth-child(5){ margin-top:160px; }
.round:nth-child(6){ margin-top:200px; }


/*PDF*/
.pdf-buttons {
    margin: 15px 0;
}

.pdf-button {
    display: inline-block;
    padding: 8px 16px;
    margin-right: 8px;
    cursor: pointer;
    border: none;
    border-radius: 20px;
    background-color: #000099;
    color: #fff;
    font-weight: bold;
    transition: background-color 0.2s;
}

.pdf-button:hover {
    background-color: #000099;
	color:white;
}


.year-nav-wrapper {
    display: flex;
    align-items: center;
	justify-content: center;
    gap: 10px;
    margin-bottom: 15px;
}

.year-scroll {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    scroll-behavior: smooth;
}



.year-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;          /* match button height */
    padding: 0 14px;       /* remove vertical padding */
    border-radius: 20px;
    background: #e0e0e0;
    font-size: 14px;
	    line-height: 1; 
}

.year-item:hover {
    background: #000099;
    color: white;
}

.year-item.active {
    background: #000099;
    color: white;
    font-weight: bold;
}

#year-prev, #year-next {
	margin-top:0;
    height: 32px;
    width: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.format-tag {
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.format-tag.upcoming {
  background-color: #e53935; /* red */
  color: #fff;
}