/* March Madness Bracket Frontend Styles */

:root {
    --primary-red: #c41e3a;
    --secondary-red: #8b1538;
    --dark-red: #5d0e24;
    --primary-grey: #2c2c2c;
    --light-grey: #4a4a4a;
    --lighter-grey: #6a6a6a;
    --border-grey: #cccccc;
    --bg-light: #f8f9fa;
    --white: #ffffff;
    --text-dark: #1a1a1a;
    --success-green: #28a745;
    --warning-orange: #fd7e14;
}

/* ── Status Banner ───────────────────────────────────────────── */
.mm-status-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 24px;
    border-radius: 8px 8px 0 0;
    font-size: 1.05em;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-align: center;
    margin: -20px -20px 20px -20px; /* bleed to container edges */
}

.mm-status-banner--open {
    background: linear-gradient(90deg, #1a7a3c, #22a050);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(34, 160, 80, 0.35);
}

.mm-status-banner--closed {
    background: linear-gradient(90deg, #b81c1c, #d93030);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(185, 28, 28, 0.35);
}

.mm-status-banner__icon {
    font-size: 1.2em;
    line-height: 1;
}

.mm-status-banner__text {
    line-height: 1.4;
}
/* ──────────────────────────────────────────────────────────── */

.mm-bracket-container {
    max-width: 1500px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, #f0f0f0 100%);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.mm-bracket-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px solid var(--primary-red);
}

.mm-bracket-header h2 {
    color: var(--primary-grey);
    font-size: 2.5em;
    font-weight: 700;
    margin: 0 0 15px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

.mm-scoring-info {
    background: linear-gradient(45deg, var(--primary-red), var(--secondary-red));
    color: var(--white);
    padding: 15px 25px;
    border-radius: 8px;
    display: inline-block;
    box-shadow: 0 4px 15px rgba(196, 30, 58, 0.3);
}

.mm-scoring-info strong {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.mm-instructions {
    color: var(--lighter-grey);
    font-size: 1.1em;
    max-width: 800px;
    margin: 0 auto;
}

.mm-bracket-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 15px;
    margin-bottom: 40px;
    padding: 10px 0;
    max-width: 100%;
}

.mm-bracket-main > .mm-bracket-left {
    grid-column: 1;
    grid-row: 1;
}

.mm-bracket-main > .mm-bracket-center {
    grid-column: 1 / -1;
    grid-row: 2;
}

.mm-bracket-main > .mm-bracket-right {
    grid-column: 2;
    grid-row: 1;
}

.mm-bracket-left,
.mm-bracket-right {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.mm-bracket-center {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: row;
    justify-content: space-around;
    gap: 20px;
    padding: 20px 0;
}

.mm-region-section {
    background: #fff;
    border: 1px solid var(--border-grey);
    border-radius: 5px;
    padding: 10px;
}

.mm-region-title {
    color: var(--primary-red);
    font-size: 1.1em;
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 2px solid var(--lighter-grey);
    text-align: center;
}

.mm-rounds-container {
    display: flex;
    gap: 8px;
    padding-bottom: 5px;
}

.mm-rounds-reverse {
    flex-direction: row-reverse;
}

.mm-round {
    flex: 1;
    min-width: 0;
}

.mm-round h3 {
    color: var(--lighter-grey);
    font-size: 0.7em;
    margin: 0 0 5px 0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-align: center;
}

.mm-games {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mm-game {
    background: var(--bg-light);
    border: 1px solid var(--border-grey);
    border-radius: 3px;
    overflow: hidden;
    font-size: 0.85em;
}

.mm-team,
.mm-team-placeholder {
    padding: 6px 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-grey);
    min-height: 32px;
}

.mm-team:last-child,
.mm-team-placeholder:last-child {
    border-bottom: none;
}

.mm-team:hover {
    background: #e8e8e8;
}

.mm-team.selected {
    background: var(--primary-red);
    color: #fff;
    font-weight: bold;
}

.mm-team.selected .mm-seed {
    background: #fff;
    color: var(--primary-red);
}

.mm-team-placeholder {
    color: var(--lighter-grey);
    font-style: italic;
    justify-content: center;
    cursor: not-allowed;
}

.mm-seed {
    background: var(--primary-grey);
    color: #fff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.75em;
    flex-shrink: 0;
}

.mm-team-logo {
    width: 20px;
    height: 20px;
    object-fit: contain;
    flex-shrink: 0;
}

.mm-team-name {
    flex: 1;
    font-size: 0.85em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mm-final-four-section,
.mm-championship-section {
    background: #fff;
    border: 2px solid var(--border-grey);
    border-radius: 5px;
    padding: 15px;
    flex: 1;
}

.mm-section-title {
    color: var(--primary-red);
    font-size: 1.1em;
    margin: 0 0 10px 0;
    text-align: center;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-grey);
}

.mm-championship-section .mm-game {
    border: 2px solid var(--primary-red);
}

.mm-championship-logo {
    text-align: center;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid var(--border-grey);
}

.mm-championship-logo-img {
    max-width: 80px;
    height: auto;
    opacity: 0.9;
}

.mm-entry-form {
    background: #fff;
    border: 2px solid var(--border-grey);
    border-radius: 8px;
    padding: 30px;
    margin-top: 40px;
}

.mm-entry-form h2 {
    color: var(--primary-red);
    font-size: 1.8em;
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-grey);
}

.mm-form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.mm-form-field {
    display: flex;
    flex-direction: column;
}

.mm-form-field label {
    color: var(--primary-grey);
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.mm-form-field input {
    padding: 12px;
    border: 2px solid var(--border-grey);
    border-radius: 5px;
    font-size: 1em;
    transition: border-color 0.2s ease;
}

.mm-form-field input:focus {
    outline: none;
    border-color: var(--primary-red);
}

.mm-form-field small {
    color: var(--lighter-grey);
    font-size: 0.85em;
    margin-top: 5px;
}

.mm-form-actions {
    text-align: center;
}

.mm-submit-btn {
    background: var(--primary-red);
    color: #fff;
    padding: 15px 40px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s ease;
}

.mm-submit-btn:hover {
    background: var(--secondary-red);
}

.mm-submit-btn:disabled {
    background: var(--lighter-grey);
    cursor: not-allowed;
}

.mm-message {
    padding: 15px 20px;
    border-radius: 5px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
}

.mm-message.success {
    background: #d4edda;
    border: 2px solid #28a745;
    color: #155724;
}

.mm-message.error {
    background: #f8d7da;
    border: 2px solid #dc3545;
    color: #721c24;
}

/* Leaderboard Styles */
.mm-leaderboard {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Red Header Banner */
.mm-leaderboard-header {
    background: linear-gradient(135deg, var(--primary-red) 0%, var(--secondary-red) 100%);
    padding: 25px 30px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.3);
}

.mm-leaderboard-header h1 {
    color: #fff;
    font-size: 2.2em;
    margin: 0;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.mm-leaderboard-table-wrapper {
    overflow-x: auto;
    padding: 30px;
}

.mm-leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95em;
}

.mm-leaderboard-table th {
    background: var(--primary-grey);
    color: #fff;
    padding: 15px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.mm-leaderboard-table th.col-place {
    width: 80px;
    text-align: center;
}

.mm-leaderboard-table th.col-name {
    width: 180px;
}

.mm-leaderboard-table th.col-points {
    width: 220px;
}

.mm-leaderboard-table th.centered-header {
    text-align: center;
}

/* Points Header with Single Link */
.mm-points-header {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: center;
}

.mm-points-title {
    font-size: 0.9em;
}

.mm-sort-link-single {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: 0.7em;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    transition: color 0.2s ease;
    cursor: pointer;
    white-space: nowrap;
}

.mm-sort-link-single:hover {
    color: #fff;
    text-decoration: underline;
}

.mm-sort-link-single.active {
    color: #ffc107;
    text-decoration: underline;
}

.mm-leaderboard-table th.col-tiebreaker {
    width: 100px;
    text-align: center;
}

.mm-leaderboard-table th.col-wins {
    width: 280px;
}

.mm-leaderboard-table th.col-champion {
    width: 150px;
}

.mm-leaderboard-table th.col-rootfor {
    width: 150px;
}

.mm-leaderboard-table td {
    padding: 16px 12px;
    border-bottom: 1px solid var(--border-grey);
    vertical-align: middle;
}

.mm-leaderboard-table tbody tr {
    transition: background-color 0.2s ease;
}

.mm-leaderboard-table tbody tr:nth-child(even) {
    background: var(--bg-light);
}

.mm-leaderboard-table tbody tr:hover {
    background: #e8f4f8;
}

/* Place/Rank Badge */
.mm-rank-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 10px;
    background: var(--primary-grey);
    color: #fff;
    border-radius: 8px;
    font-weight: 700;
    font-size: 1.2em;
}

.mm-rank-badge.rank-1 {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(255, 215, 0, 0.4);
}

.mm-rank-badge.rank-2 {
    background: linear-gradient(135deg, #C0C0C0 0%, #A8A8A8 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(192, 192, 192, 0.4);
}

.mm-rank-badge.rank-3 {
    background: linear-gradient(135deg, #CD7F32 0%, #B87333 100%);
    color: #fff;
    box-shadow: 0 3px 10px rgba(205, 127, 50, 0.4);
}

/* Name Column with Link */
.mm-bracket-link {
    color: var(--primary-red);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.05em;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mm-bracket-link:hover {
    color: var(--secondary-red);
    text-decoration: underline;
}

.mm-bracket-link::after {
    content: "🔗";
    font-size: 0.85em;
    opacity: 0.7;
}

/* Points Bar Chart */
.mm-points-chart {
    width: 100%;
}

.mm-chart-bar {
    display: flex;
    width: 100%;
    height: 32px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.mm-bar-current,
.mm-bar-remaining {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    position: relative;
    transition: width 0.3s ease;
    min-width: 40px;
}

.mm-bar-current {
    background: linear-gradient(90deg, #28a745 0%, #34ce57 100%);
}

.mm-bar-remaining {
    background: linear-gradient(90deg, #ffc107 0%, #ffd740 100%);
}

.mm-points-current-text,
.mm-points-remaining-text {
    font-size: 1em;
    font-weight: 700;
    color: #000;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

.mm-points-current-text {
    color: #000;
}

.mm-points-remaining-text {
    color: #000;
}

/* Final bar when all teams eliminated */
.mm-bar-final {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
    background: linear-gradient(90deg, #28a745 0%, #34ce57 100%);
    border-radius: 16px;
}

.mm-points-final-text {
    font-size: 1em;
    font-weight: 700;
    color: #000;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.3);
}

/* Tiebreaker */
.mm-tiebreaker {
    display: inline-block;
    padding: 6px 12px;
    background: var(--bg-light);
    border-radius: 6px;
    font-weight: 600;
    color: var(--primary-grey);
}

/* Wins by Round Grid */
.mm-wins-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
}

.mm-win-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 6px 4px;
    background: var(--bg-light);
    border-radius: 6px;
    min-width: 36px;
}

.round-label {
    font-size: 0.7em;
    color: var(--lighter-grey);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.round-wins {
    font-size: 1.2em;
    font-weight: 700;
    color: var(--primary-red);
    margin-top: 2px;
}

/* Champion Pick */
.mm-champion-pick {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95em;
}

.mm-no-pick {
    color: var(--lighter-grey);
    font-style: italic;
}

/* Root For */
.mm-root-for {
    display: inline-block;
    padding: 6px 12px;
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 6px;
    color: #856404;
    font-weight: 600;
    font-size: 0.9em;
}

/* Modal Styles */
.mm-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    overflow: auto;
}

.mm-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 10001;
}

.mm-modal-content {
    position: relative;
    background: #fff;
    max-width: 90%;
    width: 1400px;
    margin: 30px auto;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    z-index: 10002;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.mm-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    background: linear-gradient(135deg, var(--primary-red), var(--secondary-red));
    color: #fff;
    border-radius: 12px 12px 0 0;
}

.mm-modal-header h2 {
    margin: 0;
    font-size: 1.8em;
    font-weight: 700;
}

.mm-modal-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 2em;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.mm-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mm-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

.mm-loading {
    text-align: center;
    padding: 40px;
    color: var(--lighter-grey);
    font-size: 1.2em;
}

/* Responsive Adjustments */
@media (max-width: 1400px) {
    .mm-leaderboard-table {
        font-size: 0.85em;
    }
    
    .mm-wins-grid {
        gap: 4px;
    }
    
    .mm-win-cell {
        min-width: 32px;
        padding: 4px 2px;
    }
}

@media (max-width: 1200px) {
    .mm-leaderboard-header h1 {
        font-size: 1.8em;
    }
    
    .mm-leaderboard-table th {
        padding: 12px 8px;
        font-size: 0.85em;
    }
    
    .mm-leaderboard-table td {
        padding: 12px 8px;
    }
}

@media (max-width: 768px) {
    .mm-leaderboard-header {
        padding: 20px 15px;
    }
    
    .mm-leaderboard-header h1 {
        font-size: 1.5em;
    }
    
    .mm-leaderboard-table-wrapper {
        padding: 15px;
    }
    
    .mm-leaderboard-table {
        font-size: 0.8em;
    }
    
    .mm-rank-badge {
        min-width: 32px;
        height: 32px;
        font-size: 1em;
    }
    
    .mm-wins-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 3px;
    }
    
    .mm-chart-bar {
        height: 28px;
    }
    
    .mm-points-current-text,
    .mm-points-remaining-text {
        font-size: 0.9em;
    }
    
    .mm-modal-content {
        width: 95%;
        margin: 20px auto;
    }
    
    .mm-modal-header {
        padding: 15px 20px;
    }
    
    .mm-modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .mm-leaderboard-header h1 {
        font-size: 1.2em;
    }
    
    .mm-chart-bar {
        height: 26px;
    }
    
    .mm-points-current-text,
    .mm-points-remaining-text {
        font-size: 0.85em;
    }
    
    .round-label {
        font-size: 0.6em;
    }
    
    .round-wins {
        font-size: 1em;
    }
}

/* All Picks Display */
.mm-all-picks-container {
    padding: 20px;
}

.mm-entry-card {
    background: #fff;
    border: 2px solid var(--border-grey);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.mm-entry-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--primary-red);
}

.mm-entry-name {
    color: var(--primary-red);
    font-size: 1.5em;
    margin: 0 0 5px 0;
}

.mm-entry-details {
    color: var(--primary-grey);
    font-size: 0.95em;
}

.mm-picks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.mm-round-group {
    margin-bottom: 20px;
}

.mm-round-label {
    color: var(--primary-grey);
    font-weight: 600;
    margin-bottom: 10px;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--border-grey);
}

.mm-pick-card {
    background: var(--bg-light);
    border-left: 3px solid var(--primary-red);
    padding: 10px;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .mm-team-name {
        font-size: 0.75em;
    }
    
    .mm-round h3 {
        font-size: 0.65em;
    }
}

@media (max-width: 1200px) {
    .mm-bracket-main {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto auto;
    }
    
    .mm-bracket-main > .mm-bracket-left {
        grid-column: 1;
        grid-row: 1;
    }
    
    .mm-bracket-main > .mm-bracket-center {
        grid-column: 1;
        grid-row: 3;
    }
    
    .mm-bracket-main > .mm-bracket-right {
        grid-column: 1;
        grid-row: 2;
    }
    
    .mm-bracket-center {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .mm-bracket-header h1 {
        font-size: 1.8em;
    }
    
    .mm-scoring-info {
        font-size: 0.85em;
    }
    
    .mm-form-row {
        grid-template-columns: 1fr;
    }
    
    .mm-team-name {
        font-size: 0.7em;
    }
    
    .mm-bracket-container {
        padding: 10px;
    }
    
    .mm-rounds-container {
        overflow-x: auto;
    }
}

@media (max-width: 480px) {
    .mm-bracket-header h1 {
        font-size: 1.5em;
    }
    
    .mm-championship-logo-img {
        max-width: 60px;
    }
    
    .mm-team-logo {
        width: 16px;
        height: 16px;
    }
    
    .mm-seed {
        width: 18px;
        height: 18px;
        font-size: 0.7em;
    }
}
/* ── Prize Distribution ───────────────────────────────────────── */
.mm-prize-distribution {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #dee2e6;
    text-align: center;
}

.mm-prize-header {
    padding: 12px 20px;
    background: white;
    border: 2px solid #333;
    border-radius: 4px;
    font-size: 1em;
    font-weight: bold;
    color: #333;
    display: inline-block;
    margin-bottom: 20px;
}

.mm-prize-breakdown-title {
    font-size: 1.2em;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mm-prize-breakdown {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.mm-prize-item {
    padding: 15px 30px;
    border-radius: 8px;
    min-width: 140px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.mm-prize-first {
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    border: 2px solid #d4af37;
}

.mm-prize-second {
    background: linear-gradient(135deg, #c0c0c0 0%, #e8e8e8 100%);
    border: 2px solid #a8a8a8;
}

.mm-prize-third {
    background: linear-gradient(135deg, #cd7f32 0%, #e89b6e 100%);
    border: 2px solid #b8692d;
}

.mm-prize-place {
    font-size: 1.1em;
    font-weight: bold;
    color: #333;
    text-align: center;
}

.mm-prize-place sup {
    font-size: 0.7em;
}

@media (max-width: 768px) {
    .mm-prize-breakdown {
        flex-direction: column;
        gap: 15px;
    }
    
    .mm-prize-item {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }
}