/* 車輛銷售共享平台 - 現代UI樣式 */

/* 引入增強UI樣式 */
@import url('enhanced.css');

:root {
  --primary-color: #4a6cf7;
  --secondary-color: #6c757d;
  --success-color: #10b981;
  --warning-color: #f59e0b;
  --danger-color: #ef4444;
  --info-color: #3b82f6;
  --light-color: #f8f9fa;
  --dark-color: #1e293b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Microsoft JhengHei', 'PingFang TC', 'Segoe UI', Arial, sans-serif;
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--gray-100);
}

/* 容器 */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* 頭部 */
header {
  background-color: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--primary-color);
  text-decoration: none;
  display: flex;
  align-items: center;
}

.logo img {
  height: 40px;
  margin-right: 0.5rem;
}

/* 導航 */
nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-left: 1.5rem;
}

nav ul li a {
  text-decoration: none;
  color: var(--gray-700);
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

nav ul li a:hover {
  background-color: var(--gray-100);
  color: var(--primary-color);
}

nav ul li a.active {
  background-color: var(--primary-color);
  color: white;
}

/* 主內容區 */
main {
  padding: 2rem 0;
}

/* 標題 */
h1, h2, h3, h4, h5, h6 {
  margin-bottom: 1rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--gray-900);
}

h1 {
  font-size: 2.25rem;
}

h2 {
  font-size: 1.875rem;
}

h3 {
  font-size: 1.5rem;
}

/* 按鈕 */
.btn {
  display: inline-block;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  user-select: none;
  border: 1px solid transparent;
  padding: 0.5rem 1rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
  cursor: pointer;
  text-decoration: none;
}

.btn:focus, .btn:hover {
  opacity: 0.9;
  text-decoration: none;
}

.btn-primary {
  background-color: var(--primary-color);
  border-color: var(--primary-color);
  color: white;
}

.btn-secondary {
  background-color: var(--secondary-color);
  border-color: var(--secondary-color);
  color: white;
}

.btn-success {
  background-color: var(--success-color);
  border-color: var(--success-color);
  color: white;
}

.btn-danger {
  background-color: var(--danger-color);
  border-color: var(--danger-color);
  color: white;
}

.btn-outline-primary {
  color: var(--primary-color);
  border-color: var(--primary-color);
  background-color: transparent;
}

.btn-outline-primary:hover {
  background-color: var(--primary-color);
  color: white;
}

.btn-small {
  padding: 0.25rem 0.5rem;
  font-size: 0.8125rem;
}

.btn-large {
  padding: 0.75rem 1.5rem;
  font-size: 1.0625rem;
}

.btn + .btn {
  margin-left: 0.5rem;
}

/* 表格 */
.table {
  width: 100%;
  margin-bottom: 1rem;
  background-color: transparent;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 1rem;
  vertical-align: middle;
  border-top: 1px solid var(--gray-200);
}

.table thead th {
  vertical-align: bottom;
  border-bottom: 2px solid var(--gray-200);
  font-weight: 600;
  background-color: var(--gray-50);
  color: var(--gray-700);
  text-align: left;
}

.table tbody + tbody {
  border-top: 2px solid var(--gray-200);
}

.table-hover tbody tr:hover {
  background-color: rgba(0, 0, 0, 0.01);
}

.table-striped tbody tr:nth-of-type(odd) {
  background-color: rgba(0, 0, 0, 0.02);
}

/* 卡片 */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
  background-color: #fff;
  background-clip: border-box;
  border: 1px solid rgba(0, 0, 0, 0.125);
  border-radius: 0.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  overflow: hidden;
  transition: all 0.3s;
}

.card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.card-img-top {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.card-body {
  flex: 1 1 auto;
  padding: 1.25rem;
}

.card-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.card-text {
  margin-bottom: 1rem;
}

/* 車輛列表 */
.vehicle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.vehicle-card {
  transition: all 0.3s;
}

.vehicle-meta {
  color: var(--gray-600);
  font-size: 0.875rem;
  margin-bottom: 0.25rem;
}

.price {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 1.25rem;
  margin: 0.75rem 0;
}

/* 過濾器 */
.filters {
  background-color: white;
  padding: 1.25rem;
  border-radius: 0.5rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.filter-group, .search-box {
  margin-bottom: 0.75rem;
}

/* 表單元素 */
label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
textarea,
select {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--gray-800);
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid var(--gray-300);
  border-radius: 0.375rem;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  color: var(--gray-900);
  background-color: #fff;
  border-color: var(--primary-color);
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(74, 108, 247, 0.25);
}

/* 提示和錯誤 */
.success {
  color: var(--success-color);
  background-color: rgba(16, 185, 129, 0.1);
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--success-color);
}

