/* Sports Brackets Frontend Styles */

.sbr-bracket-container {
    max-width: 100%;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.sbr-bracket-title {
    text-align: center;
    margin-bottom: 10px;
    font-size: 28px;
    font-weight: 700;
    color: #1d2327;
}

.sbr-bracket-featured-image {
    text-align: center;
    margin-bottom: 20px;
}

.sbr-bracket-description {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 30px;
    color: #50575e;
    line-height: 1.6;
}

.sbr-bracket-closed {
    text-align: center;
    padding: 40px;
    background: #f6f7f7;
    border-radius: 8px;
    color: #50575e;
}

.sbr-error {
    color: #d63638;
    text-align: center;
    padding: 20px;
}

/* Bracket Top Scrollbar */
.sbr-bracket-scrollbar-top {
    overflow-x: auto;
    overflow-y: hidden;
    height: 14px;
}

.sbr-bracket-scrollbar-top-inner {
    height: 1px;
}

/* Bracket Rounds */
.sbr-bracket-rounds {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0 0 20px;
    margin-bottom: 40px;
}

.sbr-bracket-rounds.sbr-rounds-vertical {
    display: block;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 20px;
}

.sbr-rounds-vertical .sbr-region-headers {
    display: grid;
    grid-template-columns: repeat(var(--sbr-region-columns, 1), minmax(180px, 1fr));
    gap: 15px;
    align-items: center;
    margin-bottom: 18px;
}

.sbr-rounds-vertical .sbr-region-title {
    text-align: center;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.sbr-round {
    min-width: 180px;
    flex-shrink: 0;
}

.sbr-rounds-vertical .sbr-round {
    min-width: 0;
    margin-bottom: 26px;
    padding-bottom: 26px;
    border-bottom: 2px solid #e2e4e7;
}

.sbr-rounds-vertical .sbr-round:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.sbr-round-title {
    text-align: center;
    padding: 10px 15px;
    margin: 0 0 20px;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sbr-round-games {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sbr-round-games.sbr-round-games-grid {
    display: grid;
    grid-template-columns: repeat(var(--sbr-region-columns, 1), minmax(180px, 1fr));
    gap: 15px;
    align-items: start;
}

.sbr-round-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sbr-round-group[data-group] .sbr-game {
    max-width: 240px;
    margin-left: auto;
    margin-right: auto;
}

.sbr-region-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 14px;
    margin-top: 14px;
    border-top: 3px solid #e2e4e7;
}

.sbr-region-group:first-child {
    padding-top: 0;
    margin-top: 0;
    border-top: none;
}

/* Game Matchup */
.sbr-game {
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s;
}

.sbr-game:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.sbr-matchup {
    display: flex;
    flex-direction: column;
}

.sbr-team-slot {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px;
    border-bottom: 1px solid #f0f0f1;
    cursor: default;
    transition: all 0.2s;
}

.sbr-team-slot:last-child {
    border-bottom: none;
}

.sbr-team-slot.sbr-selectable {
    cursor: pointer;
}

.sbr-team-slot.sbr-selectable:hover {
    background: #f0f7fc;
}

.sbr-team-slot.sbr-selected {
    background: #e6f4ea;
    border-color: #34a853;
}

.sbr-team-slot.sbr-selected::after {
    content: '\2713';
    margin-left: auto;
    color: #34a853;
    font-weight: bold;
    font-size: 16px;
}

.sbr-team-slot.sbr-pending {
    opacity: 0.6;
}

.sbr-team-slot .sbr-seed {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f1;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    color: #50575e;
    flex-shrink: 0;
}

.sbr-team-slot .sbr-team-logo {
    width: 28px;
    height: 28px;
    object-fit: contain;
    border-radius: 4px;
    flex-shrink: 0;
}

.sbr-team-slot .sbr-team-name {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #1d2327;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Submission Form */
.sbr-submission-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 30px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.sbr-submission-form h3 {
    text-align: center;
    margin: 0 0 25px;
    font-size: 20px;
    font-weight: 600;
    color: #1d2327;
}

.sbr-form-row {
    margin-bottom: 20px;
}

.sbr-form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #1d2327;
}

.sbr-form-row label .required {
    color: #d63638;
}

.sbr-form-row input[type="text"],
.sbr-form-row input[type="email"],
.sbr-form-row input[type="number"] {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sbr-form-row input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.sbr-form-row input.sbr-error-field {
    border-color: #d63638;
}

.sbr-submit-btn {
    width: 100%;
    padding: 14px 20px;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sbr-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.sbr-submit-btn:disabled {
    background: #a7aaad;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.sbr-form-messages {
    margin-top: 15px;
    padding: 12px;
    border-radius: 6px;
    text-align: center;
    display: none;
}

.sbr-form-messages.sbr-message-error {
    display: block;
    background: #fcf0f1;
    color: #d63638;
    border: 1px solid #d63638;
}

.sbr-form-messages.sbr-message-success {
    display: block;
    background: #edfaef;
    color: #00a32a;
    border: 1px solid #00a32a;
}

/* Success State */
.sbr-submission-success {
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    background: #fff;
    border: 1px solid #e2e4e7;
    border-radius: 12px;
    text-align: center;
}

.sbr-success-message {
    font-size: 18px;
    color: #00a32a;
    margin-bottom: 25px;
}

.sbr-success-message::before {
    content: '\2713';
    display: block;
    width: 60px;
    height: 60px;
    margin: 0 auto 15px;
    background: #edfaef;
    border-radius: 50%;
    line-height: 60px;
    font-size: 30px;
    color: #00a32a;
}

.sbr-print-section .sbr-print-btn {
    display: inline-block;
    padding: 14px 28px;
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
    text-decoration: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.sbr-print-section .sbr-print-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

/* Leaderboard Styles */
.sbr-leaderboard {
    margin: 0 auto;
    padding: 20px 0px;
}

.sbr-leaderboard-title {
    text-align: center;
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 700;
    color: #1d2327;
}

.sbr-leaderboard-wrapper {
    overflow-x: auto;
}

.sbr-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.sbr-leaderboard-table thead {
    background: linear-gradient(135deg, #0073aa 0%, #005177 100%);
    color: #fff;
}

.sbr-leaderboard-table th {
    padding: 14px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sbr-leaderboard-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f1;
    font-size: 14px;
}

.sbr-leaderboard-table tbody tr:last-child td {
    border-bottom: none;
}

.sbr-leaderboard-table tbody tr:hover {
    background: #f9f9f9;
}

.sbr-col-rank {
    width: 70px;
    text-align: center !important;
}

.sbr-col-score {
    width: 80px;
}

.sbr-col-correct {
    width: 100px;
}

.sbr-col-date {
    width: 120px;
}

.sbr-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-weight: 700;
    font-size: 14px;
}

.sbr-rank-gold .sbr-rank-badge,
.sbr-rank-1 {
    background: linear-gradient(135deg, #ffd700 0%, #ffaa00 100%);
    color: #5c4d00;
}

.sbr-rank-silver .sbr-rank-badge,
.sbr-rank-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0a0a0 100%);
    color: #404040;
}

.sbr-rank-bronze .sbr-rank-badge,
.sbr-rank-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #a05a20 100%);
    color: #fff;
}

.sbr-tiebreaker-diff {
    font-size: 12px;
    color: #666;
}

.sbr-leaderboard-count {
    text-align: center;
    margin-top: 15px;
    color: #666;
    font-size: 13px;
}

.sbr-no-submissions {
    text-align: center;
    padding: 40px;
    color: #666;
}

/* Responsive */
@media (max-width: 768px) {
    .sbr-bracket-rounds {
        gap: 15px;
    }

    .sbr-round {
        min-width: 150px;
    }

    .sbr-round-title {
        font-size: 12px;
        padding: 8px 10px;
    }

    .sbr-team-slot {
        padding: 10px;
    }

    .sbr-team-slot .sbr-team-name {
        font-size: 13px;
    }

    .sbr-submission-form {
        padding: 20px;
    }
}
