/* ========================================
   SAMNET SHARED CAMERA VIEWER
======================================== */

.samnet-camera {
    width: 100%;

    color: #172b43;

    font-family: inherit;
}


.samnet-camera__frame {
    position: relative;

    width: 100%;

    aspect-ratio: 16 / 9;

    overflow: hidden;

    border-radius: 10px;

    background: #17232b;
}


.samnet-camera[data-expandable="true"]
.samnet-camera__frame {
    cursor: zoom-in;
}


.samnet-camera__frame:focus-visible {
    outline: 3px solid rgba(47, 143, 91, 0.7);

    outline-offset: 2px;
}


.samnet-camera__image {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
}


.samnet-camera--full
.samnet-camera__image {
    object-fit: contain;
}


.samnet-camera__loading {
    position: absolute;

    inset: 0;

    z-index: 1;

    display: flex;

    padding: 18px;

    align-items: center;
    justify-content: center;

    color:
        rgba(
            255,
            255,
            255,
            0.78
        );

    font-size: 0.72rem;
    font-weight: 800;

    text-align: center;
}


/* Explicit hidden-state rules */
.samnet-camera__loading[hidden],
.samnet-camera__image[hidden] {
    display: none !important;
}


.samnet-camera__banner {
    position: absolute;

    top: 0;
    right: 0;
    left: 0;

    z-index: 5;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        auto
        minmax(0, 1fr);

    min-height: 58px;

    padding:
        7px
        10px;

    align-items: center;

    color: #ffffff;

    background:
        rgba(5, 15, 24, 0.70);

    backdrop-filter:
        blur(4px);

    -webkit-backdrop-filter:
        blur(4px);

    pointer-events: none;
}


.samnet-camera__identity {
    min-width: 0;

    justify-self: start;

    text-align: left;

    line-height: 1.15;
}


.samnet-camera__identity strong {
    display: block;

    overflow: hidden;

    color: #ffffff;

    font-size: 0.76rem;
    font-weight: 900;

    letter-spacing: 0.01em;

    text-overflow: ellipsis;

    white-space: nowrap;

    text-shadow:
        0 1px 4px
        rgba(0, 0, 0, 0.72);
}


.samnet-camera__identity span {
    display: block;

    margin-top: 3px;

    color:
        rgba(
            255,
            255,
            255,
            0.88
        );

    font-size: 0.60rem;
    font-weight: 800;

    white-space: nowrap;

    text-shadow:
        0 1px 4px
        rgba(0, 0, 0, 0.72);
}


.samnet-camera__logo {
    justify-self: center;

    width: 62px;
    height: auto;

    max-height: 42px;

    object-fit: contain;

    filter:
        drop-shadow(
            0 2px 4px
            rgba(0, 0, 0, 0.45)
        );
}


.samnet-camera__right {
    min-width: 0;

    justify-self: end;

    display: flex;

    flex-direction: column;

    align-items: flex-end;

    gap: 5px;

    text-align: right;
}


.samnet-camera__time {
    color: #ffffff;

    font-size: 0.61rem;
    font-weight: 800;

    line-height: 1.15;

    white-space: nowrap;

    text-shadow:
        0 1px 4px
        rgba(0, 0, 0, 0.72);
}


.samnet-camera__status {
    display: inline-flex;

    min-height: 22px;

    padding:
        4px
        8px;

    align-items: center;
    justify-content: center;

    border-radius: 999px;

    color: #ffffff;

    background:
        rgba(
            47,
            143,
            91,
            0.94
        );

    font-size: 0.52rem;
    font-weight: 900;

    letter-spacing: 0.07em;

    text-transform: uppercase;
}


.samnet-camera__status[hidden] {
    display: none;
}


.samnet-camera__status.is-live {
    background:
        rgba(
            47,
            143,
            91,
            0.94
        );
}


.samnet-camera__status.is-delayed {
    background:
        rgba(
            215,
            155,
            54,
            0.95
        );
}


.samnet-camera__status.is-older {
    background:
        rgba(
            214,
            59,
            59,
            0.95
        );
}


.samnet-camera__status.is-timelapse {
    background:
        rgba(
            7,
            26,
            38,
            0.90
        );
}


.samnet-camera__status.is-unavailable {
    background:
        rgba(
            113,
            128,
            150,
            0.95
        );
}


.samnet-camera__expand-hint {
    position: absolute;

    right: 9px;
    bottom: 8px;

    z-index: 4;

    padding:
        4px
        7px;

    border-radius: 5px;

    color: #ffffff;

    background:
        rgba(
            7,
            26,
            38,
            0.72
        );

    font-size: 0.48rem;
    font-weight: 800;

    opacity: 0;

    pointer-events: none;

    transition:
        opacity
        150ms ease;
}


.samnet-camera__frame:hover
.samnet-camera__expand-hint,
.samnet-camera__frame:focus-visible
.samnet-camera__expand-hint {
    opacity: 1;
}


/* ========================================
   FULL VIEW CONTROLS
======================================== */

.samnet-camera__mode-row {
    display: flex;

    min-height: 48px;

    padding:
        8px
        10px;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    border:
        1px solid #dce4e7;

    border-top: 0;

    background: #ffffff;
}


.samnet-camera__mode-buttons {
    display: flex;

    gap: 7px;
}


