/* 履歷來源與應徵方式標籤顏色 */
/* 履歷來源與應徵方式標籤顏色修正版 */
.source-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-right: 6px;
  color: #333;
  background: #f3f6fa;
  border: 1px solid #e0e3e8;
  box-shadow: none;
  cursor: default;
}
.source-104 {
  background: #e3f2fd !important;
  color: #1976d2;
}
.source-1111 {
  background: #ffebee !important;
  color: #d32f2f;
}
.source-other {
  background: #f5f5f5 !important;
  color: #757575;
}
.applytype-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 500;
  margin-right: 6px;
  color: #333;
  background: #f3f6fa;
  border: 1px solid #e0e3e8;
  box-shadow: none;
  cursor: default;
}
.applytype-active {
  background: #e8f5e9 !important;
  color: #388e3c;
}
.applytype-match {
  background: #fffde7 !important;
  color: #c09220;
}
.applytype-other {
  background: #f5f5f5 !important;
  color: #757575;
}
/* 通用樣式 */
.hidden {
  display: none !important;
}

.page {
  min-height: 100vh;
}

.customTags-container {
  margin-top: 10px;
}

.custom-tag-checkbox {
  margin-right: 1px;
}

#custom-tag-manager-modal .modal-content.medium {
  max-width: 420px;
  min-width: 320px;
  background: #fff;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.12), 0 0 0 1px #e9e8f7;
  border-radius: 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}
#custom-tag-manager-modal .modal-header {
  padding: 20px 28px 12px 28px;
  border-bottom: 1px solid #f3f3f3;
  background: #f8f9fa;
  border-radius: 16px 16px 0 0;
}
#custom-tag-manager-modal .modal-body {
  padding: 18px 28px 8px 28px;
  background: #fff;
}
#custom-tag-manager-modal .modal-footer {
  padding: 16px 28px;
  border-top: 1px solid #f3f3f3;
  background: #f8f9fa;
  border-radius: 0 0 16px 16px;
}
#custom-tag-manager-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 0;
  margin-bottom: 10px;
  justify-content: flex-start;
}
#custom-tag-manager-list label {
  background: #f8f9fa;
  border-radius: 10px;
  padding: 6px 12px 6px 8px;
  margin: 0 8px 8px 0;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.04);
  display: flex;
  align-items: center;
  min-width: 120px;
}
#custom-tag-manager-list input[type="checkbox"] {
  margin-right: 6px;
  accent-color: #7c3aed;
}
#new-custom-tag-input {
  margin-right: 8px;
}
.btn-xs.btn-danger {
  margin-left: 6px;
  padding: 2px 10px;
  font-size: 13px;
  border-radius: 6px;
}
#custom-tag-manager-modal .btn-primary {
  min-width: 80px;
}
#custom-tag-manager-modal .btn-outline {
  min-width: 80px;
}
/* 客製化標籤管理 modal 預設隱藏 */
#custom-tag-manager-modal {
  display: none;
}
#custom-tag-manager-modal:not(.hidden) {
  display: flex;
}
/* 標籤管理 modal 相關樣式 */
#custom-tag-manager-list {
  margin-bottom: 10px;
}
#custom-tag-manager-list label {
  cursor: pointer;
  user-select: none;
  font-size: 15px;
}
.btn-xs.btn-danger {
  background: #f87171;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  padding: 2px 8px;
  margin-left: 2px;
  cursor: pointer;
  vertical-align: middle;
}
.btn-xs.btn-danger:hover {
  background: #dc2626;
}
#custom-tag-manager-modal .modal-content.medium {
  max-width: 400px;
}
/* 客製化標籤樣式 */
.custom-tag {
  display: inline-block;
  background: #f3e8ff;
  color: #7c3aed;
  border-radius: 12px;
  padding: 2px 10px;
  margin: 0 4px 4px 0;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid #e9d5ff;
  vertical-align: middle;
}

