/* =============================================================
   VastConfluence Admin - Unified Stylesheet
   整合自：vc_login.html, vc_admin_dashboard_2.html, 
           vc_admin_dashboard3.html, vc_admin_dashboard.html.html, VC_admin_ok.html
   ============================================================= */

:root {
  /* Bootstrap 5 主題顏色自訂 */
  --bs-primary: #1e293b;
  --bs-primary-rgb: 30, 41, 59;

  --bs-secondary: #64748b;
  --bs-secondary-rgb: 100, 116, 139;

  --bs-success: #10b981;
  --bs-success-rgb: 16, 185, 129;

  --bs-info: #0ea5e9;
  --bs-info-rgb: 14, 165, 233;

  --bs-warning: #f59e0b;
  --bs-warning-rgb: 245, 158, 11;

  --bs-danger: #ef4444;
  --bs-danger-rgb: 239, 68, 68;
}

/* =========================
   全域基底樣式
   ========================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  overflow: hidden;
  /* 固定整個頁面不滾動，只有 .main-content 可以內滾動 */
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -2;
  background: linear-gradient(180deg,
      #e0f2fe 0%,
      #e5e7fb 25%,
      #fae8ff 50%,
      #fce7f3 75%,
      #d1fae5 100%);
  opacity: 0.5;
  filter: blur(44px);
}

body::after {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: -1;
  background: rgba(255, 255, 255, 0.4);
}

/* =============================================
   背景漸層主題選項 (可替換 body::before 使用)
   ============================================= */

/* [主題 A] 綠色系：幽林秘境 (深翠綠 + 橄欖 + 森林綠) */
/*
body::before {
  background:
    radial-gradient(circle at 0% 0%, rgba(6, 78, 59, 0.15), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(20, 83, 45, 0.12), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(63, 98, 18, 0.15), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(17, 94, 89, 0.12), transparent 50%),
    #f4fbf7;
  filter: blur(65px);
  opacity: 1;
}
*/

/* [主題 B] 橙色系：琥珀餘暉 (鐵鏽橙 + 金棕 + 深橘) */
/*
body::before {
  background:
    radial-gradient(circle at 0% 0%, rgba(154, 52, 18, 0.12), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(120, 53, 15, 0.1), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(180, 83, 9, 0.12), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(194, 65, 12, 0.1), transparent 50%),
    #fdf8f4;
  filter: blur(65px);
  opacity: 1;
}
*/

/* [主題 C] 紫色系：皇家暗影 (深紫羅蘭 + 藏青靛紫) */
/*
body::before {
  background:
    radial-gradient(circle at 0% 0%, rgba(76, 29, 149, 0.15), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(49, 46, 129, 0.15), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(91, 33, 182, 0.12), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(55, 48, 163, 0.12), transparent 50%),
    #f8f7fb;
  filter: blur(65px);
  opacity: 1;
}
*/

/* [主題 D] 深紅色系：勃艮第酒紅 (酒紅 + 暗薔薇 + 寶石紅) */
/*
body::before {
  background:
    radial-gradient(circle at 0% 0%, rgba(127, 29, 29, 0.12), transparent 50%),
    radial-gradient(circle at 100% 100%, rgba(76, 5, 25, 0.1), transparent 50%),
    radial-gradient(circle at 100% 0%, rgba(159, 18, 57, 0.12), transparent 50%),
    radial-gradient(circle at 0% 100%, rgba(131, 24, 67, 0.1), transparent 50%),
    #fcf7f7;
  filter: blur(65px);
  opacity: 1;
}
*/

/* =========================
   UI 質感優化
   ========================= */
.rounded {
  border-radius: 16px !important;
}

.btn {
  border-radius: 50rem !important;
  padding: 8px 24px !important;
  font-weight: 600;
  transition: all 0.2s ease;
}

.btn-sm {
  padding: 6px 16px !important;
  font-size: 0.85rem;
}

.btn-primary {
  --bs-btn-bg: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-bg: #0f172a;
  --bs-btn-hover-border-color: #0f172a;
  --bs-btn-active-bg: #0f172a;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 16px rgba(30, 41, 59, 0.2);
}

