/* 主要樣式 */
:root {
  --primary-color: #1a202c;
  --secondary-color: #718096;
  --accent-color: #4a5568;
  --text-light: #f7fafc;
  --text-dark: #2d3748;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Noto Sans TC', 'Microsoft YaHei', sans-serif;
  color: var(--text-dark);
  line-height: 1.7;
}

/* 首頁樣式 */
main img {
  transition: transform 10s ease;
}

main:hover img {
  transform: scale(1.05);
}

.animate-bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateY(0) translateX(-50%);
  }
  40% {
    transform: translateY(-10px) translateX(-50%);
  }
  60% {
    transform: translateY(-5px) translateX(-50%);
  }
}

/* 互動式菜單樣式 */
.interactive-menu {
  width: 100%;
  height: 80vh;
  max-height: 800px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.menu-item {
  position: absolute;
  cursor: pointer;
  transition: all 0.5s ease;
}

.menu-item svg {
  fill: var(--primary-color);
  transition: all 0.3s ease;
}

.menu-item:hover svg {
  fill: var(--accent-color);
  transform: scale(1.1);
}

.menu-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  text-align: center;
}

/* 作品集過濾按鈕 */
.portfolio-filter.active {
  background-color: var(--primary-color);
  color: white;
}

/* 作品項目卡片 */
.portfolio-item {
  transition: all 0.3s ease;
  overflow: hidden;
}

.portfolio-item:hover {
  transform: translateY(-5px);
}

.portfolio-item img {
  transition: opacity 0.3s ease;
}

.portfolio-item:hover img {
  transform: scale(1.05);
}

/* 項目地圖樣式優化 */
#project-map {
  position: relative;
  height: 720px;
  margin: 0 auto;
  background-color: #f8fafc;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: all 0.4s ease;
}

#project-map:hover {
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
}

.map-point {
  position: absolute;
  width: 12px;
  height: 12px;
  background-color: rgba(30, 64, 175, 0.85);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  cursor: pointer;
  z-index: 10;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.25);
  animation: pulse 2.5s infinite cubic-bezier(0.66, 0, 0.33, 1);
}

.map-point:hover {
  background-color: rgba(30, 64, 175, 1);
  transform: translate(-50%, -50%) scale(1.35);
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.35);
}

.map-point.active {
  background-color: rgba(30, 64, 175, 1);
  transform: translate(-50%, -50%) scale(1.5);
  box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.4);
  animation: none;
}

.map-point-label {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(255, 255, 255, 0.95);
  color: #1e40af;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  opacity: 0;
  transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(226, 232, 240, 0.6);
  pointer-events: none;
}

.map-point:hover .map-point-label,
.map-point.active .map-point-label {
  opacity: 1;
  bottom: 24px;
}

.map-popup {
  position: absolute;
  background-color: rgba(255, 255, 255, 0.98);
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
  width: 280px;
  top: 0;
  left: 0;
  z-index: 20;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.7);
}

.map-popup.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.map-popup-close {
  position: absolute;
  top: 14px;
  right: 16px;
  font-size: 18px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.map-popup-close:hover {
  color: #1e293b;
  transform: rotate(90deg);
}

.map-popup h3 {
  font-size: 18px;
  color: #1e293b;
  margin-bottom: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.map-popup .text-sm {
  color: #64748b;
  font-size: 13px;
  margin-bottom: 14px;
  font-weight: 500;
}

.map-projects-container {
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
  margin-top: 12px;
}

.map-projects-container::-webkit-scrollbar {
  width: 4px;
}

.map-projects-container::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.5);
  border-radius: 10px;
}

.map-projects-container::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.5);
  border-radius: 10px;
}

.map-projects-container::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.6);
}

.map-popup-project {
  margin-top: 10px;
  padding: 12px;
  border-radius: 8px;
  background-color: rgba(248, 250, 252, 0.8);
  transition: all 0.3s ease;
  border: 1px solid rgba(226, 232, 240, 0.5);
}

.map-popup-project:hover {
  background-color: rgba(241, 245, 249, 0.9);
  transform: translateX(5px);
  border-color: rgba(203, 213, 225, 0.8);
}