.custom-tags-panel {
  margin: 8px 0 0 0;
}
.user-custom-tags {
  margin-bottom: 4px;
}
/* 基礎樣式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f7fa;
}

#app {
  scrollbar-gutter: both-edges;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* 按鈕樣式 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 44px;
}

/* AI搜尋按鈕特殊樣式 */
.btn-ai-search {
  background: linear-gradient(
    135deg,
    #ff6b6b,
    #ffd93d,
    #6bcf7f,
    #4ecdc4,
    #45b7d1
  );
  background-size: 300% 300%;
  color: white;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
  animation: gradientShift 3s ease infinite;
  position: relative;
  overflow: hidden;
}

.btn-ai-search:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
  animation-duration: 1.5s;
}

.btn-ai-search:active {
  transform: translateY(0);
}

/* 漸變動畫 */
@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

/* 添加閃光效果 */
.btn-ai-search::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.3),
    transparent
  );
  transition: left 0.5s;
}

.btn-ai-search:hover::before {
  left: 100%;
}

.btn-primary {
  background: #4285f4;
  color: white;
}

.btn-primary:hover {
  background: #3367d6;
  transform: translateY(-1px);
}

.btn-secondary {
  background: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background: #5a6268;
}

.btn-outline {
  background: transparent;
  color: #4285f4;
  border: 2px solid #4285f4;
}

.btn-outline:hover {
  background: #4285f4;
  color: white;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* 表單樣式 */
.form-select {
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  min-width: 120px;
}

.form-select:focus {
  outline: none;
  border-color: #4285f4;
}

/* 載入中狀態 */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.9);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4285f4;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 16px;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 登入頁面 */
#login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.login-card {
  background: white;
  padding: 48px;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
  text-align: center;
  max-width: 400px;
  width: 100%;
}

.login-card h1 {
  font-size: 32px;
  margin-bottom: 8px;
  color: #333;
}

.subtitle {
  font-size: 18px;
  color: #666;
  margin-bottom: 24px;
  font-weight: 500;
}

.description {
  color: #888;
  margin-bottom: 32px;
  line-height: 1.5;
}

/* 登入信息區域 */
.login-info {
  margin: 24px 0;
  padding: 0;
}

.system-info {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  text-align: left;
}

.system-info h3 {
  color: #495057;
  margin-bottom: 12px;
  font-size: 16px;
  font-weight: 600;
}

.system-info p {
  color: #6c757d;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.4;
}

.system-info strong {
  color: #4285f4;
  font-weight: 600;
}

.system-info small {
  color: #868e96;
  font-size: 12px;
  display: block;
  margin-top: 8px;
  font-style: italic;
}

/* 導航欄 */
.navbar {
  background: white;
  border-bottom: 1px solid #e1e8ed;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand h2 {
  color: #4285f4;
  font-size: 24px;
}

.nav-actions {
  display: flex;
  gap: 12px;
}

/* 主要內容 */
.main-content {
  padding: 32px 0;
}

.page-header {
  margin-bottom: 32px;
  text-align: center;
}

.page-header h1 {
  font-size: 32px;
  margin-bottom: 8px;
  color: #333;
}

.page-description {
  color: #666;
  font-size: 16px;
}

/* 控制面板 */
.control-panel {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.filters {
  display: flex;
  gap: 12px;
  align-items: center;
}

.stats {
  color: #666;
  font-size: 14px;
}

.stat-item {
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
}

/* 郵件容器 */
.emails-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

.empty-state {
  padding: 64px;
  text-align: center;
  color: #666;
  font-size: 16px;
}

/* 郵件項目 */
.email-item {
  border-bottom: 1px solid #f0f0f0;
  padding: 24px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.email-item:hover {
  background-color: #f8f9fa;
}

.email-item:last-child {
  border-bottom: none;
}

.email-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
}

.email-title-info {
  flex: 1;
  min-width: 0;
}

.email-title {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 8px;
  line-height: 1.4;
}

.email-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 14px;
  color: #666;
}

.email-meta-item {
  background: #e8f0fe;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.email-preview {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
  margin-top: 12px;
}

.email-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.btn-small,
.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  min-height: 32px;
}

