/**
 * Tournament Bracket View - Public Facing Styles
 * Professional tournament bracket visualization with animations
 */

.osb-tournament-view {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Tournament Header */
.osb-tournament-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 40px 20px;
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
    border-radius: 12px;
}

.osb-tournament-header h1 {
    margin: 0 0 10px 0;
    font-size: 2.5em;
    font-weight: 700;
}

.osb-tournament-subtitle {
    margin: 0;
    font-size: 1.2em;
    opacity: 0.9;
}

.osb-tournament-status-bar {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 40px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.osb-status-item {
    display: flex;
    align-items: center;
    gap: 10px;
}

.osb-status-label {
    font-size: 0.95em;
    opacity: 0.9;
}

.osb-status-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9em;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.osb-status-in_progress {
    background: #fef3c7;
    color: #92400e;
}

.osb-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.osb-live-indicator {
    display: inline-block;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.osb-your-position {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 16px;
    border-radius: 20px;
}

.osb-status-value {
    font-weight: 700;
}

/* Your School Card */
.osb-your-school-card {
    background: white;
    border: 3px solid #3b82f6;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(59, 130, 246, 0.15);
    overflow: hidden;
}

.osb-card-active {
    border-color: #f59e0b;
    animation: glow 2s ease-in-out infinite;
}

@keyframes glow {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
    }
    50% {
        box-shadow: 0 4px 30px rgba(245, 158, 11, 0.6);
    }
}

.osb-card-completed.osb-your-school-card {
    border-color: #10b981;
}

.osb-school-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-bottom: 1px solid #bfdbfe;
}

.osb-school-card-header h3 {
    margin: 0;
    font-size: 1.5em;
    color: #1e40af;
}

.osb-school-status-badge {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: 600;
}

.osb-status-pending {
    background: #f3f4f6;
    color: #6b7280;
}

