.ranking-container table thead {
    position: sticky;
    top: 32px; /* Account for WordPress admin bar (32px) */
    background-color: white; /* Ensures the header has a background */
    z-index: 10; /* Keeps the header above other elements */
}

/* Adjust for when admin bar is present */
body.admin-bar .ranking-container table thead {
    top: 46px; /* WordPress admin bar height on desktop */
}

/* Adjust for mobile admin bar */
@media screen and (max-width: 782px) {
    body.admin-bar .ranking-container table thead {
        top: 46px; /* WordPress admin bar height on mobile */
    }
}

/* For logged out users or when no admin bar */
body:not(.admin-bar) .ranking-container table thead {
    top: 0;
}
.progress {
    width: 100%;
    height: 30px;
    background-color: #e0e0e0;
    border-radius: 5px;
    position: relative;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    border-radius: 5px;
    background-color: #4caf50; /* Default color (green) */
    position: absolute;
    top: 0;
    left: 0;
}

.progress-bar.rare {
    background-color: #2196f3; /* Blue for rare achievements */
}

.progress-bar.common {
    background-color: #ff9800; /* Orange for common achievements */
}

.progress-bar.frequent {
    background-color: #f44336; /* Red for frequent achievements */
}

.progress-text {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    color: black;
    font-weight: bold;
    font-size: 12px;
    z-index: 100;
    white-space: nowrap;
    pointer-events: none;
}

.achievement-item {
    position: relative;
    display: inline-block;
    width: 50px; /* Size of the trophy */
    height: 50px; /* Size of the trophy */
    background-color: #fff;  /* Optional: For visual reference */
    border-radius: 50%;  /* Optional: If you want a circular placeholder */
    z-index: 100;
}
.achievement-symbol { /* the placeholder */
    position: absolute;
    top: 0;
    left: 0;
    width: 50px; /* Size of the trophy */
    height: 50px; /* Size of the trophy */
    background-color: transparent;
    z-index: 0;
    background-size: cover;
}

.small-text {
    font-size: 12px;
}

.achievement-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px; /* Adjust size of the icon inside the trophy */
    height: 40px; /* Adjust size of the icon inside the trophy */
    cursor: pointer;
    z-index: 1; /* Lower than tooltip */
}


.ranking-container tr {
    border-bottom: 1px solid #ddd;
}

.ranking-container th, .ranking-container td {
    text-align: center; /* Align all columns to center */
}

@media screen and (max-width: 768px) {
    .ranking-container table {
        font-size: 14px;
    }
    .ranking-container th, .ranking-container td {
        padding: 6px;
    }
}

.platinum {
    background-image: url("assets/img/tournament_platinum.png");
}

.gold {
    background-image: url("assets/img/tournament_gold.png");
}

.silver {
    background-image: url("assets/img/tournament_silver.png");
}

.bronze {
    background-image: url("assets/img/tournament_bronze.png");
}


.tooltip {
    visibility: hidden;
    width: 360px;
    max-width: 360px;
    background-color: rgba(0, 0, 0, 0.9);
    color: #fff;
    text-align: left;
    border-radius: 8px;
    padding: 12px;
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    white-space: normal;
    word-wrap: break-word;
}

/* Arrow for tooltip */
.tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(0, 0, 0, 0.9) transparent transparent transparent;
    z-index: 501;
}


.tooltip-content {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.tooltip-content div {
    flex: 1;
}

.tooltip-content strong {
    font-size: 16px;
    display: block;
    margin-bottom: 8px;
}

.tooltip-content p {
    margin: 4px 0;
    line-height: 1.4;
}

.enlarged-trophy {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 4px;
}
    

.achievement-item:hover .tooltip {
    visibility: visible;
    opacity: 1;
}

.tooltip img {
    width: 100px; /* Adjust size for the enlarged version */
    height: 100px; /* Adjust size for the enlarged version */
    margin-bottom: 10px; /* Space between the image and the description */
}

.form-container {
    display: flex;
    justify-content: center; /* Centers horizontally */
    overflow-x: auto; /* Enables horizontal scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for mobile devices */
    position: relative;
    overflow: visible;
}

.form-container table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
}

.form-container th, .form-container td {
    text-align: left;
    padding: 8px;
}