/* 模態框 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
}

.modal-content {
  background: white;
  border-radius: 12px;
  width: 90%;
  max-width: 800px;
  height: 80%;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1001;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid #e1e8ed;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  font-size: 18px;
  color: #333;
  margin: 0;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  color: #333;
}

.modal-body {
  flex: 1;
  padding: 0;
  overflow: hidden;
}

.modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
}

.email-iframe {
  width: 100%;
  height: 500px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: white;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid #e1e8ed;
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* 提示訊息 */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 16px 20px;
  border-radius: 8px;
  color: white;
  font-weight: 500;
  z-index: 2000;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 400px;
  animation: slideIn 0.3s ease;
}

.toast.error {
  background: #dc3545;
}

.toast.success {
  background: #28a745;
}

.toast button {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 標籤頁樣式 */
.nav-menu {
  display: flex;
  gap: 8px;
}

.nav-tab {
  background: transparent;
  border: none;
  padding: 12px 20px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  color: #666;
  font-weight: 500;
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
}

.nav-tab:hover {
  background: #f8f9fa;
  color: #333;
}

.nav-tab.active {
  background: #4285f4;
  color: white;
  border-bottom-color: #3367d6;
}

.tab-content {
  display: block;
}

.tab-content.hidden {
  display: none;
}

/* 表單輸入樣式 */
.form-input {
  padding: 8px 12px;
  border: 2px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
  background: white;
  min-width: 120px;
}

.form-input:focus {
  outline: none;
  border-color: #4285f4;
}

/* 搜尋面板 */
.search-panel {
  background: white;
  padding: 24px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 24px;
}

.search-filters {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-group label {
  font-weight: 500;
  color: #333;
  min-width: 80px;
}

.filter-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* 履歷容器 */
.resumes-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
}

/* 履歷項目 */
.resume-item {
  border-bottom: 1px solid #f0f0f0;
  padding: 15px 24px;
  transition: background-color 0.2s ease;
  cursor: pointer;
}

.resume-item:hover {
  background-color: #f8f9fa;
}

.resume-item:last-child {
  border-bottom: none;
}

.resume-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
}

.resume-info {
  flex: 1;
  min-width: 0;
}

.resume-name {
  font-size: 18px;
  font-weight: 600;
  color: #333;
  margin-bottom: 4px;
}

.resume-position {
  font-size: 16px;
  color: #4285f4;
  margin-bottom: 8px;
}

.resume-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
}

.resume-meta-item {
  background: #e8f0fe;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
}

.resume-preview {
  color: #666;
  font-size: 14px;
  line-height: 1.5;
}

/* 備註樣式 - 讓備註更加明顯 */
.resume-notes {
  margin-top: 12px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 6px;
  border-left: 4px solid #007bff;
  font-size: 14px;
  line-height: 1.5;
  color: #495057;
}

.resume-notes strong {
  color: #007bff;
  font-weight: 600;
}

.resume-actions {
  display: flex;
  gap: 8px;
}

.resume-status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}

.status-badge {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  transition: all 0.3s ease;
  animation: statusUpdate 0.5s ease-in-out;
}

@keyframes statusUpdate {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

.status-badge.hidden {
  background: #dc3545;
  color: white;
  border: 1px solid #c82333;
}

.status-badge.active {
  background: #28a745;
  color: white;
  border: 1px solid #218838;
}

.status-badge.uncategorized {
  background: #ffc107;
  color: #333;
  border: 1px solid #e0a800;
}

.status-badge:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 履歷詳細資料模態框 */
.modal-content.large {
  width: 95%;
  max-width: 1000px;
  height: 85%;
}

/* 郵件內容模態框 */
.modal-content.email-modal {
  width: 95%;
  max-width: 1200px;
  height: 90%;
}

.email-content-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background: white;
  overflow: auto;
}

.email-content-iframe-inline {
  width: 100%;
  height: 400px;
  border: 1px solid #ddd;
  border-radius: 6px;
  background: white;
  overflow: auto;
}

.resume-details {
  padding: 20px;
  height: 100%;
  overflow-y: auto;
}

.detail-section {
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid #e1e8ed;
  border-radius: 8px;
}

.detail-section h4 {
  color: #333;
  margin-bottom: 12px;
  font-size: 16px;
  border-bottom: 2px solid #4285f4;
  padding-bottom: 8px;
}

