/* Tournament Page Styles */

/* Auth Prompt */
.auth-prompt {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 8px;
    text-align: center;
}

.auth-prompt p {
    color: var(--text-primary);
    font-size: 1rem;
    margin: 0;
}

.auth-prompt a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.auth-prompt a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* Tournament Hero */
.tournament-hero {
    background: linear-gradient(135deg, #0A0A0F 0%, #1A0A2E 50%, #16213E 100%);
    padding: 120px 20px 60px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.tournament-title {
    font-family: 'Orbitron', sans-serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.tournament-subtitle {
    font-size: 1.2rem;
    color: var(--text-secondary);
}

/* Tournament Main */
.tournament-main {
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
    background: var(--dark-bg);
}

/* Tabs */
.tournament-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 1rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-family: 'Inter', sans-serif;
}

.tab-btn:hover {
    color: var(--primary-color);
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms */
.tournament-form {
    max-width: 600px;
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--dark-bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

/* Teams List */
.teams-list,
.tournaments-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.team-card,
.tournament-card {
    background: var(--dark-bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
}

.team-card:hover,
.tournament-card:hover {
    transform: translateY(-3px);
    border-color: var(--primary-color);
    box-shadow: 0 10px 30px rgba(0, 212, 255, 0.2);
}

.team-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 1rem;
}

.team-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.team-tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: rgba(0, 212, 255, 0.1);
    border: 1px solid var(--primary-color);
    border-radius: 4px;
    color: var(--primary-color);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: 'Orbitron', sans-serif;
}

.team-members {
    margin-top: 1rem;
}

.team-member {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.team-member.leader {
    color: var(--secondary-color);
    font-weight: 600;
}

.team-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.team-actions .btn {
    flex: 1;
    min-width: 120px;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Tournament Card */
.tournament-card {
    cursor: default;
}

.tournament-name {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tournament-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.tournament-status {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 0.5rem;
}

.tournament-status.open {
    background: rgba(0, 255, 0, 0.1);
    color: #00ff00;
    border: 1px solid #00ff00;
}

.tournament-status.ongoing {
    background: rgba(255, 215, 0, 0.1);
    color: var(--secondary-color);
    border: 1px solid var(--secondary-color);
}

.tournament-status.completed {
    background: rgba(128, 128, 128, 0.1);
    color: #808080;
    border: 1px solid #808080;
}

/* Bracket View */
.bracket-container {
    margin-top: 2rem;
}

.bracket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.bracket-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.bracket-select {
    min-width: 250px;
    padding: 0.75rem 1rem;
    background: var(--dark-bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
}

.bracket-view {
    background: var(--dark-bg-lighter);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    overflow-x: auto;
    min-height: 400px;
}

/* Bracket Structure */
.bracket-wrapper {
    display: flex;
    justify-content: center;
    min-width: fit-content;
    padding: 1rem 0;
}

.bracket-round {
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    margin: 0 2rem;
    min-width: 200px;
}

.bracket-round-title {
    text-align: center;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.bracket-match {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin: 0.75rem 0;
    min-height: 80px;
    width: 200px;
    transition: all 0.3s ease;
}

.bracket-match:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0, 212, 255, 0.2);
}

.bracket-match.active {
    border-color: var(--secondary-color);
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
}

.bracket-team {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bracket-team:last-child {
    border-bottom: none;
}

.bracket-team.winner {
    background: rgba(255, 215, 0, 0.1);
    color: var(--secondary-color);
    font-weight: 600;
}

.bracket-team-name {
    flex: 1;
    font-size: 0.9rem;
}

.bracket-team-score {
    font-weight: 700;
    color: var(--primary-color);
    font-family: 'Orbitron', sans-serif;
    min-width: 30px;
    text-align: right;
}

.bracket-match-code {
    padding: 0.5rem;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--dark-bg-light);
    font-size: 0.8rem;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
}

.bracket-match-code:hover {
    color: var(--primary-color);
    background: rgba(0, 212, 255, 0.05);
}

.bracket-match-code.clickable {
    color: var(--secondary-color);
    font-weight: 600;
    font-family: 'Orbitron', sans-serif;
}

.bracket-match-code.clickable:hover {
    color: var(--primary-color);
}

.bracket-bye {
    background: rgba(128, 128, 128, 0.1);
    color: var(--text-muted);
    font-style: italic;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-secondary);
    cursor: pointer;
    transition: color 0.3s ease;
    line-height: 1;
}

.modal-close:hover {
    color: var(--primary-color);
}

/* Match Code Display */
.match-code-display {
    text-align: center;
    padding: 2rem;
    background: var(--dark-bg-lighter);
    border-radius: 8px;
    margin: 1rem 0;
}

.match-code {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--secondary-color);
    letter-spacing: 0.2em;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--dark-bg);
    border: 2px solid var(--secondary-color);
    border-radius: 8px;
    display: inline-block;
    min-width: 200px;
}

.match-code-label {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.match-code-copy {
    margin-top: 1rem;
}

/* Invite Form */
.invite-form {
    margin-top: 1rem;
}

.invite-input-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.invite-input-group input {
    flex: 1;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state p {
    font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
    .tournament-tabs {
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }
    
    .bracket-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .bracket-controls {
        flex-direction: column;
        width: 100%;
    }
    
    .bracket-select {
        width: 100%;
    }
    
    .bracket-wrapper {
        flex-direction: column;
    }
    
    .bracket-round {
        margin: 1rem 0;
        width: 100%;
    }
    
    .bracket-match {
        width: 100%;
    }
    
    .teams-list,
    .tournaments-list {
        grid-template-columns: 1fr;
    }
    
    .match-code {
        font-size: 1.8rem;
    }
}

