/* ============================================
   Crop AI Advertisement Popup
   Created: 2025-10-13
   Purpose: AI作物調査中の広告ポップアップ
   ============================================ */

/* ============================================
   Popup Overlay
   ============================================ */

.ad-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease-in-out;
}

.ad-popup-overlay.show {
  display: flex;
  opacity: 1;
  pointer-events: auto;
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============================================
   Popup Container
   ============================================ */

.ad-popup-container {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 800px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
  from {
    transform: translateY(-50px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* ============================================
   Processing Status
   ============================================ */

.ad-popup-status {
  text-align: center;
  margin-bottom: var(--space-6);
}

.ad-popup-status-title {
  font-size: var(--font-size-2xl);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
}

.ad-popup-status-message {
  font-size: var(--font-size-base);
  color: var(--color-gray-600);
  margin-bottom: var(--space-4);
}

/* ============================================
   Spinner
   ============================================ */

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

.ad-popup-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--color-gray-200);
  border-top: 4px solid var(--color-info);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto var(--space-4);
}

/* ============================================
   Advertisement Area
   ============================================ */

.ad-popup-content {
  background: var(--gradient-warning);
  border-radius: var(--radius-md);
  padding: var(--space-5);
}

.ad-popup-label {
  text-align: center;
  color: var(--color-warning-dark);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: var(--space-4);
}

.ad-popup-placeholder {
  background: var(--color-white);
  border-radius: var(--radius-md);
  padding: var(--space-6);
  min-height: 300px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
}

.ad-popup-ad-content {
  text-align: center;
  color: var(--color-gray-500);
}

.ad-popup-ad-title {
  font-size: var(--font-size-2xl);
  margin-bottom: var(--space-2);
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
}

.ad-popup-ad-dimensions {
  font-size: var(--font-size-base);
  color: var(--color-gray-400);
  margin-bottom: var(--space-4);
}

.ad-popup-ad-description {
  margin-top: var(--space-4);
  font-size: var(--font-size-sm);
  line-height: var(--line-height-normal);
  color: var(--color-gray-500);
}

/* ============================================
   Progress Info
   ============================================ */

.ad-popup-progress {
  margin-top: var(--space-5);
  text-align: center;
}

.ad-popup-progress-text {
  font-size: var(--font-size-sm);
  color: var(--color-gray-600);
  margin-bottom: var(--space-3);
}

.ad-popup-progress-bar {
  width: 100%;
  height: 8px;
  background: var(--color-gray-200);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.ad-popup-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-info) 0%, var(--color-success) 100%);
  border-radius: var(--radius-full);
  transition: width 0.3s ease-in-out;
  animation: progress 2s ease-in-out infinite;
}

@keyframes progress {
  0%, 100% {
    width: 20%;
  }
  50% {
    width: 80%;
  }
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
  .ad-popup-container {
    padding: var(--space-4);
    width: 95%;
  }

  .ad-popup-status-title {
    font-size: var(--font-size-xl);
  }

  .ad-popup-placeholder {
    padding: var(--space-4);
    min-height: 200px;
  }

  .ad-popup-ad-title {
    font-size: var(--font-size-xl);
  }
}

@media (max-width: 480px) {
  .ad-popup-container {
    padding: var(--space-3);
  }

  .ad-popup-status-title {
    font-size: var(--font-size-lg);
    flex-direction: column;
  }

  .ad-popup-placeholder {
    min-height: 150px;
  }

  .ad-popup-ad-title {
    font-size: var(--font-size-lg);
  }
}

