﻿/* ===========================
   Video Events UI (token-based)
   =========================== */

.ve-page {
    height: 100%;
    min-height: 100%;
    color: var(--text);
}

.ve-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px;
    /* Nice background that respects your theme */
    background: radial-gradient(1200px 600px at 10% 0%, color-mix(in srgb, var(--main) 18%, transparent), transparent 60%), radial-gradient(900px 520px at 100% 0%, color-mix(in srgb, var(--main-light) 14%, transparent), transparent 60%), linear-gradient(180deg, color-mix(in srgb, var(--surface) 35%, transparent), transparent), var(--bg);
}

.ve-topbar {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 12px;
    min-height: 92px;
}

.ve-main {
    flex: 1;
    min-height: 0;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 12px;
}

/* Cards / panels */
.ve-card {
    background: var(--glass-tint);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(0,0,0,.18);
    backdrop-filter: blur(var(--glass-blur));
}

    .ve-card.pad {
        padding: 18px 12px 12px 12px;
    }

    .ve-card.tight {
        padding: 0px;
    }

.ve-scroll {
    overflow: auto;
    min-height: 0;
}

/* Filter */
.ve-filter {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

    .ve-filter .ve-title {
        font-size: 13px;
        color: var(--text-muted);
        letter-spacing: .2px;
    }

.ve-radio {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

    .ve-radio label {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        padding: 8px 10px;
        border-radius: 999px;
        border: 1px solid var(--border);
        background: color-mix(in srgb, var(--surface-1), transparent 35%);
        cursor: pointer;
        user-select: none;
        transition: transform .08s ease, border-color .15s ease, background .15s ease;
    }

        .ve-radio label:hover {
            transform: translateY(-1px);
            border-color: var(--border-strong);
            background: color-mix(in srgb, var(--surface-2), transparent 25%);
        }

    .ve-radio input[type="radio"] {
        accent-color: var(--main);
    }

/* Sidebar device list */
.ve-devlist {
    padding: 10px;
}

.ve-devitem {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 14px;
    border: 1px solid transparent;
    background: color-mix(in srgb, var(--surface), transparent 30%);
    margin-bottom: 8px;
    cursor: pointer;
    transition: transform .08s ease, border-color .15s ease, background .15s ease;
}

    .ve-devitem:hover {
        transform: translateY(-1px);
        border-color: var(--border);
        background: color-mix(in srgb, var(--surface-1), transparent 20%);
    }

.ve-devname {
    font-size: 14.5px;
    font-weight: 650;
    line-height: 1.2;
    color: var(--text);
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ve-badge {
    min-width: 28px;
    height: 22px;
    padding: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    border: 1px solid var(--border);
    background: var(--main-soft);
    color: var(--text);
}

    .ve-badge.zero {
        background: color-mix(in srgb, var(--surface-2), transparent 50%);
        color: var(--text-muted);
    }

/* Re-style your existing alert badge containers (you already use these classes) */
.alert-container,
.alert-container-right {
    position: relative;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: color-mix(in srgb, var(--surface-2), transparent 35%);
    border: 1px solid var(--border);
}

    .alert-container .icon,
    .alert-container-right .icon {
        font-size: 14px;
        opacity: .9;
    }

.alert-badge {
    position: absolute;
    top: -7px;
    right: -7px;
    min-width: 18px;
    height: 18px;
    padding: 0 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 900;
    background: color-mix(in srgb, #ff4d4d 88%, var(--main) 12%);
    color: white;
    border: 1px solid color-mix(in srgb, var(--border-strong), transparent 20%);
}

    /* Your code uses alert-badge@(x?"g":"") - support both .g and .alert-badgeg */
    .alert-badge.g,
    .alert-badgeg {
        background: color-mix(in srgb, var(--surface-3), transparent 35%);
        color: var(--text);
    }

/* Top counts partial layout */
#VETopCounts {
    padding: 5px;
    overflow: auto;
}

.VETop {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 6px;
    margin: 6px;
    border-radius: 16px;
    background: color-mix(in srgb, var(--surface-1), transparent 25%);
    border: 1px solid var(--border);
    transition: transform .08s ease, border-color .15s ease, background .15s ease;
}

    .VETop:hover {
        transform: translateY(-1px);
        border-color: var(--border-strong);
        background: color-mix(in srgb, var(--surface-2), transparent 18%);
    }

.VETop2 label {
    font-size: 12.5px;
    color: var(--text-muted);
}

.VETopIcon, .VETopIconADAS {
    font-size: 18px;
    color: var(--text-muted);
}

/* Event list column */
.ve-eventlist {
    height: 100%;
    overflow: auto;
    padding: 10px;
}

/* You already have .cameventmain - make it card-like */
.cameventmain {
    border: 1px solid var(--border) !important;
    border-radius: 16px !important;
    background: color-mix(in srgb, var(--surface), transparent 20%);
    box-shadow: 0 10px 25px rgba(0,0,0,.12);
    padding: 10px;
    margin-bottom: 10px !important;
    height: auto !important;
}

.ve-eventhead {
    display: grid;
    grid-template-columns: 34px 1fr;
    gap: 8px;
    align-items: start;
    margin-bottom: 8px;
}

.ve-eventmeta {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

    .ve-eventmeta .num {
        font-weight: 850;
        font-size: 13.5px;
        color: var(--text);
    }

    .ve-eventmeta .dt {
        font-size: 12px;
        color: var(--text-muted);
    }

.ve-thumb {
    width: 100%;
    display: flex;
    gap: 10px;
    align-items: center;
}

    .ve-thumb img {
        width: 100%;
        max-width: 190px;
        aspect-ratio: 1 / 1;
        object-fit: cover;
        border-radius: 14px;
        border: 1px solid var(--border);
    }

.ve-eventactions {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-top: 8px;
}

    .ve-eventactions .left-icons {
        display: inline-flex;
        gap: 10px;
        color: var(--text-muted);
    }

    .ve-eventactions .right-icons {
        margin-left: auto;
        display: inline-flex;
        gap: 12px;
    }

.ChangeVEState {
    cursor: pointer;
    opacity: .92;
    transition: transform .08s ease, opacity .15s ease, filter .15s ease;
}

    .ChangeVEState:hover {
        transform: translateY(-1px);
        opacity: 1;
        filter: drop-shadow(0 8px 18px rgba(0,0,0,.22));
    }

/* Event info panel (right side) */
.ve-info {
    height: 100%;
    min-height: 0;
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 12px;
    padding: 12px;
}

.ve-media-grid {
    display: grid;
    overflow-y: auto;
    grid-template-rows: 160px 1fr;
    gap: 12px;
    height: 100%;
    min-height: 0;
}

.ve-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
}

    .ve-images img {
        width: 100%;
        height: 160px;
        object-fit: cover;
        border-radius: 14px;
        border: 1px solid var(--border);
    }

.ve-request {
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 1px dashed var(--border-strong);
    background: color-mix(in srgb, var(--surface-1), transparent 35%);
    gap: 10px;
    cursor: pointer;
    min-height: 110px;
    flex-direction:column;
}

    .ve-request .Result {
        display: inline-block;
        padding: 6px 10px;
        border-radius: 999px;
        border: 1px solid var(--main-border);
        background: var(--main-soft);
        color: var(--text);
        font-size: 12px;
        font-weight: 800;
    }

.ve-videos {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 10px;
    min-height: 0;
}

    .ve-videos iframe {
        width: 100%;
        height: 100%;
        min-height: 180px;
        border-radius: 14px;
        border: 1px solid var(--border);
        background: color-mix(in srgb, var(--surface-2), transparent 40%);
    }

/* Header / Map / Info row */
.ve-details {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 12px;
    align-items: start;
}

#VEMapDiv {
    border-radius: 14px;
    border: 1px solid var(--border) !important;
    background: color-mix(in srgb, var(--surface-2), transparent 35%);
    overflow: hidden;
}

.ve-infobox {
    padding: 10px 12px;
}

    .ve-infobox .h {
        font-size: 20px;
        font-weight: 900;
        line-height: 1.1;
        margin-bottom: 6px;
    }

    .ve-infobox .line {
        font-size: 13.5px;
        color: var(--text-muted);
        margin-top: 4px;
    }

.textoverflow {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Comments */
#VECommentsMainSection {
    border-radius: 14px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface), transparent 22%);
    padding: 10px;
}

