/* 組件樣式 */

/* 通用英雄區塊 (避免與首頁賽博龐克樣式衝突) */
.generic-hero-section {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(
    135deg,
    var(--bg-primary) 0%,
    var(--bg-secondary) 100%
  );
  position: relative;
  overflow: hidden;
}

.generic-hero-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("/assets/images/background.png") center/cover;
  opacity: 0.1;
  z-index: -1;
}

.generic-hero-content {
  text-align: center;
  max-width: 800px;
  padding: var(--spacing-2xl);
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.8s ease;
}

.generic-hero-content.animated {
  opacity: 1;
  transform: translateY(0);
}

.generic-hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: var(--spacing-lg);
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--secondary-color)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.generic-hero-content p {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-2xl);
  color: var(--text-secondary);
}

.generic-hero-buttons {
  display: flex;
  gap: var(--spacing-lg);
  justify-content: center;
  flex-wrap: wrap;
}

/* 功能特色區塊 */
.features-section {
  padding: var(--spacing-2xl) 0;
  background: var(--bg-secondary);
}

.features-section h2 {
  text-align: center;
  margin-bottom: var(--spacing-2xl);
  font-size: 2.5rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--spacing-2xl);
}

.feature-card {
  background: var(--bg-card);
  padding: var(--spacing-2xl);
  border-radius: var(--radius-lg);
  text-align: center;
  transition: all var(--transition-normal);
  border: 1px solid var(--border-color);
  backdrop-filter: blur(10px);
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-color);
}

.feature-card i {
  font-size: 3rem;
  color: var(--primary-color);
  margin-bottom: var(--spacing-lg);
  display: block;
}

.feature-card h3 {
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

.feature-card p {
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 統計區塊 */
.stats-section {
  padding: var(--spacing-2xl) 0;
  background: var(--bg-primary);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--spacing-2xl);
}

.stat-item {
  text-align: center;
  padding: var(--spacing-lg);
}

.stat-number {
  font-size: 3rem;
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: var(--spacing-sm);
  display: block;
}

.stat-label {
  font-size: 1.125rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 1px;
  font-family: var(--font-main);
}

/* 通知組件 */
.notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  pointer-events: none;
}

.notification {
  max-width: 400px;
  margin-bottom: 10px;
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  color: white;
  font-weight: 500;
  transform: translateX(100%);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow-lg);
  pointer-events: auto;
  opacity: 0;
}

.notification.show {
  transform: translateX(0);
  opacity: 1;
}

.notification.hide {
  transform: translateX(100%);
  opacity: 0;
}

.notification.success {
  background: linear-gradient(135deg, var(--success-color), #00a041);
}

.notification.error {
  background: linear-gradient(135deg, var(--error-color), #cc0000);
}

.notification.warning {
  background: linear-gradient(135deg, var(--warning-color), #e6a000);
}

.notification.info {
  background: linear-gradient(135deg, var(--secondary-color), #0099cc);
}

.notification-close {
  position: absolute;
  top: var(--spacing-sm);
  right: var(--spacing-sm);
  background: none;
  border: none;
  color: white;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 模態對話框 */
.spa-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.spa-modal.show {
  opacity: 1;
  visibility: visible;
}

.spa-modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--bg-overlay);
  backdrop-filter: blur(5px);
}

.spa-modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 90vw;
  max-height: 90vh;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.spa-modal-header {
  padding: var(--spacing-lg);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.spa-modal-header h3 {
  margin: 0;
  color: var(--text-primary);
}

.spa-modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.5rem;
  cursor: pointer;
  padding: var(--spacing-sm);
  border-radius: var(--radius-sm);
  transition: all var(--transition-fast);
}

.spa-modal-close:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.spa-modal-body {
  padding: var(--spacing-lg);
  max-height: 60vh;
  overflow-y: auto;
}

.spa-modal-footer {
  padding: var(--spacing-lg);
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: var(--spacing-md);
  justify-content: flex-end;
}

/* 錯誤頁面 */
.page-error,
.page-empty {
  text-align: center;
  padding: var(--spacing-2xl);
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.page-error i,
.page-empty i {
  font-size: 4rem;
  color: var(--text-muted);
  margin-bottom: var(--spacing-lg);
}

.page-error h3,
.page-empty h3 {
  margin-bottom: var(--spacing-md);
  color: var(--text-primary);
}

.page-error p,
.page-empty p {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-lg);
}

/* 載入狀態 */
.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 1s ease-in-out infinite;
}

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

.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-dropdown);
}

/* 徽章 */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-xs) var(--spacing-sm);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-radius: var(--radius-sm);
  line-height: 1;
}

.badge-primary {
  background: var(--primary-color);
  color: white;
}

.badge-success {
  background: var(--success-color);
  color: white;
}

.badge-warning {
  background: var(--warning-color);
  color: white;
}

.badge-error {
  background: var(--error-color);
  color: white;
}

.badge-secondary {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* 進度條 */
.progress {
  width: 100%;
  height: 8px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(
    90deg,
    var(--primary-color),
    var(--primary-light)
  );
  transition: width var(--transition-normal);
  border-radius: var(--radius-sm);
}

/* 工具提示 */
.tooltip {
  position: relative;
  cursor: help;
}

.tooltip::before {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  padding: var(--spacing-sm) var(--spacing-md);
  background: var(--bg-overlay);
  color: white;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
  margin-bottom: 5px;
}

.tooltip::after {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--bg-overlay);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.tooltip:hover::before,
.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* 響應式調整 */
@media (max-width: 768px) {
  .generic-hero-content h1 {
    font-size: 2.5rem;
  }

  .generic-hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-number {
    font-size: 2rem;
  }

  .notification {
    right: var(--spacing-sm);
    left: var(--spacing-sm);
    max-width: none;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .spa-modal-content {
    margin: var(--spacing-md);
    max-width: calc(100vw - 2 * var(--spacing-md));
  }
}
