/* Sync Page Styling */
.sync-page {
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e9ecef 100%);
  min-height: 100vh;
}

.page-header {
  text-align: center;
  margin-bottom: 40px;
  padding: 20px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.page-title {
  font-size: 32px;
  font-weight: 600;
  color: #1e3a5f;
  margin: 0;
  background: linear-gradient(135deg, #1e3a5f 0%, #4a90e2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Success notification styling */
.notice {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  border: 1px solid #b1dfbb;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  color: #155724;
  font-weight: 500;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Section Headers */
.sync-section {
  margin-bottom: 40px;
}

.sync-section h2 {
  font-size: 24px;
  font-weight: 600;
  color: #1e3a5f;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 2px solid #4a90e2;
  display: inline-block;
}

.sync-section h3 {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin-top: 32px;
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 4px solid #4a90e2;
}

/* Sync Actions Grid */
.sync-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* Sync Action Cards */
.sync-action-card {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  border: 1px solid #e9ecef;
  position: relative;
  overflow: hidden;
}

.sync-action-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #1e3a5f 0%, #4a90e2 50%, #6bb6d6 100%);
}

.sync-action-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

.sync-action-card h3 {
  margin: 0 0 12px 0;
  font-size: 22px;
  color: #1e3a5f;
  font-weight: 600;
  border: none;
  padding: 0;
}

.sync-action-card p {
  margin: 0 0 16px 0;
  font-size: 14px;
  color: #6c757d;
  line-height: 1.6;
}

.last-sync {
  font-size: 13px;
  color: #868e96;
  font-style: italic;
  margin-bottom: 12px;
  padding: 8px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid #4a90e2;
}

/* Button Styling */
.btn {
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
}

.btn-primary {
  background: linear-gradient(135deg, #4a90e2 0%, #6bb6d6 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #3a7bc8 0%, #5aa3c3 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-secondary {
  background: white;
  color: #4a90e2;
  border: 2px solid #4a90e2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.btn-secondary:hover:not(:disabled) {
  background: #f0f7ff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* Button group styling */
.sync-action-card > div[style*="flex"] {
  margin-top: 20px;
}

.sync-action-card > div[style*="flex"] > div[style*="text-align: center"] {
  margin: 12px 0;
  color: #adb5bd;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Sync History Table */
.sync-history-section {
  background: white;
  border-radius: 12px;
  padding: 28px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  margin-top: 40px;
}

.sync-history-section h2 {
  margin-top: 0;
  margin-bottom: 24px;
  color: #1e3a5f;
  font-size: 24px;
  font-weight: 600;
  border-bottom: 2px solid #e9ecef;
  padding-bottom: 12px;
}

.sync-history-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.sync-history-table thead {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

.sync-history-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 600;
  color: #495057;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid #dee2e6;
}

.sync-history-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #f1f3f5;
  font-size: 14px;
  color: #495057;
}

.sync-history-table tbody tr {
  transition: background-color 0.2s ease;
}

.sync-history-table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-badge.completed {
  background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
  color: #155724;
}

.status-badge.failed {
  background: linear-gradient(135deg, #f8d7da 0%, #f5c2c7 100%);
  color: #721c24;
}

.status-badge.running {
  background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
  color: #856404;
}

/* File upload styling */
.file-upload-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
  margin-top: 16px;
}

.file-input {
  position: absolute;
  left: -9999px;
}

.file-label {
  display: block;
  padding: 14px 20px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px dashed #adb5bd;
  border-radius: 8px;
  cursor: pointer;
  text-align: center;
  transition: all 0.3s ease;
  color: #6c757d;
  font-weight: 500;
}

.file-label:hover {
  background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
  border-color: #6c757d;
  transform: translateY(-2px);
}

.file-input:focus + .file-label {
  outline: 3px solid rgba(74, 144, 226, 0.3);
  outline-offset: 2px;
}

.file-label-text {
  color: #6c757d;
}

.file-input:valid + .file-label .file-label-text::after {
  content: " ✓";
  color: #28a745;
  font-weight: bold;
}

/* CSV Preview Modal */
.csv-preview-modal {
  animation: slideIn 0.3s ease;
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  margin-top: 20px;
}

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

.csv-preview-modal table {
  border-collapse: collapse;
  width: 100%;
  margin-top: 16px;
}

.csv-preview-modal table th,
.csv-preview-modal table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid #dee2e6;
}

.csv-preview-modal table th {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  font-weight: 600;
  color: #495057;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Help text styling */
.help-text details summary {
  color: #4a90e2;
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: color 0.2s ease;
}

.help-text details summary:hover {
  color: #3a7bc8;
  text-decoration: underline;
}

.help-text details[open] summary {
  margin-bottom: 12px;
  color: #1e3a5f;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .sync-actions-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  
  .page-title {
    font-size: 24px;
  }
  
  .sync-action-card {
    padding: 20px;
  }
  
  .btn {
    width: 100%;
    margin-bottom: 8px;
  }
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
}

.empty-state-icon {
  font-size: 48px;
  color: #dee2e6;
  margin-bottom: 16px;
}

.empty-state-text {
  font-size: 18px;
  margin-bottom: 8px;
}

.empty-state-subtext {
  font-size: 14px;
  color: #adb5bd;
}