/* ✅ 管理者儀表板樣式表 (v2.0) */
/* 美化管理後台的 CSS 樣式 */

/* ============================================
   全局樣式
   ============================================ */

:root {
  --primary-color: #3b82f6;
  --secondary-color: #8b5cf6;
  --warning-color: #f59e0b;
  --success-color: #10b981;
  --error-color: #ef4444;
  --info-color: #06b6d4;
  --base-100: #ffffff;
  --base-200: #f3f4f6;
  --base-300: #e5e7eb;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --border-radius: 0.5rem;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   儀表板容器
   ============================================ */

.admin-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f3f4f6 0%, #ffffff 50%, #f3f4f6 100%);
  padding: 1.5rem;
}

.admin-content {
  max-width: 1280px;
  margin: 0 auto;
}

/* ============================================
   標題區域
   ============================================ */

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
}

.admin-title {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-title-emoji {
  font-size: 2.25rem;
  display: inline-block;
}

.admin-subtitle {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.admin-status-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background-color: var(--success-color);
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

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

.admin-back-btn {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  background-color: transparent;
  border: 1px solid #d1d5db;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.admin-back-btn:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

/* ============================================
   統計卡片
   ============================================ */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

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

@media (min-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

.stat-card {
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.stat-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  transform: scale(1.05);
}

.stat-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 6rem;
  height: 6rem;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  margin-right: -2rem;
  margin-top: -2rem;
}

.stat-card.warning {
  background: linear-gradient(
    135deg,
    #f59e0b 0%,
    #f59e0b 80%,
    rgba(245, 158, 11, 0.8) 100%
  );
}

.stat-card.info {
  background: linear-gradient(
    135deg,
    #06b6d4 0%,
    #06b6d4 80%,
    rgba(6, 182, 212, 0.8) 100%
  );
}

.stat-card.success {
  background: linear-gradient(
    135deg,
    #10b981 0%,
    #10b981 80%,
    rgba(16, 185, 129, 0.8) 100%
  );
}

.stat-card.base {
  background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
  border: 2px solid var(--success-color);
}

.stat-card-title {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 10;
}

.stat-card.warning .stat-card-title,
.stat-card.info .stat-card-title,
.stat-card.success .stat-card-title {
  color: white;
}

.stat-card.base .stat-card-title {
  color: var(--text-primary);
}

.stat-card-emoji {
  font-size: 1.5rem;
}

.stat-card-value {
  font-size: 3rem;
  font-weight: 700;
  position: relative;
  z-index: 10;
  margin-bottom: 0.5rem;
}

.stat-card.warning .stat-card-value,
.stat-card.info .stat-card-value,
.stat-card.success .stat-card-value {
  color: white;
}

.stat-card.base .stat-card-value {
  color: var(--text-primary);
}

.stat-card-description {
  font-size: 0.875rem;
  position: relative;
  z-index: 10;
}

.stat-card.warning .stat-card-description,
.stat-card.info .stat-card-description,
.stat-card.success .stat-card-description {
  color: rgba(255, 255, 255, 0.7);
}

.stat-card.base .stat-card-description {
  color: var(--text-secondary);
}

/* 進度條 */
.progress-bar {
  width: 100%;
  height: 0.75rem;
  background-color: rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 1rem;
}

.progress-fill {
  height: 100%;
  background-color: white;
  transition: width 0.5s ease-out;
  border-radius: 999px;
}

.progress-text {
  font-size: 0.75rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

/* ============================================
   快速操作卡片
   ============================================ */

.quick-actions-section {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
}

.quick-actions-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
}

@media (max-width: 768px) {
  .quick-actions-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media (min-width: 1024px) {
  .quick-actions-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.action-card {
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 1.5rem;
  transition: var(--transition-smooth);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.action-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.action-card.primary {
  background-color: rgba(59, 130, 246, 0.05);
  border-color: rgba(59, 130, 246, 0.2);
}

.action-card.primary:hover {
  border-color: rgba(59, 130, 246, 0.5);
}

.action-card.info {
  background-color: rgba(6, 182, 212, 0.05);
  border-color: rgba(6, 182, 212, 0.2);
}

.action-card.info:hover {
  border-color: rgba(6, 182, 212, 0.5);
}

.action-card.success {
  background-color: rgba(16, 185, 129, 0.05);
  border-color: rgba(16, 185, 129, 0.2);
}

.action-card.success:hover {
  border-color: rgba(16, 185, 129, 0.5);
}

.action-card-emoji {
  font-size: 2.25rem;
  margin-bottom: 0.5rem;
  display: inline-block;
  transition: transform 0.3s ease;
}

.action-card:hover .action-card-emoji {
  transform: scale(1.1);
}

.action-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.action-card-description {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.action-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  font-size: 0.75rem;
  font-weight: 600;
}

.action-card-arrow {
  transition: transform 0.3s ease;
}

.action-card:hover .action-card-arrow {
  transform: translateX(0.25rem);
}

/* ============================================
   信息提示
   ============================================ */

.alert-section {
  background-color: #ecf0ff;
  border-left: 4px solid var(--info-color);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  gap: 1rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
}

.alert-icon {
  width: 1.5rem;
  height: 1.5rem;
  color: var(--info-color);
  flex-shrink: 0;
}

.alert-content p:first-child {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.alert-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0;
}

/* ============================================
   按鈕
   ============================================ */

.btn {
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius);
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  font-size: 0.875rem;
}

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

.btn-primary:hover {
  background-color: #2563eb;
  transform: translateY(-2px);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-outline {
  background-color: transparent;
  border: 1px solid #d1d5db;
  color: var(--text-primary);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-sm {
  padding: 0.375rem 0.75rem;
  font-size: 0.8125rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
}

/* ============================================
   響應式設計
   ============================================ */

@media (max-width: 640px) {
  .admin-title {
    font-size: 1.875rem;
  }

  .admin-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .stat-card {
    padding: 1rem;
  }

  .stat-card-value {
    font-size: 2.25rem;
  }

  .quick-actions-section {
    padding: 1rem;
  }
}