.map-popup-project:first-child {
  margin-top: 0;
}

.map-popup-project a {
  text-decoration: none;
  display: block;
}

.map-popup-project .text-gray-800 {
  color: #1e293b;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 4px;
}

.map-popup-project .text-gray-500 {
  color: #64748b;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.5);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(37, 99, 235, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
  }
}

/* 項目詳情頁樣式 */
#project-images img {
  transition: transform 0.5s ease;
}

#project-images img:hover {
  transform: scale(1.02);
}

#related-projects a {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#related-projects a:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 聊天介面樣式 */
#chat-messages {
  scrollbar-width: thin;
  scrollbar-color: var(--secondary-color) #f1f1f1;
}

#chat-messages::-webkit-scrollbar {
  width: 8px;
}

#chat-messages::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb {
  background: var(--secondary-color);
  border-radius: 10px;
}

/* 動畫效果 */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulse {
  0% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(0.9);
  }
  50% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(1);
  }
  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.5);
  }
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease forwards;
}

/* 加載時的過渡動畫 */
.page-transition {
  opacity: 0;
  transform: translateY(20px);
}

.page-loaded .page-transition {
  opacity: 1;
  transform: translateY(0);
  transition: all 0.8s ease;
}

/* 響應式調整 */
@media (max-width: 768px) {
  .interactive-menu {
    height: 60vh;
  }
  
  .menu-item svg {
    width: 50px;
    height: 50px;
  }
  
  .map-popup {
    width: 250px;
  }
  
  #project-map {
    height: 560px;
  }
}

/* 首頁背景優化 */
.home-background {
  background-image: url('image/大厅.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: absolute;
  inset: 0;
  z-index: 0;
}

.home-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0.7) 100%);
  z-index: 1;
}

.home-content {
  position: relative;
  z-index: 2;
  margin-bottom: 80px;
  animation: fadeInUp 1.2s ease-out;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 按鈕懸停效果增強 */
.btn-portfolio {
  position: relative;
  overflow: hidden;
  transition: all 0.4s ease;
}

.btn-portfolio:before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.2);
  transition: all 0.4s ease;
}

.btn-portfolio:hover:before {
  left: 100%;
}

/* AI聊天打字动画 */
.typing-animation {
    display: flex;
    align-items: center;
    column-gap: 6px;
}

.typing-animation span {
    height: 8px;
    width: 8px;
    background-color: #6b7280;
    border-radius: 50%;
    animation: bounce 1.5s infinite ease-in-out;
}

.typing-animation span:nth-child(1) {
    animation-delay: 0s;
}

.typing-animation span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-animation span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounce {
    0%, 60%, 100% {
        transform: translateY(0);
    }
    30% {
        transform: translateY(-6px);
    }
}

/* AI聊天页面样式 */
.ai-message, .user-message {
    margin-bottom: 1.5rem;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#chat-messages::-webkit-scrollbar {
    width: 6px;
}

#chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

#chat-messages::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

.portfolio-filter:hover {
    background-color: #dbeafe;
    color: #1e40af;
}

/* 項目輪播圖樣式 */
.slider-prev, .slider-next {
  opacity: 0;
  transition: opacity 0.3s ease, background-color 0.3s ease;
}

.portfolio-item:hover .slider-prev,
.portfolio-item:hover .slider-next {
  opacity: 1;
}

.slider-prev:hover, .slider-next:hover {
  background-color: rgba(255, 255, 255, 0.8);
}

.portfolio-item .relative.h-64 {
  overflow: hidden;
}