.btn-outline-secondary {
  border-color: #cbd5e1;
  color: #475569;
  background: transparent;
}

.btn-outline-secondary:hover {
  background: #f8fafc;
  color: #0f172a;
  transform: translateY(-2px);
}

.badge {
  border-radius: 8px !important;
  padding: 6px 12px;
  font-weight: 600;
}

/* =========================
   表單元件樣式
   ========================= */
.form-control,
.form-select {
  border-radius: 10px !important;
  padding: 10px 16px;
  border-color: #cbd5e1;
  font-size: 15px;
  box-shadow: none !important;
  transition: all 0.2s;
  background-color: #f8fafc;
}

.form-control:focus,
.form-select:focus {
  background-color: #ffffff;
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(30, 41, 59, 0.15) !important;
}

.form-label {
  font-weight: 700;
  color: #334155;
  font-size: 0.9rem;
  margin-bottom: 8px;
}

.form-check-input:checked {
  background-color: var(--bs-primary);
  border-color: var(--bs-primary);
}

.form-check-input:focus {
  border-color: var(--bs-primary);
  box-shadow: 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25) !important;
}

.form-range::-webkit-slider-thumb {
  background-color: var(--bs-primary);
}

.form-range::-webkit-slider-thumb:active {
  background-color: var(--bs-secondary);
}

.form-range::-moz-range-thumb {
  background-color: var(--bs-primary);
}

.form-range::-moz-range-thumb:active {
  background-color: var(--bs-secondary);
}

.form-range:focus::-webkit-slider-thumb {
  box-shadow: 0 0 0 1px #fff, 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

.form-range:focus::-moz-range-thumb {
  box-shadow: 0 0 0 1px #fff, 0 0 0 0.25rem rgba(var(--bs-primary-rgb), 0.25);
}

/* =========================
   Primary 顏色應用
   ========================= */
.text-primary {
  color: var(--bs-primary) !important;
}

.bg-primary {
  background-color: var(--bs-primary) !important;
}

/* =========================
   品牌與 Logo
   ========================= */
.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
}

.brand-logo {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 10px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.brand-name {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin: 0;
  letter-spacing: 0.5px;
}

.brand-logo-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: auto;
}

.brand-logo-wrap img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.brand-logo-wrap h4 {
  margin: 0;
  font-weight: 800;
  color: #0f172a;
}

.brand-messaging {
  margin-bottom: auto;
  position: relative;
  z-index: 2;
}

.brand-messaging h1 {
  font-size: 3rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -1px;
}

.brand-messaging p {
  font-size: 1.1rem;
  color: #475569;
  line-height: 1.6;
  max-width: 400px;
}

/* =========================
   動作圖示
   ========================= */
.action-icon {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 8px;
  transition: 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.action-icon:hover {
  opacity: 0.7;
  transform: translateY(-2px);
}

.desktop-top-actions {
  position: fixed;
  top: 25px;
  right: 40px;
  z-index: 98;
}

/* =========================
   側邊欄 - Icon 窄欄
   ========================= */
.sidebar-icon {
  width: 64px;
  height: 100vh;
  background: #1e293b;
  color: #ffffff;
  position: fixed;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 24px;
  z-index: 99;
  border-radius: 0 20px 20px 0;
  box-shadow: 2px 0 8px rgba(0, 0, 0, 0.15);
}

.icon-item {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.2s;
}

.icon-item:hover {
  background: rgba(255, 255, 255, 0.15);
}

.icon-img {
  width: 24px;
  height: 24px;
  object-fit: contain;
  border-radius: 4px;
}

/* =========================
   側邊欄 - 選單
   ========================= */
.sidebar-menu {
  width: 230px;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 64px;
  padding: 28px 20px;
  overflow-y: auto;
  z-index: 98;
}

.menu-item {
  display: block;
  padding: 12px 16px;
  margin-bottom: 4px;
  color: #64748b;
  text-decoration: none;
  font-weight: bold;
  transition: 0.2s;
  border-radius: 10px;
}

.menu-item.active {
  color: #2563eb;
}

.menu-item:hover:not(.active) {
  color: #0f172a;
  background: rgba(255, 255, 255, 0.4);
}

/* =========================
   主內容區
   ========================= */
.main-content {
  margin-left: calc(64px + 230px);
  margin-top: 80px;
  background: #ffffff;
  height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 1;
}

.main-content::-webkit-scrollbar {
  width: 6px;
}

.main-content::-webkit-scrollbar-track {
  background: transparent;
  margin-top: 24px;
  margin-bottom: 24px;
}

.main-content::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 10px;
}

