/* 광고 팝업 스타일 (Pop-up Window 형식) */
.ad-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: 10000;
  display: none;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  overflow: visible;
}

.ad-popup.show {
  display: block;
  opacity: 1;
}

.ad-popup-overlay {
  display: none; /* 오버레이 제거 - 독립적인 윈도우로 작동 */
}

/* Pop-up Window 컨테이너 - 동행복권 스타일 */
.ad-popup-window {
  position: fixed !important;
  background: #ffffff;
  border: 2px solid #333333;
  border-radius: 4px;
  max-width: 500px;
  width: 450px;
  max-height: 600px;
  min-width: 400px;
  min-height: 300px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
  animation: popupSlideIn 0.3s ease-out;
  z-index: 10001;
  cursor: default;
  user-select: none;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Malgun Gothic", sans-serif;
  pointer-events: auto;
  /* 화면 경계를 넘어서도 보이도록 */
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

/* 창 제목바 (Title Bar) - 동행복권 스타일 */
.ad-popup-titlebar {
  background: #f5f5f5;
  border-bottom: 1px solid #d0d0d0;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
  cursor: move !important;
  user-select: none;
  position: relative;
}

.ad-popup-titlebar-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ad-popup-icon {
  width: 16px;
  height: 16px;
  background: #667eea;
  color: white;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  flex-shrink: 0;
}

.ad-popup-titlebar-title {
  font-size: 11px;
  color: #2c3e50;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: move;
}

.ad-popup-titlebar-controls {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.ad-popup-btn-control {
  width: 28px;
  height: 28px;
  border: 1px solid #ccc;
  background: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: #333333;
  padding: 0;
  margin: 0;
  transition: all 0.2s ease;
  line-height: 1;
  border-radius: 3px;
}

.ad-popup-btn-control:hover {
  background: #e8e8e8;
}

.ad-popup-btn-control:active {
  background: #d0d0d0;
}

.ad-popup-btn-close:hover {
  background: #ff4444;
  color: white;
  border-color: #cc0000;
}

.ad-popup-btn-minimize span {
  font-size: 16px;
  line-height: 1;
  margin-bottom: 4px;
}

.ad-popup-btn-maximize span {
  font-size: 10px;
  line-height: 1;
}

.ad-popup-btn-close span {
  font-size: 14px;
  line-height: 1;
}

/* 창 메뉴바 - 동행복권 스타일에서는 제거 */
.ad-popup-menubar {
  display: none !important; /* 동행복권 스타일에 맞춰 메뉴바 완전히 숨김 */
}

.ad-popup-menu-item {
  padding: 2px 8px;
  color: #2c3e50;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.1s ease;
}

.ad-popup-menu-item:hover {
  background: rgba(0, 0, 0, 0.1);
}

/* 창 내용 영역 */
.ad-popup-content-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: white;
}

.ad-popup-content {
  position: relative;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
}

@keyframes popupSlideIn {
  from {
    transform: scale(0.95) translateY(-10px);
    opacity: 0;
  }
  to {
    transform: scale(1) translateY(0);
    opacity: 1;
  }
}

/* 창 본문 */
.ad-popup-body {
  padding: 2rem;
  text-align: center;
  cursor: default;
  min-height: 200px;
}

/* 회사 헤더 */
.ad-popup-company-header {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid #e9ecef;
}

.ad-popup-company-logo {
  width: 60px;
  height: 60px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto 1rem;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.ad-popup-company-name {
  font-size: 1.5rem;
  font-weight: 700;
  color: #2c3e50;
  margin: 0.5rem 0;
}

.ad-popup-company-tagline {
  font-size: 0.9rem;
  color: #6c757d;
  margin: 0.25rem 0;
  font-weight: 500;
}

/* 서비스 목록 */
.ad-popup-services {
  margin: 1.5rem 0;
  text-align: left;
}

.ad-popup-services-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.75rem;
  text-align: center;
}

.ad-popup-services-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
}

