/* ==========================================================================
   Scorer Theme - Beachvolleyball Scoring Page
   A professional, "live-score" inspired dark-blue glass theme.
   Reuses the same navy gradient + gold accent used on the home page live
   score card (.sbt-live-card) and statistics views, so the Scorer feels
   like a natural extension of the public-facing live graphics.

   Global CSS variables are defined once on :root so every scoring
   component (team panel, score button, player badge, chips, toolbar...)
   shares a single, easy-to-tweak source of truth.
   ========================================================================== */

:root {
    /* -- Core palette (matches .sbt-live-card / .lst-header / .stat-summary) -- */
    --scorer-navy-start: #0d2a5c;
    --scorer-navy-mid: #163a7a;
    --scorer-navy-end: #0a1e42;
    --scorer-gold: #ffd232;
    --scorer-gold-soft: rgba(255, 210, 50, 0.35);
    --scorer-gold-glow: rgba(255, 210, 50, 0.8);
    --scorer-success: #4ade80;

    /* -- Glass / blur surfaces -- */
    --scorer-glass-bg: rgba(255, 255, 255, 0.07);
    --scorer-glass-bg-strong: rgba(255, 255, 255, 0.12);
    --scorer-glass-border: rgba(255, 255, 255, 0.16);
    --scorer-blur: 14px;

    /* -- Text -- */
    --scorer-text: #ffffff;
    --scorer-text-muted: rgba(255, 255, 255, 0.6);
    --scorer-text-faint: rgba(255, 255, 255, 0.4);

    /* -- Shape / elevation -- */
    --scorer-radius-lg: 20px;
    --scorer-radius-md: 14px;
    --scorer-radius-sm: 10px;
    --scorer-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    --scorer-shadow-sm: 0 4px 14px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   Light skin
   Alternative to the default navy/gold skin. Applied by adding the
   "scorer-theme-light" class alongside "scorer-page" (see ClientSettings.ScorerSkin).
   Overrides the same CSS variables used above so every scoring component
   (team panel, score button, chips, toolbar...) automatically re-themes.
   ========================================================================== */
.scorer-page.scorer-theme-light {
    --scorer-navy-start: #f5f7fb;
    --scorer-navy-mid: #eef1f8;
    --scorer-navy-end: #e4e9f4;
    --scorer-gold: #1e4fa3;
    --scorer-gold-soft: rgba(30, 79, 163, 0.25);
    --scorer-gold-glow: rgba(30, 79, 163, 0.55);
    --scorer-success: #16a34a;

    --scorer-glass-bg: rgba(255, 255, 255, 0.75);
    --scorer-glass-bg-strong: rgba(255, 255, 255, 0.92);
    --scorer-glass-border: rgba(13, 42, 92, 0.12);

    --scorer-text: #0d2a5c;
    --scorer-text-muted: rgba(13, 42, 92, 0.65);
    --scorer-text-faint: rgba(13, 42, 92, 0.45);

    --scorer-shadow: 0 8px 24px rgba(13, 42, 92, 0.12);
    --scorer-shadow-sm: 0 4px 12px rgba(13, 42, 92, 0.1);
}

/* ==========================================================================
   Page background
   ========================================================================== */
.scorer-page {
    position: relative;
    min-height: 100%;
    padding: 0.75rem 0.5rem 2rem;
    margin: -2px -10px 0; /* bleed under DefaultLayout .main-body padding */
    background: linear-gradient(160deg, var(--scorer-navy-start) 0%, var(--scorer-navy-mid) 45%, var(--scorer-navy-end) 100%);
    color: var(--scorer-text);
    overflow: hidden;
    isolation: isolate;
}

/* Soft, faded decorative blur blobs behind the content - purely visual */
.scorer-page::before,
.scorer-page::after {
    content: "";
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(70px);
    opacity: 0.35;
    pointer-events: none;
}

.scorer-page::before {
    width: 280px;
    height: 280px;
    top: -80px;
    left: -60px;
    background: var(--scorer-gold);
    opacity: 0.18;
}

.scorer-page::after {
    width: 320px;
    height: 320px;
    bottom: -100px;
    right: -80px;
    background: #1e4fa3;
    opacity: 0.4;
}

.scorer-page a {
    color: var(--scorer-gold);
}

/* ==========================================================================
   Header / info bar (score, info chip, "match finished" summary)
   ========================================================================== */
.scorer-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    text-align: center;
    padding: 1rem;
    border-radius: var(--scorer-radius-lg);
    background: var(--scorer-glass-bg);
    border: 1px solid var(--scorer-glass-border);
    backdrop-filter: blur(var(--scorer-blur));
    -webkit-backdrop-filter: blur(var(--scorer-blur));
    box-shadow: var(--scorer-shadow);
    margin-bottom: 1rem;
}