.detail-row {
  display: flex;
  margin-bottom: 12px;
  align-items: flex-start;
  gap: 12px;
}

.detail-label {
  font-weight: 500;
  color: #555;
  min-width: 120px;
  flex-shrink: 0;
}

.detail-value {
  color: #333;
  flex: 1;
}

.detail-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.detail-textarea {
  width: 100%;
  min-height: 100px;
  padding: 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  resize: vertical;
  font-family: inherit;
}

.email-content-display {
  background: #f8f9fa;
  padding: 16px;
  border-radius: 6px;
  border-left: 4px solid #4285f4;
  white-space: pre-wrap;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 13px;
  max-height: 300px;
  overflow-y: auto;
}

.email-content-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

/* 分頁控制 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 24px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#page-info {
  color: #666;
  font-size: 14px;
  min-width: 120px;
  text-align: center;
}

/* 處理狀態指示器 */
.processing-indicator {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #fff3cd;
  border: 1px solid #ffeaa7;
  border-radius: 6px;
  color: #856404;
  font-size: 14px;
}

.processing-indicator .spinner {
  width: 16px;
  height: 16px;
  border: 2px solid #856404;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .login-card {
    padding: 32px 24px;
    margin: 16px;
  }

  .nav-container {
    padding: 0 16px;
  }

  .nav-actions {
    flex-direction: column;
    gap: 8px;
  }

  .main-content {
    padding: 20px 0;
  }

  .control-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .filters {
    justify-content: center;
  }

  .email-header {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .email-meta {
    justify-content: flex-start;
  }

  .modal-content {
    width: 95%;
    height: 90%;
    margin: 16px;
  }

  .modal-header {
    padding: 16px;
  }

  .modal-footer {
    padding: 12px 16px;
    flex-direction: column;
    gap: 8px;
  }

  .btn {
    width: 100%;
    justify-content: center;
  }

  .nav-menu {
    order: -1;
    width: 100%;
    margin-bottom: 12px;
  }

  .nav-container {
    flex-direction: column;
    align-items: stretch;
  }

  .nav-actions {
    justify-content: center;
  }

  .search-filters {
    align-items: stretch;
  }

  .filter-group {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group label {
    min-width: auto;
  }

  .filter-actions {
    justify-content: stretch;
  }

  .filter-actions .btn {
    flex: 1;
  }

  .resume-header {
    flex-direction: column;
    align-items: stretch;
  }

  .resume-status {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  .modal-content.large {
    width: 98%;
    height: 95%;
    margin: 1%;
  }

  .modal-content.email-modal {
    width: 98%;
    height: 95%;
    margin: 1%;
  }

  .detail-row {
    flex-direction: column;
  }

  .detail-label {
    min-width: auto;
    margin-bottom: 4px;
  }
}

/* 同步面板樣式 */
.sync-panel {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #e9ecef;
}

.sync-status-container {
  flex: 1;
}

.sync-status {
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.sync-status.loading {
  color: #007bff;
}

.sync-status.success {
  color: #28a745;
}

.sync-status.error {
  color: #dc3545;
}

.sync-info {
  display: flex;
  gap: 1rem;
  font-size: 0.875rem;
  color: #6c757d;
}

.sync-info span {
  padding: 0.25rem 0.5rem;
  background: white;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.sync-actions {
  display: flex;
  gap: 0.5rem;
}

/* 隱藏履歷管理樣式 */
.hidden-resume {
  opacity: 0.8;
  border-left: 4px solid #ffc107;
  background: linear-gradient(135deg, #fff9e6 0%, #ffffff 100%);
  padding: 16px !important; /* 減少內邊距 */
  margin-bottom: 8px !important; /* 減少卡片間距 */
}

.hidden-resume .resume-header {
  position: relative;
  margin-bottom: 8px; /* 減少header底部間距 */
}

.hidden-resume .resume-info {
  margin-bottom: 6px; /* 減少info區域底部間距 */
}

.hidden-resume .resume-meta {
  margin-bottom: 8px !important; /* 減少meta區域底部間距 */
  line-height: 1.5; /* 適中的行高 */
}

.hidden-resume .meta-item {
  margin-bottom: 3px; /* 減少meta項目垂直間距 */
  padding: 3px 8px; /* 減少meta項目內邊距 */
}

.hidden-resume .resume-notes {
  margin-top: 8px;
  padding: 8px 12px;
  background: rgba(255, 193, 7, 0.1);
  border-radius: 6px;
  border-left: 3px solid #ffc107;
  font-size: 14px;
  line-height: 1.4;
}

.hidden-resume .resume-actions {
  margin-top: 12px; /* 減少按鈕區域頂部間距 */
  display: flex;
  gap: 8px; /* 減少按鈕之間的間距 */
}

.hidden-resume .resume-header::before {
  content: "🙈";
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 20px;
  background: #ffc107;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hidden-resume:hover {
  opacity: 1;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* 隱藏履歷空狀態樣式 */
#hidden-resumes-container .empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

#hidden-resumes-container .empty-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

#hidden-resumes-container .empty-hint {
  font-size: 0.9rem;
  color: #adb5bd;
  margin-top: 0.5rem;
  line-height: 1.4;
}

/* 恢復按鈕特殊樣式 */
.btn-success {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  font-weight: 600;
}

.btn-success:hover {
  background: linear-gradient(135deg, #218838 0%, #1aa179 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* 標籤頁切換動畫 */
.tab-content {
  animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 類別輸入組樣式 */
.category-input-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.category-input-group .detail-input {
  flex: 1;
  min-width: 150px;
}

.category-input-group .btn {
  padding: 8px 16px;
  min-height: auto;
  font-size: 13px;
}

/* AI 搜尋模態框樣式 */
.ai-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100dvw;
  height: 100dvh;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: aiModalFadeIn 0.3s ease-out;
}

.ai-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.ai-modal-content {
  position: relative;
  background: transparent;
  border-radius: 0;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: visible;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: modalSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: none;
  z-index: 10001;
}

.ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  border-radius: 24px 24px 0 0;
  padding: 20px 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 0;
}

.ai-modal-header h2 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2, #ff6b6b, #ffd93d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.ai-search-container {
  text-align: center;
  background: white;
  border-radius: 24px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.1);
  position: relative;
}

.ai-search-container h2 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2, #ff6b6b, #ffd93d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 30px 0;
}

.ai-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}

.ai-search-header h2 {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, #667eea, #764ba2, #ff6b6b, #ffd93d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
}

.ai-search-header .modal-close {
  background: none;
  border: none;
  font-size: 24px;
  color: #999;
  cursor: pointer;
  padding: 5px;
  line-height: 1;
  transition: color 0.2s ease;
}

.ai-search-header .modal-close:hover {
  color: #666;
}

.ai-search-textarea {
  width: 100%;
  min-height: 120px;
  padding: 20px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 16px;
  font-size: 16px;
  font-family: inherit;
  line-height: 1.6;
  resize: none;
  outline: none;
  background: rgba(255, 255, 255, 0.9);
  position: relative;
  z-index: 1;
  transition: all 0.2s ease;
}

.ai-search-textarea:focus {
  border-color: rgba(255, 255, 255, 0.6);
  background: rgba(255, 255, 255, 1);
}

.ai-search-textarea::placeholder {
  color: rgba(102, 126, 234, 0.6);
  font-style: italic;
}

.ai-search-actions {
  margin-top: 30px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn-ai-submit {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: white;
  font-weight: 600;
  padding: 16px 32px;
  font-size: 16px;
  border-radius: 12px;
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.btn-ai-submit:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 35px rgba(102, 126, 234, 0.6);
  background: linear-gradient(135deg, #764ba2, #667eea);
}

.btn-ai-submit::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.4),
    transparent
  );
  transition: left 0.5s;
}

.btn-ai-submit:hover::before {
  left: 100%;
}

.btn-ai-submit:disabled {
  background: linear-gradient(135deg, #cccccc, #999999);
  color: rgba(255, 255, 255, 0.7);
  cursor: not-allowed;
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  opacity: 0.6;
}

.btn-ai-submit:disabled:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, #cccccc, #999999);
}

.btn-ai-submit:disabled::before {
  display: none;
}

/* AI 搜尋載入狀態 */
.ai-search-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 40px;
  min-height: 200px;
}

