/* assets/style.css */
:root {
  /* --- 暖色系配色方案 (Warm Theme) --- */
  --sidebar-bg: #1c1917;       /* 深暖棕黑 */
  --sidebar-text: #a8a29e;     /* 暖灰 */
  --sidebar-active: #d6d3d1;   /* 亮暖灰 */
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  
  --main-bg: #fdfbf7;          /* 核心背景：暖米白 */
  --card-bg: #ffffff;          /* 卡片背景：純白 */
  
  --text-primary: #292524;     /* 深褐黑 */
  --text-secondary: #57534e;   /* 次要文字：深暖灰 */
  
  --accent: #d97706;           /* 提亮色：琥珀金/暖橘 */
  --accent-hover: #b45309;
  
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 6px -1px rgba(44, 36, 27, 0.08), 0 2px 4px -1px rgba(44, 36, 27, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(44, 36, 27, 0.1), 0 4px 6px -2px rgba(44, 36, 27, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: var(--main-bg);
  color: var(--text-primary);
  height: 100vh;       
  overflow: hidden;  
}


a { text-decoration: none; color: inherit; }
button { font-family: inherit; }

/* 佈局容器 */
.app-container {
  display: flex;
  height: 100%;
}

/* === Sidebar === */
.sidebar {
  width: 260px;
  background-color: var(--sidebar-bg);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  border-right: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.custom-logo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--accent);
}

.brand-title { color: #f5f5f4; font-weight: 600; font-size: 16px; }
.brand-subtitle { font-size: 12px; opacity: 0.7; }

.sidebar-nav {
  padding: 20px 16px;
  flex: 1;
  overflow-y: auto;
}

.nav-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 20px 0 8px 12px;
  color: #78716c;
  font-weight: 600;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 4px;
  transition: all 0.2s;
  cursor: pointer;
}

.nav-item:hover {
  background-color: var(--sidebar-hover);
  color: #f5f5f4;
}

.nav-item.active {
  background-color: rgba(217, 119, 6, 0.15); /* Accent transparent */
  color: #fbbf24; /* Lighter accent for text */
  font-weight: 500;
}

.sidebar-footer {
  padding: 20px;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.lang-switch-box {
  display: flex;
  background: rgba(0,0,0,0.3);
  padding: 4px;
  border-radius: 6px;
  margin-bottom: 10px;
}

.lang-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: #78716c;
  font-size: 12px;
  padding: 4px;
  cursor: pointer;
  border-radius: 4px;
}

.lang-btn.active {
  background-color: #292524;
  color: #e7e5e4;
}

.copyright { font-size: 11px; text-align: center; opacity: 0.5; }

/* === Main Content === */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background-color: var(--main-bg);
  overflow: hidden;
  position: relative;
}

.top-bar {
  height: 70px;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--card-bg); /* 白色 */
  border-bottom: 1px solid #e7e5e4;
  flex-shrink: 0;
}

.page-info h1 { font-size: 20px; font-weight: 700; color: var(--text-primary); }
.page-info p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

