<template>
  <div class="video-monitor-page">
    <ScreenHeader />
    <div class="page-body">
      <div class="video-left">
        <BuildingNav/>
      </div>
      <div class="video-right">
        <div class="video-breadcrumb">{{ breadcrumb }}</div>
        <VideoGrid ref="videoComponent"/>
      </div>
    </div>
  </div>
</template>

<script>
import ScreenHeader from '@/components/Header.vue'
import BuildingNav from '@/components/VideoMonitor/BuildingNav.vue'
import VideoGrid from '@/components/VideoMonitor/VideoGrid.vue'

export default {
  name: 'VideoMonitor',
  components: { ScreenHeader, BuildingNav, VideoGrid },
  data() {
    return {
      breadcrumb: ''
    }
  },
  methods: {
    setVideoData(list){
      // console.log('setVideoData',list)
        this.$refs['videoComponent'].getVideoData(list)
    },
    setAddress(list){
      let text = '';
      for(let i=0;i<list.length;i++){
        if(i==0){
          text = text + list[i];
        }else{
          text = text + ' → ' + list[i];
        }
      }
      this.$set(this,'breadcrumb',text);
    },
  }
}
</script>

<style lang="scss" scoped>
.video-monitor-page {
  width: 1920px;
  height: 1080px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.page-body {
  flex: 1;
  display: flex;
  gap: 14px;
  padding: 14px;
  overflow: hidden;
}

.video-left {
  width: 300px;
  flex-shrink: 0;
  position: relative;

  &::after {
    content: '';
    position: absolute;
    left: 0;
    top: -100%;
    width: 1px;
    height: 60%;
    background: linear-gradient(180deg, transparent, rgba(72,215,255,0.7), rgba(72,215,255,0.9), rgba(72,215,255,0.7), transparent);
    animation: sidebarScan 5s linear infinite;
    pointer-events: none;
    z-index: 3;
  }

  &::before {
    content: '';
    position: absolute;
    left: 0;
    top: 10%;
    bottom: 10%;
    width: 2px;
    background: linear-gradient(180deg, transparent, $accent, transparent);
    opacity: 0.4;
    animation: sidebarEdgeGlow 3s ease-in-out infinite;
    z-index: 3;
    pointer-events: none;
  }
}

@keyframes sidebarScan {
  0% { top: -60%; }
  100% { top: 160%; }
}

@keyframes sidebarEdgeGlow {
  0%, 100% { opacity: 0.25; }
  50% { opacity: 0.7; box-shadow: 0 0 12px $accent; }
}

.video-right {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;

  &::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    pointer-events: none;
    z-index: 0;
    background-image:
      radial-gradient(1px 1px at 10% 20%, rgba(72,215,255,0.3) 50%, transparent 100%),
      radial-gradient(1px 1px at 75% 80%, rgba(72,215,255,0.3) 50%, transparent 100%),
      radial-gradient(1px 1px at 90% 40%, rgba(72,215,255,0.25) 50%, transparent 100%);
    animation: videoParticles 12s ease-in-out infinite alternate;
  }
}

@keyframes videoParticles {
  0% { opacity: 0.3; }
  50% { opacity: 0.7; }
  100% { opacity: 0.3; transform: translateY(-10px); }
}

.video-breadcrumb {
  font-size: 14px;
  color: $text-secondary;
  margin-bottom: 10px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(72,215,255,0.1);
  position: relative;
  z-index: 1;
  overflow: hidden;

  &::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: -80px;
    width: 80px;
    height: 1px;
    background: linear-gradient(90deg, transparent, $accent, transparent);
    animation: breadcrumbFlow 5s linear infinite;
    pointer-events: none;
  }
}

@keyframes breadcrumbFlow {
  0% { left: -80px; }
  100% { left: calc(100% + 80px); }
}
</style>
