/**
 * School Scoreboard System - Display Styles
 */

/* CSS Variables for dynamic styling */
:root {
    --background-color: #000;
    --text-color: #fff;
    --accent-color: rgba(255, 255, 255, 0.1);
    --border-color: rgba(255, 255, 255, 0.2);
    --highlight-color: rgba(255, 255, 255, 0.8);
}

/* Base styles */
body {
    margin: 0;
    padding: 0;
    font-family: 'Arial', sans-serif;
    overflow: hidden;
    background-color: var(--background-color);
    color: var(--text-color);
    transition: background-color 0.5s ease, color 0.5s ease;
}

.scoreboard-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

/* School logos and names */
.teams-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 20px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
}

.team-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    margin-bottom: 10px;
    background-color: var(--accent-color);
    border-radius: 10px;
    padding: 10px;
    transition: background-color 0.5s ease;
}

.team-role-label {
    font-size: 2rem;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
    padding: 8px 16px;
    border-radius: 8px;
    margin-bottom: 15px;
    letter-spacing: 2px;
    border: 2px solid;
}

.batting-label {
    background-color: rgba(0, 150, 0, 0.8);
    color: #ffffff;
    border-color: #00ff00;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.bowling-label {
    background-color: rgba(150, 0, 0, 0.8);
    color: #ffffff;
    border-color: #ff4444;
    box-shadow: 0 0 10px rgba(255, 68, 68, 0.5);
}

.team-name {
    font-size: 2.5rem;
    font-weight: bold;
    text-align: center;
    text-transform: uppercase;
}

.team-sub-name {
    font-size: 1.2rem;
    text-align: center;
    opacity: 0.8;
    margin-top: 5px;
}

.school-name {
    font-size: 1.5rem;
    text-align: center;
    opacity: 0.8;
}

.versus {
    font-size: 2rem;
    font-weight: bold;
    margin: 0 20px;
}

/* Score display */
.score-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin: 20px 0;
}

.score-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 45%;
}

.score {
    font-size: 8rem;
    font-weight: bold;
    line-height: 1;
}

.score-label {
    font-size: 1.5rem;
    margin-top: 10px;
}

/* Rugby specific styles */
.rugby-info {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
    width: 100%;
}

.period, .timer {
    font-size: 2.5rem;
    font-weight: bold;
    margin: 0 20px;
    padding: 10px 20px;
    background-color: var(--accent-color);
    border-radius: 10px;
    transition: background-color 0.5s ease;
}

.penalties {
    font-size: 1.5rem;
    margin-top: 10px;
}

.scorers-container {
    width: 100%;
    margin-top: 20px;
}

.scorers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.scorers-title {
    font-size: 1.8rem;
    font-weight: bold;
}

.scorers-toggle {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.5s ease, color 0.5s ease;
}

.scorers-toggle:hover {
    background-color: var(--accent-color);
}

.scorers-list {
    display: flex;
    justify-content: space-between;
    width: 100%;
}

.team-scorers {
    width: 45%;
}

.scorer {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
    transition: border-color 0.5s ease;
}

.scorer-name {
    font-weight: bold;
}

.score-type {
    opacity: 0.8;
}

/* Cricket specific styles */
.cricket-scoreboard {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.cricket-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.innings-info {
    font-size: 2rem;
    font-weight: bold;
    padding: 10px 20px;
    background-color: var(--accent-color);
    border-radius: 10px;
    transition: background-color 0.5s ease;
}

.cricket-score {
    font-size: 6rem;
    font-weight: bold;
}

.cricket-detail {
    font-size: 2.5rem;
    margin: 10px 0;
}

.batsmen-container {
    width: 100%;
    margin: 20px 0;
}

.batsman {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.5rem;
    transition: border-color 0.5s ease;
}

.batsman.on-strike .batsman-name::after {
    content: " *";
}

.batsman-stats {
    display: flex;
}

.batsman-stat {
    margin-left: 20px;
    min-width: 50px;
    text-align: center;
}

.bowler-container {
    width: 100%;
    margin: 20px 0;
}

.bowler {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-color);
    font-size: 1.5rem;
    transition: border-color 0.5s ease;
}

.bowler-stats {
    display: flex;
}

.bowler-stat {
    margin-left: 20px;
    min-width: 50px;
    text-align: center;
}

.partnership {
    font-size: 1.5rem;
    margin: 10px 0;
}

/* Current Players Display */
.current-players-container {
    display: flex;
    justify-content: center;
    gap: 50px;
    margin: 20px 0;
    font-size: 2rem;
}

.current-batsman, .current-bowler {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 20px;
    background-color: var(--accent-color);
    border-radius: 10px;
    min-width: 250px;
}

.player-label {
    font-size: 1.5rem;
    opacity: 0.8;
}

.rates-container {
    display: flex;
    justify-content: space-around;
    width: 100%;
    margin: 20px 0;
}

.rate {
    font-size: 1.5rem;
    padding: 10px 20px;
    background-color: var(--accent-color);
    border-radius: 10px;
    transition: background-color 0.5s ease;
}

.target {
    font-size: 2rem;
    font-weight: bold;
    margin: 20px 0;
    padding: 10px 20px;
    background-color: var(--accent-color);
    border-radius: 10px;
    transition: background-color 0.5s ease;
}

/* Controls */
.controls {
    position: fixed;
    bottom: 10px;
    right: 10px;
    display: flex;
    gap: 10px;
}

.control-button {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.3s, border-color 0.5s ease, color 0.5s ease;
}

.control-button:hover {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .team-logo {
        width: 120px;
        height: 120px;
    }
    
    .team-role-label {
        font-size: 1.6rem;
        padding: 6px 12px;
        letter-spacing: 1px;
    }
    
    .team-name {
        font-size: 2rem;
    }
    
    .team-sub-name {
        font-size: 1rem;
    }
    
    .school-name {
        font-size: 1.2rem;
    }
    
    .score {
        font-size: 6rem;
    }
    
    .period, .timer {
        font-size: 2rem;
    }
    
    .cricket-score {
        font-size: 5rem;
    }
    
    .cricket-detail {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .team-logo {
        width: 80px;
        height: 80px;
    }
    
    .team-role-label {
        font-size: 1.2rem;
        padding: 4px 8px;
        letter-spacing: 1px;
        margin-bottom: 10px;
    }
    
    .team-name {
        font-size: 1.5rem;
    }
    
    .team-sub-name {
        font-size: 0.9rem;
    }
    
    .school-name {
        font-size: 1rem;
    }
    
    .score {
        font-size: 4rem;
    }
    
    .versus {
        font-size: 1.5rem;
    }
    
    .period, .timer {
        font-size: 1.5rem;
        margin: 0 10px;
    }
    
    .cricket-score {
        font-size: 3.5rem;
    }
    
    .cricket-detail {
        font-size: 1.5rem;
    }
    
    .batsman, .bowler {
        font-size: 1.2rem;
    }
}

@media (max-width: 600px) {
    .team-role-label {
        font-size: 1rem;
        padding: 3px 6px;
        margin-bottom: 8px;
    }
}

/* Prevent stacking on smaller screens */
@media (max-width: 600px) {
    .teams-container, .score-container, .scorers-list {
        flex-direction: row;
    }
    
    .team, .score-box, .team-scorers {
        width: 45%;
    }
}