.error {
  color: var(--danger-color);
  background-color: rgba(239, 68, 68, 0.1);
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--danger-color);
}

.warning {
  color: var(--warning-color);
  background-color: rgba(245, 158, 11, 0.1);
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--warning-color);
}

.info {
  color: var(--info-color);
  background-color: rgba(59, 130, 246, 0.1);
  padding: 1rem;
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  border-left: 4px solid var(--info-color);
}

/* 圖片預覽 */
.image-preview {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.image-item {
  position: relative;
  height: 100px;
  border-radius: 0.375rem;
  overflow: hidden;
}

.image-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.remove-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  background-color: rgba(0, 0, 0, 0.5);
  color: white;
  border: none;
  border-radius: 50%;
  width: 1.5rem;
  height: 1.5rem;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* 車輛詳情頁 */
.vehicle-detail {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .vehicle-detail {
    grid-template-columns: 1fr 1fr;
  }
}

.detail-images {
  display: flex;
  flex-direction: column;
}

.main-image {
  width: 100%;
  height: 300px;
  overflow: hidden;
  border-radius: 0.5rem;
  margin-bottom: 1rem;
}

.main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumbnails {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
}

.thumbnail {
  width: 100%;
  height: 60px;
  border-radius: 0.25rem;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.7;
  transition: all 0.2s;
}

.thumbnail:hover, .thumbnail.active {
  opacity: 1;
  box-shadow: 0 0 0 2px var(--primary-color);
}

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

@media (min-width: 992px) {
  .detail-info {
    grid-template-columns: 1fr 1fr;
  }
}

/* 管理後台樣式 */
.admin-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 992px) {
  .admin-container {
    grid-template-columns: 250px 1fr;
  }
}

.admin-sidebar {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.admin-sidebar h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--gray-200);
}

.admin-sidebar ul {
  list-style: none;
}

.admin-sidebar li {
  margin-bottom: 0.5rem;
}

.admin-sidebar a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--gray-700);
  border-radius: 0.375rem;
  text-decoration: none;
  transition: all 0.2s;
}

.admin-sidebar a:hover {
  background-color: var(--gray-100);
  color: var(--primary-color);
}

.admin-sidebar a.active {
  background-color: var(--primary-color);
  color: white;
}

.admin-content {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

/* 統計卡片 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background-color: white;
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 150px;
  border-top: 4px solid var(--primary-color);
  transition: all 0.3s;
}

.stat-card:hover {
  transform: translateY(-0.25rem);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
  font-size: 1.125rem;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.stat-value {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

/* 頁腳 */
footer {
  background-color: white;
  padding: 2rem 0;
  border-top: 1px solid var(--gray-200);
  margin-top: 3rem;
}

.footer-content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-logo {
  margin-bottom: 1rem;
}

.footer-logo img {
  height: 40px;
}

.footer-links {
  display: flex;
  margin-bottom: 1rem;
}

.footer-links a {
  color: var(--gray-700);
  text-decoration: none;
  margin: 0 1rem;
}

.footer-links a:hover {
  color: var(--primary-color);
}

.footer-social {
  display: flex;
  margin-bottom: 1rem;
}

.footer-social a {
  color: var(--gray-700);
  background-color: var(--gray-100);
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 0.5rem;
  text-decoration: none;
  transition: all 0.2s;
}

.footer-social a:hover {
  background-color: var(--primary-color);
  color: white;
}

.footer-copy {
  color: var(--gray-600);
  font-size: 0.875rem;
  text-align: center;
}

/* Line Bot相關樣式 */
.line-connect {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  margin: 2rem 0;
  padding: 2rem;
  background-color: #06c755;
  color: white;
  border-radius: 0.5rem;
}

.line-connect-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.line-connect-desc {
  text-align: center;
  margin-bottom: 1.5rem;
  max-width: 600px;
}

.line-connect-btn {
  display: inline-block;
  background-color: white;
  color: #06c755;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.375rem;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  transition: all 0.2s;
}

.line-connect-btn:hover {
  background-color: #f8f9fa;
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1);
}

