/* ACO - Access CCTV Online: Floating Widget Styles */

#aco-widget {
    position: fixed;
    z-index: 99998;
    width: 96px;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
#aco-widget.aco-pos-top-right    { top: 18px;    right: 18px;  }
#aco-widget.aco-pos-top-left     { top: 18px;    left: 18px;   }
#aco-widget.aco-pos-bottom-right { bottom: 18px; right: 18px;  }
#aco-widget.aco-pos-bottom-left  { bottom: 18px; left: 18px;   }

#aco-widget:hover  { transform: translateY(-2px) scale(1.04); }
#aco-widget:active { transform: translateY(0)    scale(0.98); }

.aco-card {
    background: transparent;
    border: none;
    border-radius: 14px;
    padding: 10px 8px 8px;
    box-shadow: none;
    text-align: center;
    position: relative;
    overflow: hidden;
}
.aco-card::before {
    content: none;
}

.aco-cam {
    width: 72px;
    height: 72px;
    display: block;
    margin: 0 auto;
    position: relative;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.35));
}

.aco-cam-head {
    transform-box: fill-box;
    transform-origin: 50% 35%;
    animation: aco-pan 4.8s cubic-bezier(.45,.05,.55,.95) infinite;
}

.aco-cone {
    opacity: 0.7;
    animation: aco-cone 4.8s cubic-bezier(.45,.05,.55,.95) infinite;
}

.aco-led {
    animation: aco-led 1.4s ease-in-out infinite;
}

@keyframes aco-pan {
    0%, 100% { transform: rotate(-22deg); }
    50%      { transform: rotate( 22deg); }
}
@keyframes aco-cone {
    0%, 100% { opacity: 0.45; }
    50%      { opacity: 0.85; }
}
@keyframes aco-led {
    0%, 55%, 100% { opacity: 1; filter: drop-shadow(0 0 4px #ef4444); }
    65%, 90%      { opacity: 0.2; filter: none; }
}

.aco-label {
    margin-top: 6px;
    color: inherit;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 2.5px;
    line-height: 1;
    position: relative;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.aco-sublabel {
    margin-top: 3px;
    color: inherit;
    opacity: 0.7;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.6px;
    line-height: 1;
    position: relative;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

.aco-tooltip {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #0f172a;
    color: #f1f5f9;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
    box-shadow: 0 6px 14px rgba(0,0,0,0.25);
    border: 1px solid rgba(148,163,184,0.2);
}
.aco-pos-top-right .aco-tooltip,
.aco-pos-bottom-right .aco-tooltip {
    right: calc(100% + 10px);
}
.aco-pos-top-left .aco-tooltip,
.aco-pos-bottom-left .aco-tooltip {
    left: calc(100% + 10px);
}
#aco-widget:hover .aco-tooltip,
#aco-widget:focus .aco-tooltip {
    opacity: 1;
}

/* Modal */
.aco-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
}
.aco-modal.aco-hidden {
    display: none;
}
.aco-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: aco-fade 0.2s ease-out;
}
.aco-modal-card {
    position: relative;
    width: min(1100px, 94vw);
    height: min(720px, 88vh);
    margin: 5vh auto 0;
    background: #0b1220;
    border: 1px solid rgba(148,163,184,0.22);
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.55);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: aco-pop 0.25s cubic-bezier(.2,.7,.2,1);
}
.aco-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: linear-gradient(180deg, #111c34 0%, #0b1220 100%);
    color: #f1f5f9;
    border-bottom: 1px solid rgba(148,163,184,0.18);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.aco-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    letter-spacing: 0.3px;
}
.aco-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 0 4px rgba(239,68,68,0.18);
    animation: aco-led 1.4s ease-in-out infinite;
}
.aco-modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}
.aco-btn-ghost {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 12px;
    padding: 6px 10px;
    border-radius: 8px;
    border: 1px solid rgba(148,163,184,0.22);
    transition: background .2s ease, color .2s ease;
}
.aco-btn-ghost:hover {
    background: rgba(148,163,184,0.12);
    color: #fff;
}
.aco-btn-close {
    background: transparent;
    border: 0;
    color: #f1f5f9;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 8px;
    transition: background .2s ease;
}
.aco-btn-close:hover {
    background: rgba(239, 68, 68, 0.18);
    color: #fecaca;
}
.aco-modal-body {
    flex: 1;
    background: #000;
}
#aco-modal-iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
    background: #000;
}

@keyframes aco-fade {
    from { opacity: 0; } to { opacity: 1; }
}
@keyframes aco-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0)   scale(1); }
}

@media (max-width: 600px) {
    #aco-widget { width: 84px; }
    .aco-cam { width: 60px; height: 60px; }
    .aco-label { font-size: 11px; letter-spacing: 2px; }
    .aco-sublabel { font-size: 8px; }
    .aco-modal-card { height: 92vh; margin: 4vh auto 0; }
}
