﻿/* ========================================
   活動卡片相關樣式
   ======================================== */

/* 活動卡片基本樣式 */
.es-activity-card {
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15), 
              0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  border-radius: 0.375rem;
  position: relative;
  z-index: 1;
}

.es-activity-card img {
  border-radius: 0.375rem 0.375rem 0 0;
}

.es-activity-card .es-card-bottom {
  border-radius: 0 0 0.375rem 0.375rem;
}

/* 可點擊的活動卡片樣式 */
.es-clickable-card {
  cursor: pointer;
  user-select: none;
}

.es-clickable-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25), 
              0 10px 25px rgba(0, 0, 0, 0.2);
  z-index: 5;
}

.es-clickable-card:active {
  transform: translateY(-5px) scale(1.01);
  transition: all 0.1s ease;
}

/* 活動卡片內容區域 */
.es-activity-content {
  margin-top: -25px;
}

/* 活動卡片標題樣式 */
.es-activity-title {
  position: absolute !important;
  top: -28px !important;
  right: 20px !important;
  z-index: 100 !important;
  padding: 0.75rem 1rem !important;
  background-color: var(--bs-primary) !important;
  color: white !important;
  border-radius: 0.375rem !important;
  white-space: nowrap !important;
  font-weight: 700 !important;
  font-size: 1.1rem !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

/* 不同分類的標題顏色主題 */
.es-activity-title.certificate {
  background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%) !important;
  box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3) !important;
}

