@charset "utf-8";
/* ========================================
   Image Analysis Demo Styles
   Created: 2026-02-10
   ======================================== */

/* ========================================
   Demo Container
   ======================================== */
.image-analysis-demo {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 2px solid #004EB3;
  border-radius: 30px;
  padding: 60px 40px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.image-analysis-demo:hover {
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.15);
  transform: translateY(-5px);
}

/* ========================================
   Upload & Result Areas
   ======================================== */
.image-upload-area,
.image-result-area {
  position: relative;
  width: 100%;
  height: 400px;
  background: #f5f5f5;
  border: 3px dashed #999;
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  overflow: hidden;
}

.image-upload-area {
  cursor: pointer;
}

.image-upload-area:hover {
  border-color: #004EB3;
  background: #f0f5ff;
  transform: scale(1.02);
}

.image-upload-area.drag-over {
  border-color: #E71F19;
  background: #fff5f5;
  border-width: 4px;
}

.upload-label {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  margin: 0;
}

.upload-icon {
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.result-placeholder {
  text-align: center;
  padding: 40px;
}

/* Canvas Display */
#uploadCanvas,
#resultCanvas {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: 15px;
}

#uploadCanvas.active,
#resultCanvas.active {
  display: block !important;
}

/* ========================================
   Arrow Animation
   ======================================== */
.arrow-container {
  animation: arrowPulse 2s ease-in-out infinite;
}

@keyframes arrowPulse {
  0%, 100% {
    transform: translateX(0);
    opacity: 1;
  }
  50% {
    transform: translateX(10px);
    opacity: 0.7;
  }
}

/* Mobile Arrow Direction */
@media (max-width: 991px) {
  .arrow-container i {
    transform: rotate(90deg);
    font-size: 40px !important;
  }
}

/* ========================================
   Demo Buttons
   ======================================== */
.demo-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 40px;
  font-size: 18px;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  min-width: 200px;
}

.demo-btn i {
  margin-right: 8px;
  font-size: 20px;
}

.demo-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

.demo-btn:active {
  transform: translateY(-1px);
}

.demo-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Reset Button (Yellow) */
.demo-btn-reset {
  background: linear-gradient(135deg, #FDB913, #F4A016);
  color: #333;
}

.demo-btn-reset:hover {
  background: linear-gradient(135deg, #F4A016, #E89805);
}

/* Download Button (Blue) */
.demo-btn-download {
  background: linear-gradient(135deg, #004EB3, #0066E0);
  color: #fff;
}

.demo-btn-download:hover {
  background: linear-gradient(135deg, #003A85, #004EB3);
}

/* ========================================
   Status Message
   ======================================== */
.status-message {
  text-align: center;
  padding: 15px 30px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: 600;
  opacity: 0;
  transform: translateY(-10px);
  transition: all 0.3s ease;
}

.status-message.show {
  opacity: 1;
  transform: translateY(0);
}

.status-message.success {
  background: rgba(16, 185, 129, 0.1);
  border: 2px solid #10b981;
  color: #059669;
}

.status-message.error {
  background: rgba(231, 31, 25, 0.1);
  border: 2px solid #E71F19;
  color: #C41E1A;
}

.status-message.processing {
  background: rgba(0, 78, 179, 0.1);
  border: 2px solid #004EB3;
  color: #003A85;
}

/* Processing Animation */
.status-message.processing::after {
  content: '';
  display: inline-block;
  width: 20px;
  height: 20px;
  margin-left: 10px;
  border: 3px solid #004EB3;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  vertical-align: middle;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================================
   Processing Overlay
   ======================================== */
.processing-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 78, 179, 0.9);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  z-index: 10;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.processing-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.processing-overlay .spinner {
  width: 60px;
  height: 60px;
  border: 6px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.processing-overlay p {
  color: #fff;
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 991px) {
  .image-analysis-demo {
    padding: 40px 20px;
  }
  
  .image-upload-area,
  .image-result-area {
    height: 300px;
  }
  
  .demo-main-title {
    font-size: 22px !important;
  }
  
  .demo-title {
    font-size: 24px !important;
  }
  
  .demo-subtitle {
    font-size: 18px !important;
  }
  
  .demo-description {
    font-size: 16px !important;
  }
  
  .demo-btn {
    padding: 14px 30px;
    font-size: 16px;
    min-width: 160px;
    margin: 10px 5px !important;
  }
}

@media (max-width: 576px) {
  .image-upload-area,
  .image-result-area {
    height: 250px;
  }
  
  .demo-main-title {
    font-size: 18px !important;
  }
  
  .demo-title {
    font-size: 20px !important;
  }
  
  .demo-btn {
    width: 100%;
    margin: 10px 0 !important;
  }
}

/* ========================================
   Animation Classes
   ======================================== */
.fade-in {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.slide-in-left {
  animation: slideInLeft 0.5s ease;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.slide-in-right {
  animation: slideInRight 0.5s ease;
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ========================================
   Glass Effect Enhancement
   ======================================== */
.image-upload-area.has-image,
.image-result-area.has-result {
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid #004EB3;
  border-style: solid;
}

/* 画像入力時は「画像アップロード」等のプレースホルダーを非表示 */
.image-upload-area.has-image label.upload-label {
  display: none !important;
}

/* ========================================
   Accessibility
   ======================================== */
.demo-btn:focus,
.upload-label:focus {
  outline: 3px solid #004EB3;
  outline-offset: 3px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
  .image-upload-area,
  .image-result-area {
    border-width: 4px;
  }
  
  .demo-btn {
    border: 2px solid currentColor;
  }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
  .upload-icon,
  .arrow-container,
  .processing-overlay .spinner {
    animation: none;
  }
  
  .demo-btn,
  .image-upload-area,
  .status-message {
    transition: none;
  }
}