.ai-search-loading .loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #ff6b6b;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 20px;
}

.ai-search-loading p {
  font-size: 16px;
  color: #666;
  margin: 0;
  font-weight: 500;
}

/* AI 搜尋結果樣式 */
.ai-search-results {
  background: #f8f9fa;
  padding: 24px 32px;
  border-radius: 0 0 24px 24px;
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
}

.ai-search-results.hidden {
  display: none !important;
}

.ai-search-results:not(.hidden) {
  display: block !important;
  background: #f8f9fa;
  padding: 24px 32px;
  border-radius: 0 0 24px 24px;
  flex: 1;
  overflow-y: auto;
  max-height: 60vh;
}

.ai-resumes-container {
  max-height: 400px;
  overflow-y: auto;
  padding: 0 20px;
}

/* 調試樣式 - AI 搜尋結果 */
.ai-search-results {
  border: 2px solid #ff0000 !important; /* 紅色邊框用於調試 */
  min-height: 200px !important;
}

.ai-search-results-header {
  background: #e3f2fd !important; /* 淺藍色背景用於調試 */
  padding: 10px !important;
  margin-bottom: 10px !important;
}

.ai-resumes-container {
  background: #f3e5f5 !important; /* 淺紫色背景用於調試 */
  min-height: 100px !important;
  padding: 10px !important;
}

