* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f5f5f5;
}

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navbar */
.navbar {
  background-color: #2c3e50;
  color: white;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.navbar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap; /* Allow wrapping for collapsed menu */
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
}

/* Nav styles are now handled by Bootstrap classes */
.nav-menu a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s;
}

/* Dropdown menu styles */
.nav-item {
  position: relative;
  display: inline-block;
}

.dropdown-toggle {
  cursor: pointer;
  display: inline-block;
  padding: 0.5rem 0;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  right: 0;
  background-color: white;
  color: #333;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0;
  margin-top: 0;
  min-width: 120px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.nav-item:hover .dropdown-menu,
.dropdown-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-menu li {
  list-style: none;
}

.dropdown-menu a {
  color: #333;
  padding: 0.5rem 1rem;
  display: block;
  text-decoration: none;
  transition: background-color 0.2s;
}

.dropdown-menu a:hover {
  background-color: #f5f5f5;
  color: #333;
  opacity: 1;
}

/* Filter Summary */
.filter-summary {
  margin-left: 20px;
  font-size: 14px;
  color: #666;
}

.filter-item {
  margin-right: 15px;
  padding: 4px 8px;
  background-color: #e9ecef;
  border-radius: 4px;
  font-weight: normal;
}

.filter-empty {
  color: #999;
  font-style: italic;
}

.nav-menu a:hover {
  opacity: 0.8;
}

/* Main Content */
.main-content {
  min-height: calc(100vh - 200px);
  padding: 2rem 0;
}

/* Alerts */
.alert {
  padding: 1rem;
  margin-bottom: 1rem;
  border-radius: 4px;
}

.alert-success {
  background-color: #d4edda;
  border: 1px solid #c3e6cb;
  color: #155724;
}

.alert-error {
  background-color: #f8d7da;
  border: 1px solid #f5c6cb;
  color: #721c24;
}

/* Custom Modal Styles (for Delete Confirmation) */
.custom-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.4);
}

