/**
 * バナー表示用スタイル
 *
 * @package WP_Banner_Assist
 */

#wp-banner-assist {
  position: fixed;
  bottom: 20px;
  z-index: 9999;
}

#wp-banner-assist.right {
  right: 20px;
}

#wp-banner-assist.left {
  left: 20px;
}

#wp-banner-assist a {
  background-color: #fff;
}

#wp-banner-assist img {
  max-width: 240px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  display: block;
  width: 100%;
  height: auto;
  transition: opacity 0.3s ease;
}

#wp-banner-assist a:hover img,
#wp-banner-assist button:hover img {
  opacity: 0.7;
}

#wp-banner-assist .banner-close {
  position: absolute;
  top: -8px;
  right: -8px;
  z-index: 10;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* デフォルトアイコン（✕）の場合のスタイル */
#wp-banner-assist .banner-close:not(.has-image) {
  background: #fff;
  border-radius: 50%;
  padding: 4px;
  width: 24px;
  height: 24px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: background-color 0.2s ease;
}

#wp-banner-assist .banner-close:not(.has-image):hover {
  background: #f0f0f0;
}

/* 画像がある場合のスタイル（幅、高さ、シャドウ、角丸をリセット） */
#wp-banner-assist .banner-close.has-image {
  background: none;
  border-radius: 0;
  width: auto;
  height: auto;
  box-shadow: none;
}

#wp-banner-assist .banner-close img {
  max-width: none;
  border-radius: 0;
  box-shadow: none;
  display: block;
  width: auto;
  height: auto;
}

#wp-banner-assist .banner-close .close-icon {
  font-size: 16px;
  line-height: 1;
  color: #333;
  font-weight: bold;
}

#wp-banner-assist a {
  display: block;
  text-decoration: none;
}

/* 動画モーダル */
.wpba-video-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.wpba-video-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.wpba-video-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0);
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.wpba-video-modal.is-open .wpba-video-modal-overlay {
  background-color: rgba(0, 0, 0, 0.8);
}

.wpba-video-modal-content {
  position: relative;
  width: 90%;
  max-width: 960px;
  background-color: #000;
  border-radius: 8px;
  overflow: hidden;
  z-index: 10001;
  transform: scale(0.8) translateY(20px);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.wpba-video-modal.is-open .wpba-video-modal-content {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.wpba-video-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  background-color: rgba(0, 0, 0, 0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.2s ease;
}

.wpba-video-modal-close:hover {
  background-color: rgba(0, 0, 0, 0.8);
}

.wpba-video-container {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 アスペクト比 */
  height: 0;
  overflow: hidden;
}

.wpba-video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* モーダル表示時のbodyのスクロールを無効化 */
body.wpba-modal-open {
  overflow: hidden;
}