.samnet-camera__mode-button,
.samnet-camera__play,
.samnet-camera__download {
    min-height: 34px;

    padding:
        0
        11px;

    border:
        1px solid #d6e0dc;

    border-radius: 7px;

    color: #52645a;

    background: #ffffff;

    font-family: inherit;
    font-size: 0.58rem;
    font-weight: 900;

    cursor: pointer;
}


.samnet-camera__mode-button.is-active {
    color: #ffffff;

    border-color: #2f8f5b;

    background: #2f8f5b;
}


.samnet-camera__frame-counter {
    color: #7d8c93;

    font-size: 0.57rem;
    font-weight: 800;
}


.samnet-camera__timelapse-controls {
    padding: 12px;

    border:
        1px solid #dce4e7;

    border-top: 0;

    background: #f7faf8;
}


.samnet-camera__preload {
    margin-bottom: 10px;

    padding: 10px;

    border:
        1px solid #dbe5df;

    border-radius: 8px;

    background: #ffffff;
}


.samnet-camera__preload-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 10px;

    color: #53665b;

    font-size: 0.56rem;
    font-weight: 900;
}


.samnet-camera__preload-track {
    height: 6px;

    margin-top: 7px;

    overflow: hidden;

    border-radius: 999px;

    background: #e4ebe7;
}


.samnet-camera__preload-bar {
    width: 0;
    height: 100%;

    background: #2f8f5b;
}


.samnet-camera__preload-count {
    display: block;

    margin-top: 6px;

    color: #87938d;

    font-size: 0.50rem;
    font-weight: 700;
}


.samnet-camera__toolbar {
    display: flex;

    flex-wrap: wrap;

    align-items: end;

    gap: 9px;
}


.samnet-camera__control {
    display: flex;

    flex-direction: column;

    gap: 4px;

    color: #75847c;

    font-size: 0.50rem;
    font-weight: 900;

    text-transform: uppercase;
}


.samnet-camera__control select {
    min-height: 34px;

    padding:
        0
        28px
        0
        9px;

    border:
        1px solid #d6e0dc;

    border-radius: 7px;

    color: #3e5548;

    background: #ffffff;

    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 800;
}


.samnet-camera__download:disabled {
    opacity: 0.48;

    cursor: default;
}


.samnet-camera__timeline-row {
    display: grid;

    margin-top: 11px;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;

    gap: 9px;

    color: #87938d;

    font-size: 0.50rem;
    font-weight: 800;
}


.samnet-camera__timeline {
    width: 100%;
}


.samnet-camera__details {
    padding:
        8px
        10px;

    border:
        1px solid #dce4e7;

    border-top: 0;

    color: #87938d;

    background: #ffffff;

    font-size: 0.53rem;
    font-weight: 700;
}


.samnet-camera__details strong {
    color: #53665b;

    font-weight: 900;
}


/* ========================================
   LIGHTBOX
======================================== */

.samnet-camera-lightbox {
    position: fixed;

    inset: 0;

    z-index: 10000;

    display: flex;

    padding: 24px;

    align-items: center;
    justify-content: center;

    background:
        rgba(
            3,
            10,
            15,
            0.94
        );
}


.samnet-camera-lightbox[hidden] {
    display: none;
}


.samnet-camera-lightbox__inner {
    position: relative;

    display: flex;

    width: min(
        96vw,
        1600px
    );

    max-height: 94vh;

    flex-direction: column;
}


.samnet-camera-lightbox__image {
    display: block;

    width: 100%;

    max-height:
        calc(
            94vh -
            52px
        );

    object-fit: contain;

    background: #071a26;
}


.samnet-camera-lightbox__caption {
    display: flex;

    min-height: 48px;

    padding:
        8px
        12px;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    color: #ffffff;

    background: #071a26;
}


.samnet-camera-lightbox__caption strong {
    font-size: 0.72rem;
}


.samnet-camera-lightbox__caption span {
    font-size: 0.62rem;
    font-weight: 700;
}


.samnet-camera-lightbox__close {
    position: fixed;

    top: 14px;
    right: 18px;

    z-index: 10001;

    width: 44px;
    height: 44px;

    border: 0;

    border-radius: 50%;

    color: #ffffff;

    background:
        rgba(
            255,
            255,
            255,
            0.14
        );

    font-size: 1.8rem;

    cursor: pointer;
}


body.samnet-camera-lightbox-open {
    overflow: hidden;
}


/* ========================================
   RESPONSIVE
======================================== */

@media (max-width: 600px) {

    .samnet-camera__banner {
        min-height: 52px;

        padding:
            6px
            7px;
    }


    .samnet-camera__identity strong {
        font-size: 0.61rem;
    }


    .samnet-camera__identity span {
        font-size: 0.49rem;
    }


    .samnet-camera__logo {
        width: 52px;

        max-height: 36px;
    }


    .samnet-camera__time {
        font-size: 0.49rem;
    }


    .samnet-camera__status {
        min-height: 20px;

        padding:
            3px
            6px;

        font-size: 0.44rem;
    }


    .samnet-camera__toolbar {
        align-items: stretch;
    }


    .samnet-camera__control {
        flex: 1 1 120px;
    }


    .samnet-camera__control select,
    .samnet-camera__play,
    .samnet-camera__download {
        min-height: 44px;
    }


    .samnet-camera-lightbox {
        padding: 9px;
    }

}