.osb-status-active {
    background: #fef3c7;
    color: #92400e;
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

.osb-status-completed {
    background: #d1fae5;
    color: #065f46;
}

.osb-school-card-body {
    padding: 25px;
}

.osb-school-card-body p {
    margin: 10px 0;
    font-size: 1.05em;
    color: #374151;
}

/* Bracket Container */
.osb-bracket-container {
    margin: 40px 0;
}

.osb-bracket-container > h2 {
    text-align: center;
    font-size: 2em;
    color: #1f2937;
    margin-bottom: 10px;
}

.osb-live-notice {
    text-align: center;
    padding: 12px;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    margin-bottom: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.osb-live-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bracket Rounds */
.osb-bracket-rounds {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    padding: 30px 20px;
    background: #f9fafb;
    border-radius: 12px;
}

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

.osb-round-header {
    text-align: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #3b82f6;
}

.osb-round-header h3 {
    margin: 0;
    font-size: 1.3em;
    color: #1e40af;
    font-weight: 700;
}

.osb-round-matches {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

/* Match Items */
.osb-match-item {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px;
    transition: all 0.3s ease;
    position: relative;
}

.osb-match-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.osb-match-pending {
    border-color: #d1d5db;
    opacity: 0.6;
}

.osb-match-active {
    border-color: #f59e0b;
    border-width: 3px;
    background: #fffbeb;
}

.osb-match-completed {
    border-color: #10b981;
    background: #f0fdf4;
}

.osb-your-match {
    border-color: #3b82f6;
    border-width: 3px;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}

.osb-your-match.osb-match-active {
    border-color: #f59e0b;
    animation: highlight 2s ease-in-out infinite;
}

@keyframes highlight {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
    }
    50% {
        box-shadow: 0 0 0 8px rgba(245, 158, 11, 0);
    }
}

.osb-match-number {
    font-size: 0.85em;
    color: #6b7280;
    margin-bottom: 8px;
    font-weight: 600;
}

.osb-match-content {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.osb-match-school {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.osb-your-badge {
    display: inline-block;
    padding: 3px 10px;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    width: fit-content;
    margin-bottom: 4px;
}

.osb-school-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #1f2937;
}

.osb-school-location {
    font-size: 0.9em;
    color: #6b7280;
}

.osb-match-pending {
    padding: 20px;
    text-align: center;
}

.osb-pending-text {
    font-style: italic;
    color: #9ca3af;
    font-size: 0.95em;
}

.osb-match-indicator {
    display: flex;
    justify-content: flex-end;
    margin-top: 8px;
}

.osb-indicator {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85em;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.osb-indicator-pending {
    background: #f3f4f6;
    color: #6b7280;
}

.osb-indicator-active {
    background: #fef3c7;
    color: #92400e;
}

.osb-indicator-completed {
    background: #d1fae5;
    color: #065f46;
}

.osb-match-message {
    margin-top: 10px;
    padding: 12px;
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 4px;
    font-size: 0.95em;
}

/* Status Update Animation */
.osb-status-updated {
    animation: statusChange 1s ease-in-out;
}

@keyframes statusChange {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
    }
}

/* Champion Section */
.osb-champion-section {
    text-align: center;
    padding: 60px 20px;
    margin: 50px 0;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: 16px;
}

.osb-trophy-animation {
    font-size: 5em;
    margin-bottom: 20px;
    animation: bounce 2s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-20px);
    }
}

.osb-champion-title {
    font-size: 2.5em;
    color: #92400e;
    margin: 0 0 30px 0;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.osb-champion-card {
    background: white;
    max-width: 500px;
    margin: 0 auto;
    padding: 40px;
    border-radius: 12px;
    border: 3px solid #f59e0b;
    box-shadow: 0 10px 40px rgba(245, 158, 11, 0.3);
}

.osb-you-won {
    border-color: #3b82f6;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    animation: celebrate 3s ease-in-out infinite;
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 10px 40px rgba(59, 130, 246, 0.3);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 15px 50px rgba(59, 130, 246, 0.5);
    }
}

.osb-champion-card h3 {
    margin: 0 0 10px 0;
    font-size: 2em;
    color: #1e40af;
}

.osb-champion-card p {
    margin: 10px 0;
    font-size: 1.1em;
    color: #6b7280;
}

.osb-champion-message {
    font-size: 1.3em !important;
    color: #1e40af !important;
    font-weight: 700;
    margin-top: 20px !important;
}

/* Group Standings */
.osb-group-standings {
    margin: 50px 0;
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.osb-group-standings h3 {
    margin: 0 0 25px 0;
    font-size: 1.5em;
    color: #1f2937;
}

.osb-standings-table-wrapper {
    overflow-x: auto;
}

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

.osb-standings-table thead {
    background: #f9fafb;
    border-bottom: 2px solid #e5e7eb;
}

.osb-standings-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    font-size: 0.85em;
    letter-spacing: 0.5px;
}

.osb-standings-table td {
    padding: 14px 12px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
}

.osb-standings-table tbody tr:hover {
    background: #f9fafb;
}

.osb-your-row {
    background: #eff6ff !important;
    font-weight: 600;
}

.osb-your-row td {
    border-top: 2px solid #3b82f6;
    border-bottom: 2px solid #3b82f6;
}

.osb-your-row td:first-child {
    border-left: 2px solid #3b82f6;
}

.osb-your-row td:last-child {
    border-right: 2px solid #3b82f6;
}

.osb-you-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #3b82f6;
    color: white;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
}

/* Notice Boxes */
.osb-notice {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.osb-notice-info {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
    color: #1e40af;
}

.osb-notice-error {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
    color: #991b1b;
}

.osb-your-group {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #bfdbfe;
}

.osb-your-group h4 {
    margin: 0 0 10px 0;
    color: #1e40af;
}

/* Responsive Design */
@media (max-width: 768px) {
    .osb-tournament-header h1 {
        font-size: 1.8em;
    }

    .osb-tournament-status-bar {
        flex-direction: column;
        gap: 15px;
    }

    .osb-bracket-rounds {
        flex-direction: column;
        gap: 30px;
    }

    .osb-bracket-round {
        min-width: 100%;
    }

    .osb-champion-title {
        font-size: 1.8em;
    }

    .osb-school-card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .osb-standings-table {
        font-size: 0.85em;
    }

    .osb-standings-table th,
    .osb-standings-table td {
        padding: 8px 6px;
    }
}

@media (max-width: 480px) {
    .osb-tournament-view {
        padding: 10px;
    }

    .osb-tournament-header {
        padding: 25px 15px;
    }

    .osb-champion-card {
        padding: 25px;
    }

    .osb-trophy-animation {
        font-size: 3em;
    }
}