.line-qrcode {
  margin-top: 1.5rem;
  border: 8px solid white;
  border-radius: 0.5rem;
}

/* 響應式調整 */
@media (max-width: 768px) {
  .header-container {
    flex-direction: column;
    align-items: center;
  }
  
  .logo {
    margin-bottom: 1rem;
  }
  
  nav ul {
    flex-wrap: wrap;
    justify-content: center;
  }
  
  nav ul li {
    margin: 0.25rem 0.5rem;
  }
  
  .btn + .btn {
    margin-left: 0;
    margin-top: 0.5rem;
  }
} 

/* 動畫效果 */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInUp {
  from { transform: translateY(30px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 載入動畫 */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
  vertical-align: middle;
}

/* 懸浮效果 */
.hoverable {
  transition: all 0.3s ease;
}

.hoverable:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* 提示訊息樣式 */
.notification {
  animation: slideInRight 0.3s ease forwards;
}

/* 頁面過渡效果 */
.page-transition {
  animation: fadeIn 0.6s ease;
}

/* 卡片動畫 */
.card {
  transition: all 0.3s ease;
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* 按鈕動畫 */
.btn {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn:after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 5px;
  height: 5px;
  background: rgba(255, 255, 255, 0.5);
  opacity: 0;
  border-radius: 100%;
  transform: scale(1, 1) translate(-50%, -50%);
  transform-origin: 50% 50%;
}

.btn:hover {
  transform: translateY(-3px);
}

.btn:focus:not(:active)::after {
  animation: ripple 1s ease-out;
}

@keyframes ripple {
  0% {
    transform: scale(0, 0);
    opacity: 0.5;
  }
  20% {
    transform: scale(25, 25);
    opacity: 0.3;
  }
  100% {
    opacity: 0;
    transform: scale(40, 40);
  }
}

/* 滾動到頂部按鈕樣式 */
.scroll-top-btn {
  transition: all 0.3s ease;
}

.scroll-top-btn:hover {
  transform: translateY(-5px);
  opacity: 1 !important;
}

/* 車輛卡片懸停效果 */
.vehicle-card {
  transition: all 0.3s ease;
}

.vehicle-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.vehicle-card:hover .card-img-top {
  transform: scale(1.05);
}

.card-img-top {
  transition: transform 0.5s ease;
}

/* LINE 綁定區塊動畫 */
.line-connect {
  position: relative;
  overflow: hidden;
}

.line-connect:before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.3) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(30deg);
  animation: shineEffect 6s infinite linear;
}

@keyframes shineEffect {
  0% { transform: translateX(-100%) rotate(30deg); }
  100% { transform: translateX(100%) rotate(30deg); }
}

/* 管理後台動畫 */
.admin-sidebar a {
  transition: all 0.3s ease;
}

.admin-sidebar a:hover {
  transform: translateX(5px);
}

/* 統計卡片動畫 */
.stat-card {
  transition: all 0.3s ease;
  overflow: hidden;
  position: relative;
}

.stat-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.stat-card:hover:after {
  opacity: 1;
}

.stat-card:after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    to bottom right,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.1) 100%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}

.stat-value {
  transition: all 0.3s ease;
}

.stat-card:hover .stat-value {
  transform: scale(1.1);
  color: var(--primary-color);
}

/* 表單元素動畫 */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  transform: translateY(-2px);
}

/* 頁面加載淡入動畫 */
main {
  animation: fadeIn 0.6s ease;
}

/* 表格行動畫 */
.table-hover tbody tr {
  transition: all 0.3s ease;
}

.table-hover tbody tr:hover {
  transform: translateX(5px);
  background-color: rgba(74, 108, 247, 0.05) !important;
}

/* 圖片項目動畫 */
.image-item {
  transition: all 0.3s ease;
}

.image-item:hover {
  transform: scale(1.05);
  z-index: 2;
}

.remove-btn {
  opacity: 0;
  transition: all 0.3s ease;
}

.image-item:hover .remove-btn {
  opacity: 1;
}

/* 導航欄固定 */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

.header-scrolled {
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* 使選單項目有過渡效果 */
nav ul li a {
  position: relative;
  transition: all 0.3s ease;
}

nav ul li a:before {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

nav ul li a:hover:before {
  width: 70%;
}

nav ul li a.active:before {
  width: 70%;
  background-color: white;
}

/* 添加分頁導航動畫 */
.pagination a {
  transition: all 0.3s ease;
}

.pagination a:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}