.custom-modal-content {
  background-color: #fefefe;
  margin: 15% auto;
  padding: 20px;
  border: 1px solid #888;
  width: 80%;
  max-width: 400px;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.custom-modal-content h3 {
  margin-top: 0;
  color: #333;
}

.custom-modal-content p {
  margin-bottom: 15px;
  color: #666;
}

.custom-modal-content input[type="password"] {
  width: 100%;
  padding: 10px;
  margin-bottom: 20px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

.modal-buttons {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* Button Styles */
.btn {
  padding: 8px 16px;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
  display: inline-block;
  transition: background-color 0.3s;
}

.btn-primary {
  background-color: #007bff;
  color: white;
}

.btn-primary:hover {
  background-color: #0056b3;
}

.btn-secondary {
  background-color: #6c757d;
  color: white;
}

.btn-secondary:hover {
  background-color: #545b62;
}

.btn-danger {
  background-color: #dc3545;
  color: white;
}

.btn-danger:hover {
  background-color: #c82333;
}

.btn-small {
  padding: 4px 8px;
  font-size: 12px;
}

.btn-delete {
  background-color: #dc3545;
  color: white;
}

.btn-delete:hover {
  background-color: #c82333;
}

/* Welcome Section */
.welcome-section {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.welcome-section h2 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.feature-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}

.card {
  background: #f8f9fa;
  padding: 1.5rem;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card h3 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.card p {
  margin-bottom: 1rem;
  color: #666;
}

/* Info Section */
.info-section {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.info-section h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.info-section ul {
  list-style-position: inside;
  color: #666;
}

.info-section li {
  margin-bottom: 0.5rem;
}

/* Upload Section */
.upload-section {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.upload-section h2 {
  margin-bottom: 0.5rem;
  color: #2c3e50;
}

.upload-section p {
  margin-bottom: 1.5rem;
  color: #666;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: flex-start;
}

.drop-area {
  width: 100%;
  min-height: 150px;
  border: 2px dashed #bdc3c7;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background-color: #f8f9fa;
  transition: all 0.3s ease;
  cursor: pointer;
}

.drop-area.highlight {
  border-color: #3498db;
  background-color: #e3f2fd;
  transform: scale(1.02);
}

.drop-area-content {
  text-align: center;
  color: #666;
}

.drop-area-content p {
  margin: 0.5rem 0;
}

.file-input-wrapper {

  position: relative;
  display: inline-block;
  margin: 1rem 0;
  width: 100%;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.file-label {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #ecf0f1;
  border: 2px dashed #bdc3c7;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.file-label:hover {
  background-color: #e0e6e8;
  border-color: #95a5a6;
}

.file-name {
  font-size: 0.9rem;
  color: #3498db;
  font-weight: 500;
  margin-top: 1rem;
}

.btn:disabled {
  background-color: #95a5a6;
  cursor: not-allowed;
  opacity: 0.7;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  background-color: #3498db;
  color: white;
  text-decoration: none;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background-color 0.3s;
  font-size: 1rem;
}

.btn:hover {
  background-color: #2980b9;
}

.btn-primary {
  background-color: #3498db;
}

.btn-primary:hover {
  background-color: #2980b9;
}

.btn-small {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
}

/* Data Filter Dropdown */
.data-filter {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  background-color: white;
  cursor: pointer;
  margin-right: 1rem;
  transition: border-color 0.3s;
}

.data-filter:hover {
  border-color: #3498db;
}

.stats-container {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background-color: #f8f9fa;
  border-radius: 8px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
}

.stat-label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.stat-value {
  font-size: 24px;
  font-weight: bold;
  color: #333;
}

/* Batch List */
.batch-list {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.batch-list h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

/* Data Table */
.data-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

.data-table thead {
  background-color: #34495e;
  color: white;
}

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #ecf0f1;
}

.data-table tbody tr:hover {
  background-color: #f8f9fa;
}

.empty-message {
  text-align: center;
  color: #999;
  padding: 2rem;
}

/* Dashboard */
.dashboard h2 {
  margin-bottom: 2rem;
  color: #2c3e50;
}

.stats-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.stat-card h3 {
  margin-bottom: 1rem;
  color: #666;
  font-size: 1rem;
  font-weight: normal;
}

.stat-number {
  font-size: 2.5rem;
  font-weight: bold;
  color: #3498db;
  margin-bottom: 0.5rem;
}

.stat-today {
  font-size: 1rem;
  color: #27ae60;
  font-weight: 500;
}

/* Export Section */
.export-section {
  background: white;
  padding: 2rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.export-section h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.batch-selection {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  max-height: 300px;
  overflow-y: auto;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Footer */
footer {
  background-color: #2c3e50;
  color: white;
  text-align: center;
  padding: 1.5rem 0;
  margin-top: 3rem;
}

/* Notification Component */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    z-index: 10000;
    animation: slideIn 0.3s ease-out, fadeOut 0.5s ease-in 2.5s forwards;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.notification.success {
    background-color: #4CAF50;
}

.notification.error {
    background-color: #f44336;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
        visibility: hidden;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
  .upload-form {
    flex-direction: column;
  }

  .feature-cards {
    grid-template-columns: 1fr;
  }
}

/* Adding review page styles */
.btn-review {
  background-color: #9b59b6;
  margin-left: 0.5rem;
}

.btn-review:hover {
  background-color: #8e44ad;
}

.review-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.review-header h2 {
  margin: 0;
  color: #2c3e50;
}

.review-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.review-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #666;
}

/* Pagination Styles */
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.pagination-info {
    font-size: 14px;
    color: #666;
}

.pagination-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-page {
    font-size: 14px;
    color: #333;
    font-weight: 600;
}

.btn-small:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.column-selector {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.column-selector h4 {
  margin-bottom: 1rem;
  color: #2c3e50;
}

.column-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.column-list label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  color: #666;
  padding: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.column-list label:hover {
  background-color: #f8f9fa;
}

.review-table-container {
  background: white;
  padding: 1rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  overflow-x: auto;
}

.review-table {
  min-width: 100%;
  white-space: nowrap;
}

.review-table th {
  position: sticky;
  top: 0;
  background-color: #34495e;
  color: white;
  font-weight: 600;
  z-index: 10;
}

.review-table td {
  padding: 0;
  vertical-align: top;
  height: 100%;
  min-height: 80px;
}

.review-input,
.review-textarea,
.review-select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  min-height: 60px;
  height: 100%;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
  overflow-y: auto;
  vertical-align: top;
  box-sizing: border-box;
}

.review-input:focus,
.review-textarea:focus,
.review-select:focus {
  outline: none;
  border-color: #3498db;
  box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.review-textarea {
  resize: vertical;
}

.review-select {
  cursor: pointer;
  background-color: white;
}

.readonly-cell {
  background-color: #f8f9fa;
  color: #333;
  padding: 0.75rem !important;
  max-width: 200px;
  white-space: normal;
  word-wrap: break-word;
}

.review-row {
  transition: background-color 0.3s;
}
.review-row td input,
.review-row td textarea,
.review-row td select {
  background-color: #00000000;
}
.valid-row {
  background-color: #d4edda !important;
}

.valid-row:hover {
  background-color: #c3e6cb !important;
}

.invalid-row {
  background-color: #f8d7da !important;
}

.invalid-row:hover {
  background-color: #f5c6cb !important;
}

.review-row:hover {
  background-color: #f8f9fa;
}

/* Review table responsive adjustments */
@media (max-width: 1024px) {
  .review-table-container {
    overflow-x: scroll;
  }

  .review-input,
  .review-textarea,
  .review-select {
    min-width: 150px;
  }
}

/* Narrow review fields */
.review-table th.review-field {
  max-width: 120px;
  white-space: normal;
  word-wrap: break-word;
}

.review-table td.review-field {
  max-width: 120px;
  white-space: normal;
  word-wrap: break-word;
}

.review-table td[data-field="有效数据"],
.review-table th[data-field="有效数据"] {
  max-width: 80px;
}

.review-table td[data-field="备注"],
.review-table th[data-field="备注"] {
  max-width: 200px;
}

.review-table td[data-field="意向程度"],
.review-table th[data-field="意向程度"] {
  max-width: 100px;
}

.review-table td[data-field="留资情况"],
  .review-table th[data-field="留资情况"] {
    max-width: 100px;
  }

/* Add styles for wider review table and column sections */
.review-table-wide {
  min-width: 2000px;
}

.review-table-wide th,
.review-table-wide td {
  min-width: 120px;
  max-width: 300px;
}

.review-table-wide .readonly-cell {
  background-color: #f8f9fa;
  min-width: 150px;
}

.column-section {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background-color: #f8f9fa;
  border-radius: 4px;
}

.column-section strong {
  display: block;
  margin-bottom: 0.75rem;
  color: #2c3e50;
  font-size: 0.95rem;
}

.column-section label {
  display: block;
  margin-bottom: 0.5rem;
}

.export-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

/* Style for valid data export button */
.btn-primary[style*="background-color: #27ae60"] {
  transition: background-color 0.3s;
}

.btn-primary[style*="background-color: #27ae60"]:hover {
  background-color: #229954 !important;
}

/* Table controls section */
.table-controls {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.review-controls {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}

.review-controls label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-right: 1rem;
  font-weight: 500;
}

.review-controls .data-filter {
  padding: 0.5rem 1rem;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 0.9rem;
  background-color: white;
  cursor: pointer;
}

/* Add AI operations section styles */
.ai-operations {
  background: white;
  padding: 1.5rem 2rem;
  border-radius: 8px;
  margin-bottom: 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ai-operations h3 {
  margin-bottom: 1rem;
  color: #2c3e50;
  font-size: 1.1rem;
}

.ai-operations button {
  margin-right: 1rem;
}

.btn-secondary {
  background-color: #95a5a6;
}

.btn-secondary:hover {
  background-color: #7f8c8d;
}

.btn-secondary:disabled {
  background-color: #bdc3c7;
  cursor: not-allowed;
  opacity: 0.6;
}

/* Icon image styles */
.icon-img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 100px;
}

/* Add AI progress overlay styles */
.ai-progress-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.ai-progress-modal {
  background: white;
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  min-width: 400px;
  text-align: center;
}

.ai-progress-modal h3 {
  margin-bottom: 1.5rem;
  color: #2c3e50;
  font-size: 1.3rem;
}

.progress-bar-container {
  width: 100%;
  height: 30px;
  background-color: #ecf0f1;
  border-radius: 15px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #3498db, #2ecc71);
  border-radius: 15px;
  width: 0%;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
}

.progress-text {
  font-size: 1.1rem;
  color: #2c3e50;
  font-weight: 600;
  margin-bottom: 1rem;
}