.ad-popup-service-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: #f0f4ff;
  color: #667eea;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid #e0e7ff;
  transition: all 0.2s ease;
}

.ad-popup-service-badge:hover {
  background: #e0e7ff;
  transform: translateY(-2px);
}

/* 연락처 정보 */
.ad-popup-contact {
  margin: 1.5rem 0;
  padding: 1rem;
  background: #f8f9fa;
  border-radius: 8px;
  text-align: center;
}

.ad-popup-contact-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin: 0.5rem 0;
  font-size: 0.95rem;
  color: #495057;
}

.ad-popup-contact-icon {
  font-size: 1.2rem;
}

.ad-popup-contact-text {
  font-weight: 500;
  color: #2c3e50;
}

/* 상태바 (Status Bar) - 동행복권 스타일 */
.ad-popup-statusbar {
  background: #f9f9f9;
  border-top: 1px solid #e0e0e0;
  height: 40px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.ad-popup-window.dragging {
  cursor: grabbing !important;
  user-select: none;
}

.ad-popup-window.dragging * {
  cursor: grabbing !important;
  pointer-events: none;
}

.ad-popup-window.maximized {
  width: 100vw !important;
  height: 100vh !important;
  max-width: 100vw !important;
  max-height: 100vh !important;
  top: 0 !important;
  left: 0 !important;
  transform: none !important;
  border-radius: 0;
}

.ad-popup-window.minimized {
  display: none;
}

.ad-popup-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 12px;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.ad-popup-description {
  font-size: 0.95rem;
  color: #495057;
  line-height: 1.7;
  margin: 1.5rem 0;
  text-align: left;
  background: #f8f9fa;
  padding: 1rem;
  border-radius: 8px;
  border-left: 4px solid #667eea;
}

.ad-popup-button {
  display: inline-block;
  padding: 0.875rem 2.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ad-popup-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}


.ad-popup-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: #6c757d;
  cursor: pointer;
  user-select: none;
}

.ad-popup-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #667eea;
}

.ad-popup-checkbox span {
  cursor: pointer;
}

/* 반응형 디자인 */
@media (max-width: 768px) {
  .ad-popup-window {
    max-width: 95%;
    width: 95%;
    min-width: 300px;
  }

  .ad-popup-body {
    padding: 1.5rem 1rem;
  }

  .ad-popup-company-logo {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }

  .ad-popup-company-name {
    font-size: 1.25rem;
  }

  .ad-popup-services-list {
    gap: 0.4rem;
  }

  .ad-popup-service-badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.8rem;
  }

  .ad-popup-image {
    max-height: 200px;
    margin-bottom: 1rem;
  }

  .ad-popup-description {
    font-size: 0.85rem;
    padding: 0.75rem;
  }

  .ad-popup-button {
    padding: 0.75rem 2rem;
    font-size: 0.95rem;
    width: 100%;
    max-width: 300px;
  }

}

@media (max-width: 480px) {
  .ad-popup-window {
    min-width: 280px;
    max-height: 90vh;
  }

  .ad-popup-body {
    padding: 1rem;
  }

  .ad-popup-menubar {
    display: none;
  }

  .ad-popup-company-logo {
    width: 45px;
    height: 45px;
    font-size: 1.1rem;
  }

  .ad-popup-company-name {
    font-size: 1.1rem;
  }

  .ad-popup-services-list {
    gap: 0.3rem;
  }

  .ad-popup-service-badge {
    font-size: 0.75rem;
    padding: 0.35rem 0.7rem;
  }

  .ad-popup-image {
    max-height: 150px;
  }

  .ad-popup-description {
    font-size: 0.8rem;
    padding: 0.7rem;
  }

  .ad-popup-contact {
    padding: 0.75rem;
  }

  .ad-popup-contact-item {
    font-size: 0.85rem;
  }

  .ad-popup-button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

