/* CV Fixer - Stylesheet */
/* Powered by Paradox Management */

:root {
  --primary: #3f51b5;
  --primary-dark: #1a237e;
  --primary-light: #c5cae9;
  --secondary: #ff6d00;
  --secondary-light: #ffab40;
  --success: #4caf50;
  --error: #f44336;
  --warning: #ff9800;
  --text-primary: #212121;
  --text-secondary: #757575;
  --background: #fafafa;
  --surface: #ffffff;
  --border: #e0e0e0;
  --shadow: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
  --radius: 8px;
  --radius-lg: 12px;
  --font-main: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Noto Sans TC', 'PingFang HK', 'Microsoft JhengHei', sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-main);
  background: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.container-sm {
  max-width: 600px;
}

.container-md {
  max-width: 800px;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white;
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.logo-icon {
  font-size: 28px;
}

.nav {
  display: flex;
  gap: 20px;
  align-items: center;
}

.nav a {
  color: rgba(255,255,255,0.9);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.nav a:hover {
  color: white;
}

.nav-btn {
  background: var(--secondary);
  color: white !important;
  padding: 8px 20px;
  border-radius: var(--radius);
  transition: background 0.2s;
}

.nav-btn:hover {
  background: var(--secondary-light);
}

/* Language Switcher */
.lang-switch {
  display: flex;
  gap: 8px;
  margin-left: 20px;
}

.lang-switch button {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.5);
  color: rgba(255,255,255,0.8);
  padding: 4px 12px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  transition: all 0.2s;
}

.lang-switch button:hover,
.lang-switch button.active {
  background: rgba(255,255,255,0.2);
  border-color: white;
  color: white;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #5c6bc0 100%);
  color: white;
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero h2 {
  font-size: 24px;
  font-weight: 400;
  opacity: 0.9;
  margin-bottom: 24px;
}

.hero p {
  font-size: 18px;
  max-width: 600px;
  margin: 0 auto 40px;
  opacity: 0.9;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}

.btn-primary {
  background: var(--secondary);
  color: white;
  box-shadow: 0 4px 14px rgba(255, 109, 0, 0.4);
}

.btn-primary:hover {
  background: var(--secondary-light);
  transform: translateY(-2px);
}

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-secondary:hover {
  background: var(--primary-light);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-outline:hover {
  background: rgba(255,255,255,0.1);
}

.btn-lg {
  padding: 16px 32px;
  font-size: 18px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Cards */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
}

.card-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.card-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary-dark);
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-primary);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  font-size: 16px;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-textarea {
  min-height: 200px;
  resize: vertical;
}

.form-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.form-error {
  color: var(--error);
  font-size: 13px;
  margin-top: 4px;
}

/* Upload Area */
.upload-area {
  border: 3px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--background);
}

.upload-area:hover,
.upload-area.drag-over {
  border-color: var(--primary);
  background: var(--primary-light);
}

.upload-icon {
  font-size: 64px;
  margin-bottom: 16px;
}

.upload-text {
  font-size: 18px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.upload-hint {
  font-size: 14px;
  color: var(--text-secondary);
}

.upload-input {
  display: none;
}

/* Tabs */
.tabs {
  display: flex;
  border-bottom: 2px solid var(--border);
  margin-bottom: 24px;
}

.tab {
  padding: 12px 24px;
  background: none;
  border: none;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  position: relative;
  transition: color 0.2s;
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  color: var(--primary);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Features Grid */
.features {
  padding: 80px 0;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 32px;
  margin-top: 48px;
}

.feature-card {
  text-align: center;
  padding: 32px;
}

.feature-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.feature-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--primary-dark);
}

.feature-desc {
  color: var(--text-secondary);
}

/* Section Title */
.section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 16px;
}

.section-subtitle {
  text-align: center;
  font-size: 18px;
  color: var(--text-secondary);
}

/* CV List */
.cv-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cv-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

.cv-item-info {
  display: flex;
  align-items: center;
  gap: 16px;
}

.cv-item-icon {
  font-size: 32px;
}

.cv-item-name {
  font-weight: 600;
}

.cv-item-date {
  font-size: 13px;
  color: var(--text-secondary);
}

.cv-item-actions {
  display: flex;
  gap: 8px;
}

/* Status Badge */
.status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
}

.status-completed {
  background: #e8f5e9;
  color: var(--success);
}

.status-processing {
  background: #fff3e0;
  color: var(--warning);
}

.status-failed {
  background: #ffebee;
  color: var(--error);
}

.status-pending {
  background: #e3f2fd;
  color: var(--primary);
}

/* Loading */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  margin-top: 16px;
  color: var(--text-secondary);
}

/* Alert */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.alert-success {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.alert-error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

.alert-warning {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.alert-info {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

/* Footer */
.footer {
  background: var(--primary-dark);
  color: white;
  padding: 40px 0;
  margin-top: 80px;
}

.footer-content {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
}

.footer-brand {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 16px;
}

.footer-desc {
  opacity: 0.8;
  margin-bottom: 16px;
}

.footer-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-links {
  list-style: none;
}

.footer-links li {
  margin-bottom: 8px;
}

.footer-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.2);
  margin-top: 40px;
  padding-top: 20px;
  text-align: center;
  opacity: 0.8;
  font-size: 14px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 32px;
  }

  .hero h2 {
    font-size: 18px;
  }

  .header-content {
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav {
    width: 100%;
    justify-content: center;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .features-grid {
    grid-template-columns: 1fr;
  }
}

/* Admin Table */
.table-container {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.table th {
  background: var(--background);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 13px;
  text-transform: uppercase;
}

.table tr:hover {
  background: var(--background);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  display: none;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-title {
  font-size: 20px;
  font-weight: 600;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-secondary);
}

.modal-body {
  padding: 24px;
}

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
}

.pagination button:hover:not(:disabled) {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination button.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Progress Bar */
.progress {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.3s;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-error { color: var(--error); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }

.hidden { display: none !important; }