.status-indicator {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px;
  color: #059669; /* Green */
  background: rgba(16, 185, 129, 0.1);
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
}
.status-dot { width: 8px; height: 8px; background: #059669; border-radius: 50%; }

/* Scrollable Area */
.content-wrapper {
  flex: 1;
  overflow-y: auto; /* Allow scroll */
  padding: 32px;
  scroll-behavior: smooth;
}

/* Sections Logic */
.view-section { display: none; animation: fadeIn 0.4s ease; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* === Cards & Grid (Projects) === */
.project-group { margin-bottom: 48px; }

.group-title {
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid #e7e5e4;
  display: inline-block;
  padding-right: 20px;
}

.grid-container {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  border: 1px solid #e7e5e4;
  transition: transform 0.2s, box-shadow 0.2s;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

/* Card Image Area (Trigger for Modal) */
.card-image-wrapper {
  height: 160px;
  position: relative;
  background: #f5f5f4;
  cursor: pointer;
  overflow: hidden;
}

.card-image-wrapper img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.3s ease;
}

.card-image-wrapper:hover img {
  transform: scale(1.05);
}

.card-overlay {
  position: absolute; 
  inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.card-image-wrapper:hover .card-overlay { opacity: 1; }

.play-btn {
  background: rgba(0,0,0,0.7);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text-primary); }
.card-text { font-size: 14px; color: var(--text-secondary); line-height: 1.5; flex: 1; margin-bottom: 16px; }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tag {
  font-size: 11px; background: #f5f5f4; color: #57534e;
  padding: 4px 10px; border-radius: 20px; font-weight: 500;
}

/* === Solutions Style === */
.banner-card {
  background: linear-gradient(135deg, #292524, #1c1917);
  color: #fafaf9;
  padding: 40px;
  border-radius: var(--radius);
  margin-bottom: 30px;
  box-shadow: var(--shadow-lg);
}
.banner-card h2 { font-size: 28px; margin-bottom: 10px; color: #fff; }
.banner-card p { opacity: 0.8; max-width: 600px; }

.solutions-layout { 
  background: white; 
  border-radius: var(--radius); 
  border: 1px solid #e7e5e4; 
  overflow: hidden; 
  box-shadow: var(--shadow-sm);
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid #e7e5e4;
  background: #fafaf9;
}
.tab-btn {
  padding: 16px 24px;
  border: none; background: transparent;
  cursor: pointer; font-size: 14px; color: #78716c; font-weight: 500;
  border-right: 1px solid #e7e5e4;
  transition: background 0.2s;
}
.tab-btn:hover { background: #f5f5f4; }
.tab-btn.active {
  background: white; color: var(--accent); border-bottom: 2px solid transparent; position: relative;
}
.tab-btn.active::after {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--accent);
}

.tab-content-box { padding: 32px; min-height: 300px; }
.tab-pane { display: none; }
.tab-pane.active { display: block; animation: fadeIn 0.3s; }
.tab-pane h3 { font-size: 20px; color: var(--text-primary); margin-bottom: 12px; }
.desc { color: var(--text-secondary); font-size: 15px; margin-bottom: 20px; }

.btn-demo-trigger {
  display: inline-block;
  padding: 8px 16px;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  background: transparent;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-demo-trigger:hover {
  background: var(--accent);
  color: white;
}

/* === Profile / About Me === */
.profile-header-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  border: 1px solid #e7e5e4;
  overflow: hidden;
  margin-bottom: 30px;
}

/* Banner */
.profile-banner {
  height: 350px; /* Increased Height */
  position: relative;
  background: #e7e5e4;
}
.profile-banner-img {
  width: 100%; height: 100%; object-fit: cover;
}
.banner-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent 40%);
}

/* Profile Content */
.profile-content {
  padding: 0 40px 40px 40px;
  position: relative;
}

.avatar-wrapper {
  width: 140px; height: 140px;
  margin-top: -70px; /* Float Up */
  position: relative;
  z-index: 3;
  margin-bottom: 20px;
}
.profile-avatar {
  width: 100%; height: 100%;
  border-radius: 50%;
  border: 4px solid #ffffff;
  object-fit: cover;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  background: #fff;
}

.identity-text h1 {
  font-size: 28px; font-weight: 800; color: var(--text-primary);
  display: flex; align-items: center; gap: 8px; margin-bottom: 8px;
}
.verify-badge {
  color: #0a66c2; background: rgba(10, 102, 194, 0.1);
  width: 20px; height: 20px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 12px;
}
.headline { font-size: 16px; color: #57534e; margin-bottom: 8px; font-weight: 500; }
.location { font-size: 14px; color: #78716c; }

.profile-actions { display: flex; gap: 12px; margin-top: 24px; flex-wrap: wrap; }

.btn-social {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  transition: all 0.2s ease; cursor: pointer; border: none;
}

.btn-cake { background: #292524; color: #fff; }
.btn-cake:hover { background: #000; transform: translateY(-2px); }

.btn-linkedin { background: #0a66c2; color: #fff; }
.btn-linkedin:hover { background: #004182; transform: translateY(-2px); }

.btn-github { background: #24292f; color: #fff; }
.btn-github:hover { background: #000; transform: translateY(-2px); }


.about-layout {
  display: grid;
  grid-template-columns: 1fr 340px; 
  gap: 30px;
  align-items: start;
}

.about-card {
  background: #ffffff;
  padding: 32px;
  border-radius: 16px;
  border: 1px solid #e7e5e4;
  box-shadow: var(--shadow-sm);
}
.about-title {
  font-size: 20px; font-weight: 700; color: var(--text-primary);
  margin-bottom: 20px; padding-bottom: 12px;
  border-bottom: 1px solid #e7e5e4;
}
.about-text {
  font-size: 15px; line-height: 1.8; color: #44403c; margin-bottom: 16px;
}

.experience-card {
  background: #ffffff;
  padding: 24px;
  border-radius: 16px;
  border: 1px solid #e7e5e4;
  
  position: sticky;
  top: 20px;
  z-index: 10;
  
  box-shadow: var(--shadow-md);
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.experience-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -5px rgba(44, 36, 27, 0.15);
  border-color: var(--accent);
}

.timeline-title {
  font-size: 12px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: #a8a29e;
  margin-bottom: 20px;
}

.timeline-item {
  position: relative;
  padding-left: 24px;
  margin-bottom: 30px;
  border-left: 2px solid #e7e5e4;
}
.timeline-item:last-child { margin-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute; left: -6px; top: 6px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  transition: transform 0.2s;
}
.experience-card:hover .timeline-item::before {
  transform: scale(1.2); /* 懸浮時圓點放大 */
}

.timeline-year { font-size: 12px; font-weight: 600; color: var(--accent); margin-bottom: 4px; }
.timeline-role { font-size: 15px; font-weight: 700; color: var(--text-primary); }
.timeline-company { font-size: 13px; color: #78716c; margin-bottom: 8px; }
.timeline-item ul { padding-left: 16px; margin: 0; }
.timeline-item li { font-size: 13px; color: #57534e; line-height: 1.5; margin-bottom: 4px; }


.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(28, 25, 23, 0.9); 
  z-index: 1000;
  justify-content: center;
  align-items: center;
  padding: 20px;
  animation: fadeIn 0.3s ease;
}

.modal-container {
  background: var(--main-bg);
  width: 100%; max-width: 960px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  display: flex; flex-direction: column;
}

.modal-close {
  position: absolute;
  top: 10px; right: 10px;
  background: rgba(0,0,0,0.5);
  color: white; border: none;
  width: 30px; height: 30px; border-radius: 50%;
  cursor: pointer; z-index: 20;
  font-size: 20px; line-height: 1;
}

.modal-video-wrapper {
  position: relative;
  padding-bottom: 56.25%; /* 16:9 */
  height: 0; background: #000;
}
.modal-video-wrapper iframe {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

.modal-info { padding: 24px; background: white; }
.modal-info h3 { font-size: 20px; margin-bottom: 10px; color: var(--text-primary); }
.modal-info div { color: var(--text-secondary); line-height: 1.6; font-size: 14px; }


@media (max-width: 900px) {
  .about-layout { grid-template-columns: 1fr; }
  .experience-card { position: static; transform: none !important; box-shadow: var(--shadow-md) !important; }
}

@media (max-width: 768px) {

  body {
    height: auto;
    min-height: 100vh;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .app-container {
    flex-direction: column;
    min-height: 100vh;
    height: auto;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
  }

  .sidebar-nav {
    display: block;
    padding: 12px 16px;
    max-height: 260px;
    overflow-y: auto;
  }

  .nav-item {
    font-size: 14px;
    padding: 8px 10px;
  }

  .main-content {
    overflow: visible;
  }

  .content-wrapper {
    padding: 16px 12px 24px;
    overflow-y: visible;
  }

  .top-bar {
    padding: 0 12px;
  }

  .profile-banner {
    height: 220px;
  }

  .profile-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-social {
    justify-content: center;
  }
}



/* Language Helper */
[data-lang="zh"] { display: none; }
body.lang-zh [data-lang="zh"] { display: block; }
body.lang-zh [data-lang="en"] { display: none; }

/* === Gallery & Image Modal Styles === */

/* Solutions 裡面的圖片排列容器 */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr); /* 3欄並排 */
  gap: 16px;
  margin-top: 20px;
}

/* 單張圖片卡片 */
.gallery-item {
  position: relative;
  height: 120px; /* 固定高度讓排列整齊 */
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid #e7e5e4;
  background: #f5f5f4;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

/* 滑鼠移過去放大效果 */
.gallery-item:hover img {
  transform: scale(1.1);
}

/* 圖片上的放大鏡圖示 */
.gallery-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.3);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay span { font-size: 24px; }


.modal-media-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

#modal-iframe, #modal-image {
  display: none;
  max-height: 80vh;
  max-width: 100%;
}

.show-video #modal-iframe {
  display: block;
  width: 100%; height: 100%;
  position: absolute; inset: 0;
}
.show-video .modal-media-wrapper {
  padding-bottom: 56.25%; 
  height: 0;
}

.show-image #modal-image {
  display: block;
  width: auto; height: auto;
}
.show-image .modal-media-wrapper {
  padding-bottom: 0;
  height: auto;
  padding: 20px;
}

@media (max-width: 600px) {
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-item { height: 180px; }
}

.modal-media-wrapper {
  overflow: auto; 
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  transition: all 0.3s ease;
}

.modal-media-wrapper iframe {
  width: 100%;
  height: 100%;
  display: block;
  border: none;
}

.modal-media-wrapper img {
  max-width: 100%;
  max-height: 80vh;
  display: block;
  border: none;
  object-fit: contain; 
}


#modal-image {
  max-width: 100%;
  max-height: 80vh; 
  object-fit: contain;
  cursor: zoom-in;
  transition: transform 0.3s ease;
}

#modal-image.zoomed {
  max-width: none;  
  max-height: none; 
  width: auto;     
  cursor: zoom-out; 
}