/* summary.css - Ultra Premium Dark Aurora Theme */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Noto+Sans+TC:wght@300;400;500;700;900&display=swap');

:root {
  --aurora-1: #4f46e5;
  --aurora-2: #db2777;
  --aurora-3: #06b6d4;
  --bg-dark: #0f172a;
  --card-bg: rgba(30, 41, 59, 0.4);
  --card-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-accent: #38bdf8;
  --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-dark);
  color: var(--text-primary);
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  overflow-x: hidden;
  position: relative;
}

/* Aurora Backdrop (Glowing Orbs) */
body::before, body::after {
  content: '';
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.5;
  animation: float 20s infinite alternate cubic-bezier(0.4, 0, 0.2, 1);
}

body::before {
  top: -10%;
  left: -10%;
  background: var(--aurora-1);
}

body::after {
  bottom: -10%;
  right: -10%;
  background: var(--aurora-2);
  animation-delay: -10s;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(100px, 50px) scale(1.1); }
  66% { transform: translate(-50px, 150px) scale(0.9); }
  100% { transform: translate(50px, -50px) scale(1.2); }
}

/* Premium Header */
.summary-header {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.back-link {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  transition: all 0.3s ease;
  border: 1px solid transparent;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: var(--card-border);
}

.header-content h1 {
  font-size: 1.8rem;
  margin: 0;
  font-weight: 800;
  background: linear-gradient(to right, #60a5fa, #c084fc);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: -0.5px;
}

/* Main Container */
.summary-main {
  max-width: 800px;
  margin: 3rem auto 6rem;
  padding: 0 1.5rem;
}

/* Controls Section - Glassmorphism */
.controls-section {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
  padding: 2.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  box-shadow: var(--glass-shadow);
  margin-bottom: 4rem;
  animation: slideDown 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes slideDown {
  0% { transform: translateY(-40px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

.control-group {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  flex: 1;
  min-width: 220px;
}

.control-group label {
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.9rem;
  letter-spacing: 1px;
}

.control-group select {
  padding: 1rem 1.2rem;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.6);
  color: var(--text-primary);
  font-size: 1.1rem;
  font-family: 'Outfit', sans-serif;
  outline: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
}

.control-group select:hover {
  background: rgba(30, 41, 59, 0.8);
  border-color: rgba(255,255,255,0.2);
}

.control-group select:focus {
  border-color: var(--text-accent);
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.2);
}

/* Dropdown options styling for Windows/Chrome */
.control-group select option {
  background: var(--bg-dark);
  color: var(--text-primary);
}

#generateBtn {
  padding: 1rem 2rem;
  border-radius: 14px;
  font-size: 1.1rem;
  font-family: 'Outfit', 'Noto Sans TC', sans-serif;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(135deg, #3b82f6, #8b5cf6);
  color: white;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 10px 25px rgba(139, 92, 246, 0.4);
  letter-spacing: 0.5px;
}

#generateBtn:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 15px 35px rgba(139, 92, 246, 0.6);
  filter: brightness(1.1);
}

#generateBtn:active {
  transform: translateY(1px);
}

#generateBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
  filter: grayscale(0.5);
}

#shareLineBtn:hover,
#downloadPdfBtn:hover {
  transform: translateY(-3px) scale(1.02);
  filter: brightness(1.15);
}

#shareLineBtn:active,
#downloadPdfBtn:active {
  transform: translateY(1px);
}

/* Section Title */
.report-section h2 {
  font-size: 2.4rem;
  font-weight: 900;
  color: #fff;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  letter-spacing: -0.5px;
  text-shadow: 0 2px 10px rgba(0,0,0,0.5);
}

/* Timeline Container */
.timeline {
  position: relative;
  margin: 3rem 0;
  padding-left: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 8px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, transparent, var(--text-accent), #c084fc, transparent);
  border-radius: 2px;
  opacity: 0.6;
}

/* Timeline Items with Animation */
.timeline-item {
  position: relative;
  margin-bottom: 3.5rem;
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 24px;
  padding: 2.5rem;
  box-shadow: var(--glass-shadow);
  transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
  animation: fadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(50px) scale(0.95); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.timeline-item:hover {
  transform: translateY(-8px);
  border-color: rgba(255,255,255,0.2);
  background: rgba(30, 41, 59, 0.55);
}

/* Glowing Neon Dot */
.timeline-item::before {
  content: '';
  position: absolute;
  left: -3rem;
  top: 3rem;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-dark);
  border: 3px solid var(--text-accent);
  transform: translateX(-50%);
  box-shadow: 0 0 15px var(--text-accent), inset 0 0 5px var(--text-accent);
  transition: all 0.4s;
}

.timeline-item:hover::before {
  background: var(--text-accent);
  box-shadow: 0 0 25px var(--text-accent);
  transform: translateX(-50%) scale(1.3);
}

/* Date Bubble */
.tl-date {
  display: inline-block;
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  border: 1px solid rgba(56, 189, 248, 0.3);
  font-family: 'Outfit', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
  letter-spacing: 2px;
}

/* Description Text */
.tl-desc {
  font-size: 1.2rem;
  line-height: 1.8;
  color: var(--text-primary);
  margin-bottom: 2rem;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Photos */
.tl-photo {
  max-width: 100%;
  width: 100%;
  border-radius: 16px;
  max-height: 500px;
  object-fit: contain;
  background: rgba(0,0,0,0.4);
  display: block;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
  border: 1px solid rgba(255,255,255,0.1);
}

.tl-photo:hover {
  transform: scale(1.04);
}

/* Loading */
#loadingIndicator {
  text-align: center;
  padding: 6rem 0;
}

.spinner-large {
  width: 70px;
  height: 70px;
  border: 4px solid rgba(255, 255, 255, 0.1);
  border-top-color: var(--text-accent);
  border-radius: 50%;
  animation: spin 1s cubic-bezier(0.55, 0.15, 0.45, 0.85) infinite;
  margin: 0 auto 2rem;
  box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
}

#loadingIndicator p {
  color: var(--text-primary);
  font-weight: 500;
  font-size: 1.3rem;
  letter-spacing: 1px;
  animation: pulse 1.5s infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.hidden {
  display: none !important;
}

/* 解決 PDF 匯出時的渲染問題 (移除毛玻璃以免 html2canvas 變灰塊) */
html.pdf-export-mode,
body.pdf-export-mode {
  overflow: visible !important;
  height: auto !important;
  min-height: auto !important;
  background-attachment: scroll !important; /* Fixed background breaks html2canvas multipage */
}

body.pdf-export-mode::before,
body.pdf-export-mode::after {
  display: none !important; /* Completely hide fixed glowing orbs during multi-page export */
}

body.pdf-export-mode .summary-header {
  display: none !important; /* Hide header completely from print layout context to avoid breaks */
}

.pdf-export-mode * {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  animation: none !important; /* Animations leave transforms that confuse html2canvas offsets */
  transition: none !important;
  transform: none !important;
}


