<template>
  <div class="popup-layout">
    <div class="popup-layout__header">
      <a
        class="popup-layout__brand"
        href="javascript:void(0)"
        @click="openHome"
      >
        <img
          :src="logo"
          class="popup-layout__logo"
          alt="logo"
        >
      </a>

      <div class="popup-layout__header-right">
        <span class="popup-layout__version">{{ configApp.verText }}</span>
      </div>
    </div>

    <div class="popup-layout__content">
      <notify-app from="popup" />
      <slot />
    </div>
  </div>
</template>

<script>
import { configApp, configLayout } from '@/config/app';

export default {
  name: 'LayoutPopup',
  data() {
    return {
      logo: configApp.logoWhite,
      layout: configLayout,
    };
  },
  methods: {
    openHome() {
      this.openExternalUrl(configApp.homePage);
    },
  },
};
</script>

<style scoped>
.popup-layout {
  display: flex;
  flex-direction: column;
  width: 800px;
  height: 560px;
  background: #f5f6f8;
  overflow: hidden;
}

.popup-layout__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 44px;
  background: linear-gradient(135deg, #1d2124 0%, #2c3136 100%);
  flex-shrink: 0;
}

.popup-layout__brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.popup-layout__brand:hover {
  opacity: 0.85;
}

.popup-layout__logo {
  height: 28px;
  object-fit: contain;
}

.popup-layout__header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.popup-layout__version {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

.popup-layout__content {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  overflow-x: hidden;
}

.popup-layout__content::-webkit-scrollbar {
  width: 4px;
}

.popup-layout__content::-webkit-scrollbar-track {
  background: transparent;
}

.popup-layout__content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 4px;
}

.popup-layout__content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
}
</style>

<style>
.ivu-select-dropdown {
  max-height: 300px;
}
</style>