.portfolio-item .relative.h-64 img {
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.portfolio-item:hover .relative.h-64 img {
  transform: scale(1.05);
}

/* 導航鏈接樣式 */
.nav-link {
    color: #4b5563;
    font-weight: 500;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #2563eb;
}

/* 首頁背景圖片設定 */
.hero-background {
    background-image: url('image/大厅.jpg');
    background-size: cover;
    background-position: center;
    height: 100vh;
    position: relative;
}

.hero-content {
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
}

/* 作品集過濾按鈕樣式 */
.portfolio-filter {
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.portfolio-filter:hover {
    background-color: #e5e7eb;
}

/* 平滑過渡效果 */
.animate-fadeIn {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 縮放動畫效果 */
.hover-scale:hover img {
    transform: scale(1.05);
    transition: transform 0.6s ease;
}

/* 首頁主內容樣式 */
.main-heading {
    font-size: 2.5rem;
    line-height: 1.2;
    font-weight: 700;
}

@media (min-width: 768px) {
    .main-heading {
        font-size: 3.5rem;
    }
}

.scroll-down {
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-20px);
    }
    60% {
        transform: translateY(-10px);
    }
}

/* 地圖標記樣式 */
.map-point {
    position: absolute;
    width: 16px;
    height: 16px;
    background-color: rgba(37, 99, 235, 0.7);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    cursor: pointer;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.3);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 10;
}

.map-point:hover {
    background-color: rgba(37, 99, 235, 0.9);
    box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.4);
    transform: translate(-50%, -50%) scale(1.1);
}

.map-point.active {
    background-color: rgba(37, 99, 235, 0.9);
    box-shadow: 0 0 0 8px rgba(37, 99, 235, 0.4);
    animation: pulse 1.5s infinite;
}

.map-point::before {
    content: '';
    position: absolute;
    width: 300%;
    height: 300%;
    top: -100%;
    left: -100%;
    background-color: transparent;
    border-radius: 50%;
    z-index: -1;
}

.map-point-label {
    position: absolute;
    white-space: nowrap;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.map-point:hover .map-point-label {
    opacity: 1;
    bottom: 150%;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.6);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(37, 99, 235, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 99, 235, 0);
    }
}

.map-popup {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    width: 250px;
    padding: 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    opacity: 0;
    visibility: hidden;
    transform: scale(0.95);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 20;
}

.map-popup.active {
    opacity: 1;
    visibility: visible;
    transform: scale(1);
}

.map-popup-close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    font-size: 1.25rem;
    color: #4b5563;
    cursor: pointer;
    transition: color 0.2s ease;
}

.map-popup-close:hover {
    color: #ef4444;
}

.map-popup-project {
    padding: 0.75rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.map-popup-project:hover {
    background-color: rgba(243, 244, 246, 0.8);
}

.map-popup-project:last-child {
    margin-bottom: 0;
}

.map-popup-project a {
    text-decoration: none;
    color: inherit;
}

.map-popup-project svg {
    transition: transform 0.2s ease;
}

.map-popup-project:hover svg {
    transform: translateX(3px);
}

/* 陰影效果 */
.shadow-contrast {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05), 0 -10px 15px -3px rgba(255, 255, 255, 0.1), 0 -4px 6px -2px rgba(255, 255, 255, 0.05);
}

/* 聯繫彈窗樣式 */
.contact-popup {
    backdrop-filter: blur(8px);
}

.contact-card {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
}

/* AI聊天相關樣式 */
.message {
    display: flex;
    margin-bottom: 1rem;
}

.user-message {
    justify-content: flex-end;
}

.ai-message {
    justify-content: flex-start;
}

.message-content {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    position: relative;
}

.user-message .message-content {
    border-top-right-radius: 0.25rem;
}

.ai-message .message-content {
    border-top-left-radius: 0.25rem;
}

.thinking .message-content {
    min-width: 60px;
}

.thinking-dots {
    display: flex;
    align-items: center;
    justify-content: center;
}

.thinking-dots span {
    background-color: #6b7280;
    border-radius: 50%;
    display: inline-block;
    width: 8px;
    height: 8px;
    margin: 0 2px;
    opacity: 0.6;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.thinking-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.2);
    }
}

.sample-question {
    position: relative;
    overflow: hidden;
}

.sample-question::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: currentColor;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.sample-question:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* 漸變背景 */
.bg-gradient-custom {
    background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
}

/* 浮動效果 */
.float-animation {
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-20px);
    }
    100% {
        transform: translateY(0px);
    }
} 