.main-content::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* =========================
   自訂模組樣式：共用彈出提示框 (Custom Overlay Alert)
   ========================= */
.custom-alert-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.custom-alert-overlay.show {
  opacity: 1;
  visibility: visible;
}

.custom-alert-box {
  background: #ffffff;
  width: 90%;
  max-width: 400px;
  border-radius: 24px;
  padding: 40px 32px;
  text-align: center;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.15);
  transform: scale(0.9) translateY(10px);
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-alert-overlay.show .custom-alert-box {
  transform: scale(1) translateY(0);
}

.custom-alert-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px auto;
}

.alert-icon-success {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.alert-icon-danger {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.custom-alert-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 12px;
}

.custom-alert-text {
  color: #64748b;
  margin-bottom: 32px;
  line-height: 1.6;
}

/* =========================
   Hover 浮動效果
   ========================= */
.hover-lift {
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08) !important;
}

.transition-all {
  transition: all 0.25s ease;
}

/* =========================
   登入頁面專用樣式
   ========================= */
.login-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.glass-container {
  display: flex;
  width: 100%;
  max-width: 1100px;
  min-height: 640px;
  background: rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 32px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.05),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  padding: 16px;
}

.brand-info-section {
  flex: 1;
  padding: 48px;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.decoration-circle {
  position: absolute;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  z-index: 1;
}

.circle-1 {
  width: 120px;
  height: 120px;
  bottom: 10%;
  right: 10%;
}

.circle-2 {
  width: 60px;
  height: 60px;
  bottom: 30%;
  right: 35%;
  opacity: 0.7;
}

.circle-3 {
  width: 200px;
  height: 200px;
  top: -50px;
  right: -50px;
  opacity: 0.4;
}

.login-form-box {
  width: 460px;
  background: #ffffff;
  border-radius: 24px;
  padding: 56px 48px;
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.login-form-box h3 {
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
}

.login-form-box p.subtitle {
  color: #64748b;
  margin-bottom: 32px;
}

.text-primary-custom {
  color: var(--bs-primary);
  text-decoration: none;
  font-weight: 600;
}

.text-primary-custom:hover {
  text-decoration: underline;
  color: #0f172a;
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #94a3b8;
  font-size: 0.85rem;
  margin: 24px 0;
}

.divider::before,
.divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid #e2e8f0;
}

.divider:not(:empty)::before {
  margin-right: 0.5em;
}

.divider:not(:empty)::after {
  margin-left: 0.5em;
}

/* =========================
   手機版專用樣式
   ========================= */
.mobile-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  padding: 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1040;
}

.mobile-toggle-btn {
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 12px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}

.offcanvas-custom {
  background: transparent !important;
  border: none !important;
  width: 294px !important;
}

.mobile-menu-wrapper {
  background: #ffffff;
  position: relative;
  overflow: hidden;
}