.ve-comment {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

    .ve-comment:last-child {
        border-bottom: none;
    }

    .ve-comment .who {
        font-size: 12.5px;
        font-weight: 750;
        color: var(--text);
    }

    .ve-comment .msg {
        margin-top: 6px;
        font-size: 13.5px;
        color: var(--text-muted);
        padding-left: 6px;
    }

/* Composer */
.ve-composer {
    display: flex;
    gap: 10px;
    padding-top: 10px;
}

#SelEvtComment {
    resize: none;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface-1), transparent 30%);
    color: var(--text);
    padding: 10px 12px;
    outline: none;
}

    #SelEvtComment:focus {
        box-shadow: 0 0 0 4px var(--focus-ring);
        border-color: var(--main-border);
    }

.SelEventAddComment {
    border: 1px solid var(--main-border);
    background: var(--main-gradient);
    color: var(--text-over-main);
    border-radius: 14px;
    padding: 0 16px;
    font-weight: 850;
    cursor: pointer;
    transition: transform .08s ease, filter .15s ease;
}

    .SelEventAddComment:hover {
        transform: translateY(-1px);
        filter: brightness(1.04);
    }

/* Responsive */
@media (max-width: 1100px) {
    .ve-topbar, .ve-main {
        grid-template-columns: 1fr;
    }

    .ve-info {
        grid-template-columns: 1fr;
    }

    .ve-details {
        grid-template-columns: 1fr;
    }
}