.scorer-header h3 {
    margin: 0;
    font-weight: 700;
}

.scorer-header h1 {
    margin: 0.25rem 0 0;
    color: var(--scorer-gold);
    font-weight: 800;
    letter-spacing: -0.01em;
}

.scorer-header p {
    margin: 0;
    color: var(--scorer-text-muted);
}

/* ==========================================================================
   Team panel (each side of the court)
   ========================================================================== */
.scorer-team-panel {
    border-radius: var(--scorer-radius-lg);
    background: var(--scorer-glass-bg);
    border: 1px solid var(--scorer-glass-border);
    backdrop-filter: blur(var(--scorer-blur));
    -webkit-backdrop-filter: blur(var(--scorer-blur));
    box-shadow: var(--scorer-shadow);
    padding: 0.85rem 0.6rem;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.scorer-team-panel.is-serving {
    border-color: var(--scorer-gold-soft);
    box-shadow: var(--scorer-shadow), 0 0 0 1px var(--scorer-gold-soft);
}

.scorer-team-panel .team-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--scorer-text-muted);
    display: block;
    margin-bottom: 0.25rem;
}

/* ==========================================================================
   Score button - the big tappable score display
   ========================================================================== */
.scoring-btn {
    width: 100%;
    max-width: 190px;
    height: 100px;
    margin: 0.5rem auto 1.25rem !important;
    font-size: 110px;
    font-weight: 800;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--scorer-radius-md) !important;
    background: linear-gradient(160deg, rgba(22, 58, 122, 0.85) 0%, rgba(13, 42, 92, 0.85) 55%, rgba(10, 30, 66, 0.9) 100%) !important;
    border: none !important;
    backdrop-filter: blur(var(--scorer-blur));
    -webkit-backdrop-filter: blur(var(--scorer-blur));
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.scoring-btn:hover {
    background: linear-gradient(160deg, rgba(30, 79, 163, 0.9) 0%, rgba(16, 58, 122, 0.9) 55%, rgba(10, 30, 66, 0.95) 100%) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.scoring-btn:active {
    transform: scale(0.97);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

/* Light skin overrides for elements with hardcoded (non-variable) colors */
.scorer-theme-light .scoring-btn {
    background: linear-gradient(160deg, rgba(255, 255, 255, 0.95) 0%, rgba(238, 241, 248, 0.95) 55%, rgba(224, 230, 244, 0.95) 100%) !important;
    box-shadow: 0 6px 16px rgba(13, 42, 92, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.scorer-theme-light .scoring-btn:hover {
    background: linear-gradient(160deg, rgba(255, 255, 255, 1) 0%, rgba(232, 237, 248, 1) 55%, rgba(216, 224, 242, 1) 100%) !important;
    box-shadow: 0 8px 20px rgba(13, 42, 92, 0.18), inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.scorer-theme-light .scoring-btn:active {
    box-shadow: 0 3px 10px rgba(13, 42, 92, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.scorer-theme-light.scorer-page::after {
    background: #9db6dd;
}

/* One-time hint glow shown briefly when the page first loads, to draw the
   new user's attention to the tappable score buttons. Pulses 3 times then stops. */
@keyframes scoring-btn-hint-glow {
    0%, 100% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 0 rgba(255, 210, 50, 0);
    }
    50% {
        box-shadow: 0 6px 16px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 0 26px 8px var(--scorer-gold-glow);
    }
}

.scoring-btn {
    animation: scoring-btn-hint-glow 0.67s ease-in-out 3;
}

.scoring-btn .k-button {
    border: none !important;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 110px;
    line-height: 1;
    font-weight: 800;
    color: var(--scorer-gold) !important;
    background: none !important;
    text-shadow: 0 0 14px var(--scorer-gold-glow);
}

.scoring-btn button.k-button {
    font-size: 80px;
}

.scoring-btn .k-button .k-button-text {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Serving player highlight - the "yellow text" signature look
   ========================================================================== */
.scoring-player {
    display: block;
    padding: 2px 6px;
    border-radius: 6px;
    color: var(--scorer-text);
    font-size: 0.92rem;
}

.scoring-player-serving {
    background: none !important;
    color: var(--scorer-gold) !important;
    font-weight: 700 !important;
    text-shadow: 0 0 8px var(--scorer-gold-glow);
}

/* Next server: no background fill - a small gold dot in front of the name
   is enough to indicate "up next" without competing with the current
   server's yellow text. */
.scoring-player-next-server {
    background: none !important;
    color: var(--scorer-text-muted) !important;
    font-style: italic;
    position: relative;
    padding-left: 14px;
}

.scoring-player-next-server::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 50%;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--scorer-gold);
    opacity: 0.6;
    transform: translateY(-50%);
}

.scoring-legend-item {
    color: var(--scorer-text-muted) !important;
}

/* Legend swatches get their own solid colors, since the serving / next
   server text classes no longer carry a background fill. */
.scoring-legend-swatch.scoring-player-serving {
    background: var(--scorer-gold) !important;
    box-shadow: 0 0 6px var(--scorer-gold-glow);
}

.scoring-legend-swatch.scoring-player-next-server {
    background: var(--scorer-gold) !important;
    opacity: 0.5;
}

/* ==========================================================================
   Status chips / info banners
   ========================================================================== */
.scorer-page .k-chip {
    background: var(--scorer-glass-bg-strong);
    border: 1px solid var(--scorer-glass-border);
    color: var(--scorer-text);
    backdrop-filter: blur(var(--scorer-blur));
    -webkit-backdrop-filter: blur(var(--scorer-blur));
}

.scorer-page .k-chip.bg-warning,
.scorer-page .k-chip.bg-info {
    color: var(--scorer-text) !important;
}

/* Match / set point highlight chips keep their success/info theme colors,
   but pick up the glow so they read clearly on the dark background. */
.scorer-page .k-chip-solid-success,
.scorer-page .k-chip-solid-info {
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.35);
}

.scorer-icon-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
}

.scorer-icon-row-start {
    justify-content: flex-start;
}

.scorer-icon-row-end {
    justify-content: flex-start;
    flex-direction: row-reverse;
}

/* Shared circular "icon button" look for the team menu button and the
   timeout status chip, so they read as one consistent control group. */
.scorer-icon-btn,
.scorer-icon-row .k-chip {
    width: 40px;
    height: 40px;
    min-width: 40px;
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px !important;
    background: var(--scorer-glass-bg-strong) !important;
    border: 1px solid var(--scorer-glass-border) !important;
    color: var(--scorer-text) !important;
    backdrop-filter: blur(var(--scorer-blur));
    -webkit-backdrop-filter: blur(var(--scorer-blur));
    box-shadow: var(--scorer-shadow-sm);
}

/* When a timeout has been taken (status-active), highlight the chip in gold
   with a dark navy icon so it stands out clearly from the untaken slots. */
.scorer-icon-row .k-chip.status-active {
    background: var(--scorer-gold) !important;
    border-color: var(--scorer-gold) !important;
    color: var(--scorer-navy-end) !important;
    box-shadow: 0 0 10px var(--scorer-gold-glow);
}

.scorer-icon-row .k-chip.status-active .k-icon,
.scorer-icon-row .k-chip.status-active .k-font-icon {
    color: var(--scorer-navy-end) !important;
    text-shadow: none;
}

/* ==========================================================================
   Bottom toolbar (undo point, switch side, auto/manual switch...)
   ========================================================================== */
.scorer-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.scorer-toolbar small.muted {
    color: var(--scorer-text-faint) !important;
}

.scorer-page .k-button-solid-base {
    background: var(--scorer-glass-bg-strong);
    border-color: var(--scorer-glass-border);
    color: var(--scorer-text);
    backdrop-filter: blur(var(--scorer-blur));
    -webkit-backdrop-filter: blur(var(--scorer-blur));
}

.scorer-page .k-button.bg-light {
    background: var(--scorer-glass-bg-strong) !important;
    color: var(--scorer-text) !important;
    border: 1px solid var(--scorer-glass-border) !important;
}

/* Floating action button + popup menu (timeout, sanctions, settings...) */
.scorer-page .k-popup {
    background: var(--scorer-navy-end);
    border: 1px solid var(--scorer-glass-border);
    box-shadow: var(--scorer-shadow);
}

/* Team-level popup menu (timeout / switch players / sanctions) - same
   dark-blue glass/blur look instead of the default white popup.
   The Class="scorer-team-popup" passed to <TelerikPopup> can land either on
   the popup's own .k-popup element or on a wrapper around it, depending on
   the Telerik version, so cover both cases with a compound AND a descendant
   selector. */
.scorer-team-popup.k-popup,
.scorer-team-popup .k-popup,
.k-popup.scorer-team-popup {
    background: var(--scorer-glass-bg-strong) !important;
    border: 1px solid var(--scorer-glass-border) !important;
    backdrop-filter: blur(var(--scorer-blur));
    -webkit-backdrop-filter: blur(var(--scorer-blur));
    box-shadow: var(--scorer-shadow);
    color: var(--scorer-text);
}

.scorer-team-popup .k-button {
    color: var(--scorer-text) !important;
}

.scorer-team-popup .k-button:hover {
    background: var(--scorer-glass-bg) !important;
}

/* Prevent long Swedish labels (e.g. "Byt spelarnummer", "Medicnsk timeout")
   from overflowing the popup bounds - stretch buttons to the popup width
   and allow their text to wrap onto a second line instead of spilling out. */
.scorer-team-popup-menu {
    width: 100%;
    box-sizing: border-box;
    padding: 14px;
    gap: 10px;
}

.scorer-team-popup-menu .k-button {
    padding: 12px 16px !important;
    width: 100%;
    box-sizing: border-box;
    white-space: normal;
    text-align: left;
    justify-content: flex-start;
}

.scorer-team-popup-menu .k-button .k-button-text {
    white-space: normal;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.2;
}

/* ==========================================================================
   "Poäng för poäng" (point-by-point) tab strip - match the dark-blue glass
   theme instead of the default light Bootstrap tab styling.
   ========================================================================== */
.scorer-tabstrip.k-tabstrip {
    color: var(--scorer-text);
}

.scorer-tabstrip .k-tabstrip-items-wrapper {
    background: var(--scorer-glass-bg);
    border-bottom: 1px solid var(--scorer-glass-border);
}

.scorer-tabstrip .k-tabstrip-item {
    color: var(--scorer-text-muted) !important;
    background: transparent !important;
}

.scorer-tabstrip .k-tabstrip-item.k-active {
    color: var(--scorer-gold) !important;
    background: transparent !important;
    border-color: var(--scorer-gold) !important;
}

.scorer-tabstrip .k-tabstrip-content,
.scorer-tabstrip > .k-content {
    background: transparent;
    color: var(--scorer-text);
    border: none;
}

.scorer-tabstrip h5 {
    color: var(--scorer-text);
}

.scorer-tabstrip .k-button.bg-light,
.scorer-tabstrip span.bg-light {
    background: var(--scorer-glass-bg-strong) !important;
    color: var(--scorer-text) !important;
    border: 1px solid var(--scorer-glass-border) !important;
}

.scorer-tabstrip p.bg-info {
    background: var(--scorer-gold) !important;
    color: var(--scorer-navy-end) !important;
    font-weight: 700;
    border-radius: var(--scorer-radius-sm);
}

.scorer-tabstrip .k-button.bg-success {
    background: var(--scorer-gold) !important;
    color: var(--scorer-navy-end) !important;
    border: none !important;
    font-weight: 700;
}

/* ==========================================================================
   Top navigation bar (site-wide app bar) - dark-blue glass theme, matching
   the Scorer page. Menu icon and favorite heart get a gold/yellow accent.
   ========================================================================== */
.page,
.main-body {
    padding-top: var(--appbar-height, 64px);
}
.top-nav.k-appbar,
.top-nav-public.k-appbar {
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10000;
    height: var(--appbar-height, 64px) !important;
    display: flex !important;
    align-items: center !important;
}
.top-nav.k-appbar,
.top-nav-public.k-appbar {
    background: linear-gradient(160deg, var(--scorer-navy-start) 0%, var(--scorer-navy-mid) 55%, var(--scorer-navy-end) 100%) !important;
    border: none !important;
    box-shadow: var(--scorer-shadow-sm);
    color: var(--scorer-text);
}

.top-nav .k-button,
.top-nav-public .k-button {
    color: var(--scorer-text) !important;
}

/* Hamburger main-menu icon (TelerikMenu with Icon = SvgIcon.Menu) */
.top-nav #mainMenu .k-menu-item .k-icon,
.top-nav #mainMenu .k-menu-item .k-svg-icon {
    color: var(--scorer-gold) !important;
}

.top-nav #mainMenu .k-menu {
    background: transparent !important;
}

/* Public site hamburger menu-toggle button */
.top-nav-public .menu-toggle-btn-icon .k-icon,
.top-nav-public .menu-toggle-btn-icon .k-svg-icon {
    color: var(--scorer-gold) !important;
}

/* Favorite heart / profile buttons */
.top-nav .icon-only-btn,
.top-nav-public .nav-icon-btn {
    color: var(--scorer-text) !important;
}

.top-nav .icon-only-btn .k-icon,
.top-nav .icon-only-btn .k-svg-icon,
.top-nav-public .nav-icon-btn .k-icon,
.top-nav-public .nav-icon-btn .k-svg-icon {
    color: var(--scorer-gold) !important;
}

/* Make the favorite heart icon noticeably bigger than the other icons */
.top-nav .scorer-favorite-btn .k-icon,
.top-nav .scorer-favorite-btn .k-svg-icon,
.top-nav-public .scorer-favorite-btn .k-icon,
.top-nav-public .scorer-favorite-btn .k-svg-icon {
    font-size: 1.6rem;
    width: 1.6rem;
    height: 1.6rem;
}


@media (max-width: 480px) {
    .scoring-btn {
        height: 100px;
        font-size: 48px;
    }

    .scoring-btn .k-button {
        font-size: 48px;
    }

    .scorer-header h1 {
        font-size: 1.6rem;
    }
}
