/* Main styling for Scoreboard */

.team-column {
    transition: all 0.3s ease;
}

.team-card {
    --team-color: #dbdbdb;
    background: #f9f9f9;
    border-radius: 12px;
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    border: 1px solid #eee;
    border-top: 4px solid var(--team-color);
    transition: all 0.3s ease;
}

.team-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.team-card.is-selected {
    outline: 3px solid var(--team-color);
    outline-offset: 2px;
}

.team-card.is-winner {
    background: #fffdf0;
    border: 2px solid #FFD700;
    border-top: 4px solid #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    transform: scale(1.02);
    z-index: 10;
}

.team-card.is-winner::before {
    content: '\1F451';
    position: absolute;
    top: -15px;
    font-size: 2rem;
    animation: bounce 1s infinite;
}

/* Team index badge (keyboard selection) */
.team-index-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--team-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* Score animations */
@keyframes scoreBumpUp {
    0% { transform: scale(1); }
    30% { transform: scale(1.15) translateY(-4px); }
    100% { transform: scale(1); }
}

@keyframes scoreBumpDown {
    0% { transform: scale(1); }
    30% { transform: scale(0.9) translateY(4px); }
    100% { transform: scale(1); }
}

.score-display.score-bump-up {
    animation: scoreBumpUp 0.3s ease-out;
}

.score-display.score-bump-down {
    animation: scoreBumpDown 0.3s ease-out;
}

/* Team Name Input */
.team-name-input {
    border: 1px solid transparent;
    background: transparent;
    font-size: 1.5rem;
    font-weight: 600;
    text-align: center;
    width: 100%;
    margin-bottom: 0.5rem;
    padding: 0.25rem;
    border-radius: 4px;
    color: #363636;
}

.team-name-input:hover {
    border-color: #dbdbdb;
    background: white;
}

.team-name-input:focus {
    background: white;
    border-color: #3273dc;
    box-shadow: 0 0 0 2px rgba(50, 115, 220, 0.2);
    outline: none;
}

/* Score Display */
.score-display {
    --score-scale: 1;
    font-size: clamp(3rem, calc(8vw * var(--score-scale)), calc(6rem * var(--score-scale)));
    font-weight: 700;
    line-height: 1;
    margin: 1.5rem 0;
    font-family: 'Roboto Mono', monospace;
    font-variant-numeric: tabular-nums;
    color: #363636;
    cursor: default;
    user-select: none;
    transition: color 0.2s;
    max-width: 100%;
}

.score-display.is-negative {
    color: #ff3860;
}

.team-card.is-winner .score-display {
    color: #d4af37;
    text-shadow: 2px 2px 0px rgba(0,0,0,0.1);
}

/* Controls */
.score-controls {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.control-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    background: white;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.control-btn.btn-minus {
    color: #ff3860;
}

.control-btn.btn-plus {
    color: #48c774;
    background: #f0fff4;
}

.control-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.control-btn:active {
    transform: scale(0.95);
}

.remove-team-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    color: #dbdbdb;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
    border-radius: 4px;
    opacity: 0;
    transition: all 0.2s;
}

.team-card:hover .remove-team-btn {
    opacity: 1;
}

.remove-team-btn:hover {
    color: #ff3860;
    background: rgba(255, 56, 96, 0.1);
}

/* Keyboard shortcuts kbd styling */
kbd {
    background: #f5f5f5;
    border: 1px solid #dbdbdb;
    border-radius: 3px;
    padding: 2px 6px;
    font-size: 0.8em;
    font-family: inherit;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

/* Custom Modal transition */
.modal-card {
    transition: transform 0.3s ease-out;
    transform: scale(0.9);
    opacity: 0;
}

.modal.is-active .modal-card {
    transform: scale(1);
    opacity: 1;
}

/* Fullscreen adjustments */
body.is-fullscreen .navbar,
body.is-fullscreen .section > .container > .columns > .column > .box > .level {
    display: none !important;
}

body.is-fullscreen .section {
    padding: 0;
    height: 100vh;
    width: 100vw;
}

body.is-fullscreen .box {
    height: 100%;
    width: 100%;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

body.is-fullscreen #scoreboard {
    height: 100%;
    align-items: center;
}

/* Floating controls in fullscreen */
.fullscreen-controls {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
    background: rgba(255,255,255,0.8);
    padding: 0.5rem;
    border-radius: 8px;
    display: none;
}

body.is-fullscreen .fullscreen-controls {
    display: flex;
    gap: 0.5rem;
}

/* ===== Mobile toolbar ===== */
@media screen and (max-width: 768px) {
    .level.is-mobile.mb-5 {
        flex-wrap: wrap;
        gap: 0.75rem;
    }
    .level.is-mobile.mb-5 .level-left {
        flex-shrink: 0;
    }
    .level.is-mobile.mb-5 .level-right {
        flex-basis: 100%;
    }
    .level.is-mobile.mb-5 .level-right .buttons {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 0.4rem;
    }
    .level.is-mobile.mb-5 .level-right .buttons .field.has-addons {
        margin-right: auto;
    }
}

/* ===== Dark Mode ===== */
[data-theme="dark"] .team-card {
    background: var(--bg-card);
    border-color: var(--border-color);
}

[data-theme="dark"] .team-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
}

[data-theme="dark"] .team-card.is-winner {
    background: #3a3520;
    border-color: #FFD700;
}

[data-theme="dark"] .team-name-input {
    color: var(--text-primary);
}

[data-theme="dark"] .team-name-input:hover {
    border-color: var(--border-color);
    background: var(--bg-secondary);
}

[data-theme="dark"] .team-name-input:focus {
    background: var(--bg-secondary);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(50, 115, 220, 0.3);
}

[data-theme="dark"] .score-display {
    color: var(--text-primary);
}

[data-theme="dark"] .score-display.is-negative {
    color: #ff6b6b;
}

[data-theme="dark"] .team-card.is-winner .score-display {
    color: #FFD700;
}

[data-theme="dark"] .control-btn {
    background: var(--bg-secondary);
    box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}

[data-theme="dark"] .control-btn.btn-plus {
    background: #2d3b2d;
}

[data-theme="dark"] .control-btn:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.4);
}

[data-theme="dark"] .remove-team-btn {
    color: var(--text-muted);
}

[data-theme="dark"] .remove-team-btn:hover {
    color: #ff6b6b;
    background: rgba(255, 107, 107, 0.15);
}

[data-theme="dark"] kbd {
    background: var(--bg-secondary);
    border-color: var(--border-color);
    color: var(--text-primary);
    box-shadow: 0 1px 0 rgba(0,0,0,0.3);
}

[data-theme="dark"] .fullscreen-controls {
    background: rgba(43, 43, 43, 0.8);
}