.mobile-menu-bg {
  position: absolute;
  top: -60px;
  left: -60px;
  right: -60px;
  bottom: -60px;
  /* 預設使用藍紫色漸層，可依頁面主題替換 */
  background: linear-gradient(180deg,
      #e0f2fe 0%,
      #e5e7fb 25%,
      #fae8ff 50%,
      #fce7f3 75%,
      #d1fae5 100%);
  opacity: 0.5;
  filter: blur(44px);
  z-index: 0;
}

/* 手機版 Table 切換顯示 */
.hide-on-sm {
  display: table-cell !important;
}

.show-on-sm {
  display: none !important;
}

/* =========================
   圓形數字標籤
   ========================= */
.circle-num {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* =========================
   狀態標籤 (Trend)
   ========================= */
.trend-up {
  background-color: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.trend-down {
  background-color: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* =========================
   標籤頁切換 (Tabs)
   ========================= */
.nav-tabs-custom {
  border-bottom: 2px solid #e2e8f0;
  border-radius: 0 !important;
  gap: 8px;
}

.nav-tabs-custom .nav-link {
  color: #64748b;
  font-weight: 600;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 20px;
  margin-bottom: -2px;
  transition: all 0.2s ease;
  background: transparent;
}

.nav-tabs-custom .nav-link:hover {
  color: var(--bs-primary);
  border-color: transparent;
}

.nav-tabs-custom .nav-link.active {
  color: var(--bs-primary);
  border-bottom: 3px solid var(--bs-primary);
  background: transparent;
}

/* =========================
   時間軸 (Timeline)
   ========================= */
.timeline {
  border-left: 2px solid #e2e8f0;
  padding-left: 24px;
  margin-left: 12px;
}

.timeline-item {
  position: relative;
  margin-bottom: 28px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-icon {
  position: absolute;
  left: -33px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #ffffff;
  border: 3px solid var(--bs-primary);
  box-shadow: 0 0 0 4px #ffffff;
}

/* =========================
   媒體庫 (Media Gallery)
   ========================= */
.media-card {
  aspect-ratio: 4 / 3;
}

.media-overlay {
  background: rgba(30, 41, 59, 0.7);
  opacity: 0;
  transition: 0.3s;
  backdrop-filter: blur(2px);
}

.media-card:hover .media-overlay {
  opacity: 1;
}


/* =========================
   響應式設計
   ========================= */
@media (max-width: 991.98px) {

  .sidebar-icon,
  .sidebar-menu {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    margin-right: 0;
    margin-top: 90px;
    padding: 24px;
    height: calc(100vh - 90px);
    overflow-y: auto;
    border-radius: 24px 24px 0 0;
  }

  .glass-container {
    flex-direction: column;
    padding: 0;
    min-height: auto;
    border: none;
    background: transparent;
    box-shadow: none;
  }

  .brand-info-section {
    display: none;
  }

  .login-form-box {
    width: 100%;
    padding: 40px 32px;
  }
}

@media (max-width: 767.98px) {
  .hide-on-sm {
    display: none !important;
  }

  .show-on-sm {
    display: table-cell !important;
  }
}

/* =========================
   自訂模組樣式：手風琴 (Accordion)
========================= */
.custom-accordion .accordion-item {
  border: 1px solid #cbd5e1;
  background: #ffffff;
  border-radius: 16px !important;
  margin-bottom: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.2s ease;
}

.custom-accordion .accordion-item:hover {
  border-color: #94a3b8;
}

.custom-accordion .accordion-button {
  border-radius: 16px !important;
  padding: 20px 24px;
  font-weight: 700;
  font-size: 1.05rem;
  color: #0f172a;
  box-shadow: none !important;
  background-color: #ffffff;
  transition: all 0.2s;
}

.custom-accordion .accordion-button:not(.collapsed) {
  background-color: #f1f5f9;
  color: #1e293b;
  border-bottom: 1px solid #cbd5e1;
}

.custom-accordion .accordion-body {
  padding: 24px;
  color: #334155;
  line-height: 1.7;
}

/* =========================
   自訂模組樣式：分頁 (Pagination)
========================= */
.custom-pagination {
  gap: 8px;
}

.custom-pagination .page-item .page-link {
  border: none;
  border-radius: 50% !important;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-weight: 600;
  background-color: transparent;
  transition: all 0.2s ease;
}

.custom-pagination .page-item:not(.active) .page-link:hover {
  background-color: #f1f5f9;
  color: #1e293b;
  transform: translateY(-2px);
}

.custom-pagination .page-item.active .page-link {
  background-color: var(--bs-primary);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(30, 41, 59, 0.25);
}

.custom-pagination .page-item.disabled .page-link {
  color: #cbd5e1;
  background-color: transparent;
}