/* Safety: make sure nothing transparent blocks clicks */
.ve-card, .ve-shell, .ve-main, .ve-topbar {
    position: relative;
}

    .ve-card * {
        pointer-events: auto;
    }

/* Click affordance */
.VEDevList, .camevent, .cameventmain, .SelEventReqVideo, .ChangeVEState {
    cursor: pointer;
}

/* If you later add decorative layers, make them ignore clicks */
.ve-decor, .ve-bg-glow {
    pointer-events: none !important;
}

/* =========================================
   FIX: lock page to viewport + panel scrolls
   ========================================= */

/* If you can, apply .ve-events-page to the BODY on this page only.
   If not, use the #VEPageRoot wrapper (see cshtml below). */

/* A) Stop the BODY from scrolling on this page */
body.ve-events-page {
    height: 100dvh;
    overflow: hidden;
}

/* B) Root wrapper fills screen and prevents page scroll */
#VEPageRoot {
    height: calc(100dvh - 142px); /* use dynamic viewport height */
    min-height: 0;
    overflow: hidden; /* critical: prevents whole page scrolling */
    display: flex;
    flex-direction: column;
}

    /* C) Your shell must be a flex column with a “flex:1” content area */
    #VEPageRoot .ve-shell {
        height: 100%;
        min-height: 0;
        display: flex;
        flex-direction: column;
    }

    /* D) Top bar stays natural height; main takes the rest */
    #VEPageRoot .ve-topbar {
        flex: 0 0 auto;
        min-height: 72px;
    }

    #VEPageRoot .ve-main {
        flex: 1 1 auto; /* take remaining height */
        min-height: 0; /* CRITICAL so children can scroll */
    }

    /* E) Main content must not overflow the page */
    #VEPageRoot .VEMainContent,
    #VEPageRoot .ve-content {
        min-height: 0;
        overflow: hidden; /* prevent content from forcing page height */
    }

    /* F) Ensure the VEEventList split view fills the panel */
    #VEPageRoot .ve-split {
        height: 100%;
        min-height: 0;
        display: flex;
        gap: 10px;
    }

        /* Left list fixed width, SCROLLS */
        #VEPageRoot .ve-split .ve-left {
            width: 300px;
            flex: 0 0 300px;
            min-height: 0;
            overflow: auto; /* <-- list scrolls */
        }

        /* Right details fills remaining, does NOT force page scroll */
        #VEPageRoot .ve-split .ve-right {
            flex: 1 1 auto;
            min-width: 0;
            min-height: 0;
            overflow: hidden;
        }

    /* If you want comments area to scroll (recommended) */
    #VEPageRoot #VECommentsMainSection {
        min-height: 0;
        overflow: auto;
    }

    /* Make sure no random wrapper causes body scroll */
    #VEPageRoot .ve-card {
        min-height: 0;
    }
.ve.videoaction {
 width:auto !important;
    /* width: 100px; */
}