.form-container th {
    background-color: #f4f4f4;
    position: sticky;
    top: 0;
    z-index: 10;
}

.form-container tr {
    border-bottom: 1px solid #ddd;
}

@media screen and (max-width: 768px) {
    .form-container table {
        font-size: 14px;
    }
    .form-container th, .form-container td {
        padding: 6px;
    }
}
.tournaments-container { margin: 20px 0; }
.tournament-list { list-style: none; padding: 0; }
.tournament-item { 
    border: 1px solid #ddd; 
    margin: 10px 0; 
    padding: 15px; 
    border-radius: 5px; 
    background: #f9f9f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.tournament-item.past { background: #f0f0f0; }
.tournament-info { flex: 1; }
.tournament-actions { 
    display: flex;
    flex-direction: column;
    gap: 10px; /* Adds spacing between buttons */
    align-items: flex-end;
    min-width: 200px;
}
.tournament-actions form {
    margin: 0;
}
.tournament-actions > div {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: center;
}
.tournament-date { color: #666; font-size: 0.9em; }
.view-assignments-link, .view-results-link { 
    color: #0073aa; 
    text-decoration: none; 
    font-size: 0.9em;
}
.view-assignments-link:hover, .view-results-link:hover { text-decoration: underline; }
.join-tournament-button, .cancel-tournament-button, .rejoin-tournament-button, .edit-game-button {
    padding: 8px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    white-space: nowrap;
}
.join-tournament-button { background: #0073aa; color: white; }
.cancel-tournament-button { background: #d63638; color: white; }
.rejoin-tournament-button { background: #00a32a; color: white; }
.edit-game-button { background: #f0ad4e; color: white; }
.registration-status {
    font-size: 0.8em;
    padding: 2px 6px;
    border-radius: 3px;
}
.registration-status.registered { background: #d1e7dd; color: #0f5132; }
.registration-status.cancelled { background: #f8d7da; color: #721c24; }
.brings-game-info {
    font-size: 0.8em;
    color: #0073aa;
    margin-left: 10px;
    font-style: italic;
}
.future-tournaments h3 { color: #0073aa; }
.past-tournaments h3 { color: #666; }
#toggle-indicator { font-size: 0.8em; }
.external-note {
    font-size: 0.8em;
    color: #666;
    margin-top: 5px;
}
.tournament-links a {
    flex: 0 1 auto; /* Prevent buttons from stretching */
    padding: 8px 15px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.9em;
    text-align: center;
    background: #0073aa;
    color: white;
    text-decoration: none;
}
.tournament-links a:hover {
    background: #005a8c;
}

/* Better positioning for tooltips in table cells */
.form-container td .achievement-item {
    position: relative;
    z-index: 100;
}

.form-container td .achievement-item .tooltip {
    position: absolute;
    bottom: auto;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 10px;
    max-width: 350px;
    z-index: 500;
    white-space: normal;
    width: 350px;
}

/* Arrow pointing up for tooltips below the icon */
.form-container td .achievement-item .tooltip::after {
    top: -5px;
    border-color: transparent transparent rgba(0, 0, 0, 0.9) transparent;
    z-index: 501;
}

/* Adjust tooltip width for mobile */
@media screen and (max-width: 768px) {
    .tooltip {
        width: 280px;
        max-width: 90vw;
    }
    
    .form-container td .achievement-item .tooltip {
        max-width: 90vw;
        width: 280px;
        left: 0;
        transform: none;
        white-space: normal;
        word-wrap: break-word;
    }
}

/* Payment Status Styling */
.payment-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    margin: 2px 0;
}

.payment-status.paid {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.payment-status.unpaid {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Registration Status Styling */
.registration-status {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    margin: 2px 0;
}

.registration-status.registered {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.registration-status.cancelled {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Tournament Actions Styling */
.tournament-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
}

.brings-game-info {
    font-size: 11px;
    color: #666;
    font-style: italic;
}

/* Responsive adjustments for mobile */
@media screen and (max-width: 768px) {
    .tournament-actions {
        align-items: flex-start;
    }
    
    .payment-status, .registration-status {
        font-size: 11px;
        padding: 1px 4px;
    }
}