/* 確保搜尋結果項目正確顯示 */
.ai-resumes-container .resume-item {
  cursor: pointer;
  margin-bottom: 12px;
  padding: 16px;
  border: 1px solid #e1e5e9;
  border-radius: 8px;
  background: white !important;
  transition: all 0.2s ease;
}

.ai-resumes-container .resume-item:hover {
  border-color: #007bff;
  box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
  transform: translateY(-1px);
}

/* 調試用：確保模態框內容可見 */
.ai-modal-content {
  position: relative;
  background: transparent;
  border-radius: 0;
  padding: 40px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow: visible;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  animation: modalSlideIn 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  border: none;
  z-index: 10001;
}

.ai-modal-body {
  max-height: 85vh;
  overflow-y: auto;
}

/* 動畫效果 */
@keyframes aiModalFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalSlideIn {
  from {
    transform: translateY(-20px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes silverFlash {
  0% {
    transform: translateY(-50px) scale(0.9);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes colorGlow {
  0% {
    background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0%;
  }
  25% {
    background-position: 100% 0%, 0% 100%, 100% 100%, 0% 0%;
  }
  50% {
    background-position: 100% 100%, 0% 0%, 100% 0%, 0% 100%;
  }
  75% {
    background-position: 0% 100%, 100% 0%, 0% 0%, 100% 100%;
  }
  100% {
    background-position: 0% 0%, 100% 100%, 0% 100%, 100% 0%;
  }
}

@keyframes glowPulse {
  0%,
  100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.2);
  }
}

/* 當模態框打開時，背景內容的顏色變化 */
.ai-modal.active ~ * {
  filter: hue-rotate(30deg) saturate(1.2);
  transition: filter 0.5s ease;
}

/* AI 搜尋結果橫幅樣式 */
.ai-search-result-banner {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 12px;
  margin-bottom: 24px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.ai-banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.ai-banner-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.ai-banner-icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ai-banner-text {
  flex: 1;
  min-width: 0;
}

.ai-banner-text strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.ai-banner-text p {
  margin: 0;
  font-size: 14px;
  opacity: 0.9;
  line-height: 1.4;
}

.ai-banner-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.ai-banner-actions .btn {
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.3);
  font-size: 12px;
  padding: 6px 12px;
  min-height: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.ai-banner-actions .btn:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.ai-banner-actions .btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.5);
}

.ai-banner-actions .btn-outline:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.7);
}

/* 響應式設計 - AI 橫幅 */
@media (max-width: 768px) {
  .ai-banner-content {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .ai-banner-info {
    justify-content: center;
    text-align: center;
  }

  .ai-banner-actions {
    justify-content: center;
  }

  .ai-banner-actions .btn {
    flex: 1;
    min-width: 80px;
  }
}