.es-activity-title.product-news {
  background: linear-gradient(135deg, #6f42c1 0%, #4e2a84 100%) !important;
  box-shadow: 0 2px 8px rgba(111, 66, 193, 0.3) !important;
}

.es-activity-title.product-info {
  background: linear-gradient(135deg, #fd7e14 0%, #e55a00 100%) !important;
  box-shadow: 0 2px 8px rgba(253, 126, 20, 0.3) !important;
}

.es-activity-title.training {
  background: linear-gradient(135deg, #17a2b8 0%, #117a8b 100%) !important;
  box-shadow: 0 2px 8px rgba(23, 162, 184, 0.3) !important;
}

.es-activity-title.announcement {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%) !important;
  box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3) !important;
}

/* 卡片懸停時標題效果 */
.es-activity-card:hover .es-activity-title.certificate {
  background: linear-gradient(135deg, #1e7e34 0%, #155724 100%) !important;
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4) !important;
}

.es-activity-card:hover .es-activity-title.product-news {
  background: linear-gradient(135deg, #4e2a84 0%, #3d1a66 100%) !important;
  box-shadow: 0 4px 12px rgba(111, 66, 193, 0.4) !important;
}

.es-activity-card:hover .es-activity-title.product-info {
  background: linear-gradient(135deg, #e55a00 0%, #cc4900 100%) !important;
  box-shadow: 0 4px 12px rgba(253, 126, 20, 0.4) !important;
}

.es-activity-card:hover .es-activity-title.training {
  background: linear-gradient(135deg, #117a8b 0%, #0c5460 100%) !important;
  box-shadow: 0 4px 12px rgba(23, 162, 184, 0.4) !important;
}

.es-activity-card:hover .es-activity-title.announcement {
  background: linear-gradient(135deg, #c82333 0%, #a71e2a 100%) !important;
  box-shadow: 0 4px 12px rgba(220, 53, 69, 0.4) !important;
}

/* ========================================
   模態框相關樣式
   ======================================== */

/* 活動模態框基本樣式 */
.es-activity-modal {
  background: none;
  border: none;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4), 
              0 15px 30px rgba(0, 0, 0, 0.3), 
              0 5px 15px rgba(0, 0, 0, 0.2);
  border-radius: 15px;
  max-height: 95vh;
  overflow: hidden;
  position: relative;
}

.es-activity-modal .modal-body {
  padding: 0;
  margin: 0;
  max-height: 95vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 模態框關閉按鈕 */
.es-btn-activity-close {
  position: absolute;
  top: 5px;
  right: 3%;
  z-index: 10;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  padding: 10px;
  border: none;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: background-color 0.3s ease;
}

.es-btn-activity-close:hover {
  background-color: rgba(255, 255, 255, 1);
  cursor: pointer;
}

/* 圖片類型的模態框樣式 */
.es-activity-modal img:not(.es-article-container img) {
  max-width: 100%;
  max-height: 95vh;
  width: auto;
  height: auto;
  object-fit: contain;
  display: block;
}

/* ========================================
   文章容器相關樣式
   ======================================== */

/* 文章容器基本樣式 */
.es-article-container {
  width: 100%;
  height: 85vh;
  max-height: 85vh;
  border-radius: 15px;
  overflow: hidden;
  background-color: #ffffff;
  position: relative;
  flex-shrink: 0;
}

/* 當包含文章容器時：重置父容器的 flex 影響 */
.es-activity-modal .modal-body .es-article-container {
  position: relative;
}

.es-activity-modal .es-article-container {
  width: 100%;
  height: 85vh;
  max-height: 85vh;
  display: block;
}

/* 底部漸層遮罩提示 */
.es-article-container::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 30px;
  background: linear-gradient(to top, rgba(255, 255, 255, 0.9) 0%, transparent 100%);
  pointer-events: none;
  border-radius: 0 0 15px 15px;
  z-index: 10;
}

/* 文章內容區域 */
.es-article-content {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 2rem;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: auto;
  scrollbar-color: #6c757d #e9ecef;
  -webkit-overflow-scrolling: touch;
  scrollbar-gutter: stable;
}

/* 滾動提示 - 相對於模態框定位 */
.es-scroll-hint {
  position: absolute;
  bottom: 2rem;
  right: 2rem;
  color: #007bff;
  font-size: 1.8rem;
  font-weight: bold;
  z-index: 10;
  opacity: 0;
  animation: scrollHint 2s ease-in-out infinite;
  animation-play-state: paused;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 50%;
  width: 3rem;
  height: 3rem;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
  border: 2px solid #007bff;
  transition: opacity 0.3s ease;
}

@keyframes scrollHint {
  0%, 60%, 100% { 
    opacity: 0; 
    transform: translateY(0) scale(1); 
  }
  20%, 40% { 
    opacity: 0.9; 
    transform: translateY(5px) scale(1.1); 
  }
}

/* 文章內嵌圖片區域 */
.es-article-image-inline {
  width: 100%;
  text-align: center;
  margin-bottom: 2rem;
}

.es-article-image-inline img {
  max-width: 100%;
  height: auto;
  max-height: 40vh;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

/* 文章文字區域 */
.es-article-text {
  width: 100%;
}

/* Hashtag 樣式 */
.es-hashtag-text {
  color: #6f42c1;
  font-weight: 600;
}

/* 文章連結區域 */
.es-article-link {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.es-article-container .btn {
  font-weight: 600;
  transition: all 0.3s ease;
  border-radius: 0.5rem;
  padding: 0.75rem 1.5rem;
}

.es-article-container .btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(0, 123, 255, 0.3);
}

/* ========================================
   滾動條樣式
   ======================================== */

/* 桌面版滾動條 */
.es-article-content::-webkit-scrollbar {
  width: 12px;
}

.es-article-content::-webkit-scrollbar-track {
  background: #e9ecef;
  border-radius: 0 15px 15px 0;
  box-shadow: inset 0 0 3px rgba(0, 0, 0, 0.1);
}

.es-article-content::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #6c757d 0%, #495057 100%);
  border-radius: 6px;
  border: 1px solid #495057;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.es-article-content::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #495057 0%, #343a40 100%);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.es-article-content::-webkit-scrollbar-thumb:active {
  background: linear-gradient(180deg, #343a40 0%, #212529 100%);
}

/* ========================================
   News 篩選器樣式
   ======================================== */

/* 篩選器容器 */
.es-news-filter-container {
  display: flex;
  justify-content: flex-start;
  margin-bottom: 2rem;
}

.es-news-filter-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

/* 篩選器標籤 */
.es-filter-label {
  font-size: 1rem;
  font-weight: 500;
  color: #495057;
  white-space: nowrap;
}

/* 篩選器切換按鈕 */
.es-filter-toggle-btn {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 25px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
  transition: all 0.3s ease;
  min-width: 140px;
  justify-content: space-between;
}

.es-filter-toggle-btn:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

.es-filter-toggle-btn.active {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
}

/* 篩選器圖標 */
.es-filter-icon {
  transition: transform 0.3s ease;
  font-size: 0.9rem;
}

.es-filter-toggle-btn.active .es-filter-icon {
  transform: rotate(180deg);
}

/* 篩選選項容器 */
.es-filter-options {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
  border: 1px solid #e9ecef;
}

.es-filter-options.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.es-filter-options.expand-right {
  top: 0;
  left: 100%;
  margin-left: 0.5rem;
}

.es-filter-options.expand-right.show {
  transform: translateX(0);
}

/* 篩選選項按鈕 */
.es-filter-option {
  display: block;
  width: 100%;
  background: transparent;
  border: none;
  padding: 0.75rem 1rem;
  text-align: left;
  cursor: pointer;
  border-radius: 10px;
  font-size: 0.95rem;
  font-weight: 500;
  color: #333;
  transition: all 0.2s ease;
  margin-bottom: 0.25rem;
}

.es-filter-option:last-child {
  margin-bottom: 0;
}

.es-filter-option:hover {
  background: #f8f9fa;
  color: #007bff;
  transform: translateX(5px);
}

.es-filter-option.active {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: white;
  font-weight: 600;
}

.es-filter-option.active:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateX(0);
}

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

/* 手機版樣式 */
@media (max-width: 768px) {
  /* 文章容器手機版調整 */
  .es-article-content {
    padding: 1.5rem;
    scrollbar-width: thick;
    scrollbar-color: #495057 rgba(233, 236, 239, 0.8);
  }
  
  .es-article-image-inline {
    margin-bottom: 1.5rem;
  }
  
  .es-article-image-inline img {
    max-height: 20vh;
    border-radius: 8px;
  }
  
  .es-article-text p {
    font-size: 1rem;
    line-height: 1.6;
  }
  
  .es-article-link {
    margin-top: 1.5rem;
  }
  
  /* 手機版滾動條樣式 */
  .es-article-content::-webkit-scrollbar {
    width: 18px;
    background: rgba(0, 0, 0, 0.1);
  }
  
  .es-article-content::-webkit-scrollbar-track {
    background: rgba(233, 236, 239, 0.8);
    border-radius: 0 15px 15px 0;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
  }
  
  .es-article-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #495057 0%, #212529 100%);
    border-radius: 8px;
    border: 2px solid #343a40;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.4);
    min-height: 50px;
  }
  
  .es-article-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #343a40 0%, #000000 100%);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
  }
  
  /* 手機版滾動提示 */
  .es-scroll-hint {
    font-size: 1.6rem;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 2.5rem;
    height: 2.5rem;
    box-shadow: 0 3px 10px rgba(0, 123, 255, 0.4);
  }
  
  /* 篩選器手機版調整 */
  .es-news-filter-container {
    justify-content: center;
  }
  
  .es-news-filter-wrapper {
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
  }
  
  .es-filter-label {
    font-size: 0.9rem;
    text-align: center;
  }
  
  .es-filter-toggle-btn {
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
    min-width: 120px;
  }
  
  .es-filter-options {
    min-width: 140px;
    top: 100% !important;
    left: 0 !important;
    margin-left: 0 !important;
  }
  
  .es-filter-options.expand-right {
    top: 100% !important;
    left: 0 !important;
    margin-left: 0 !important;
  }
  
  .es-filter-option {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }
}

/* 觸控設備專用樣式 */
@media (hover: none) and (pointer: coarse) {
  .es-article-content::-webkit-scrollbar {
    width: 18px !important;
    background: rgba(0, 0, 0, 0.15) !important;
    display: block !important;
    opacity: 1 !important;
  }
  
  .es-article-content::-webkit-scrollbar-track {
    background: rgba(108, 117, 125, 0.3) !important;
    border-radius: 0 15px 15px 0 !important;
    box-shadow: inset 0 0 8px rgba(0, 0, 0, 0.3) !important;
  }
  
  .es-article-content::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #343a40 0%, #000000 100%) !important;
    border-radius: 9px !important;
    border: 3px solid #212529 !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.6) !important;
    min-height: 60px !important;
    opacity: 1 !important;
    visibility: visible !important;
  }
  
  .es-article-content::-webkit-scrollbar-thumb:active {
    background: linear-gradient(180deg, #212529 0%, #000000 100%) !important;
    transform: scale(1.1) !important;
  }
  
  .es-article-content {
    touch-action: pan-y !important;
    overscroll-behavior-y: contain !important;
  }
}


