:root {
  --primary-blue: #3095d1;
  --primary-blue-dark: #2980b9;
  --secondary-blue: #5dade2;
  --success-green: #27ae60;
  --error-red: #e74c3c;
  --warning-orange: #f39c12;
  --light-gray: #f8f9fa;
  --medium-gray: #e9ecef;
  --dark-gray: #6c757d;
  --text-dark: #2c3e50;
  --border-color: #dee2e6;
  --shadow: 0 2px 10px rgba(0,0,0,0.1);
  --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--light-gray);
  color: var(--text-dark);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
  padding: 2rem 0;
  text-align: center;
  box-shadow: var(--shadow);
}

.header-content h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.header-content h1 i {
  margin-right: 1rem;
  color: #ffffff;
}

.header-content p {
  font-size: 1.1rem;
  opacity: 0.9;
  font-weight: 300;
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 2rem;
}

/* Card Layout */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}

.card {
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.card-header {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.card-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.card-header h2 i {
  margin-right: 0.5rem;
  color: var(--primary-blue);
}

.card-header p {
  color: var(--dark-gray);
  font-size: 0.9rem;
  margin: 0;
}

.card-body {
  padding: 1.5rem;
}

/* Forms */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
}

.form-input, .form-select {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus, .form-select:focus {
  outline: none;
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(48, 149, 209, 0.1);
}

/* File Input */
.file-input-wrapper {
  position: relative;
  margin-bottom: 1rem;
}

.file-input-wrapper input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-input-label {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border: 2px dashed var(--border-color);
  border-radius: 6px;
  background: var(--light-gray);
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  flex-direction: column;
  gap: 0.5rem;
}

.file-input-label:hover {
  border-color: var(--primary-blue);
  background: rgba(48, 149, 209, 0.05);
}

.file-input-label i {
  font-size: 2rem;
  color: var(--primary-blue);
  margin-bottom: 0.5rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 6px;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 150px;
}

.btn-primary {
  background: var(--primary-blue);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-blue-dark);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--medium-gray);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: var(--dark-gray);
  color: white;
}

.btn-ns-add {
  padding: 0.25rem 0.6rem;
  font-size: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: var(--light-gray);
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-ns-add:hover {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

/* Actions Bar */
.actions-bar {
  text-align: center;
  margin-bottom: 2rem;
}

/* Results Section */
.results-section {
  margin-top: 2rem;
}

.table-container {
  position: relative;
  overflow-x: auto;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 6px;
  overflow: hidden;
}

.results-table th {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
  color: white;
  padding: 1.2rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.95rem;
  white-space: nowrap;
}

.results-table th i {
  margin-right: 0.5rem;
  opacity: 0.8;
}

.results-table td {
  padding: 1.2rem 1rem;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.9rem;
  word-break: break-word;
  vertical-align: top;
}

.results-table td:nth-child(1) { /* Name column */
  min-width: 200px;
  max-width: 300px;
}

.results-table td:nth-child(2) { /* Type column */
  width: 100px;
  text-align: center;
}

.results-table td:nth-child(3), /* Expected column */
.results-table td:nth-child(5) { /* Answer column */
  min-width: 250px;
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
}

.results-table td:nth-child(4) { /* Resolver column */
  width: 130px;
  text-align: center;
  font-family: 'Courier New', monospace;
}

.results-table td:nth-child(6) { /* Status column */
  width: 120px;
  text-align: center;
}

.results-table tbody tr:hover {
  background: rgba(48, 149, 209, 0.05);
}

.status-ok {
  background: rgba(39, 174, 96, 0.1) !important;
  color: var(--success-green);
  font-weight: 600;
}

.status-mismatch {
  background: rgba(231, 76, 60, 0.1) !important;
  color: var(--error-red);
  font-weight: 600;
}

.no-results {
  text-align: center;
  padding: 3rem 2rem;
  color: var(--dark-gray);
}

.no-results i {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.no-results p {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.no-results small {
  font-size: 0.9rem;
  opacity: 0.7;
}

/* Notifications */
.notification {
  position: fixed;
  top: 2rem;
  right: 2rem;
  padding: 1rem 1.5rem;
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  box-shadow: var(--shadow-hover);
  z-index: 1000;
  animation: slideIn 0.3s ease-out;
}

.notification-success {
  background: #d4edda;
  border: 1px solid var(--success-green);
  color: #155724;
}

.notification-error {
  background: #f8d7da;
  border: 1px solid var(--error-red);
  color: #721c24;
}

.notification-info {
  background: #d1ecf1;
  border: 1px solid var(--primary-blue);
  color: #0c5460;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Additional table styling */
.record-type {
  background: rgba(48, 149, 209, 0.1);
  color: var(--primary-blue);
  padding: 0.25rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  font-weight: 600;
}

.status-cell {
  font-weight: 600;
}

.status-cell i {
  margin-right: 0.5rem;
}

/* Footer */
.footer {
  background: var(--text-dark);
  color: white;
  text-align: center;
  padding: 2rem 1.5rem 1.5rem;
  margin-top: auto;
}

.footer p {
  margin: 0 0 0.5rem 0;
  font-size: 0.9rem;
  opacity: 0.8;
}

.footer p:last-of-type {
  margin-bottom: 1rem;
}

.footer-links {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--secondary-blue);
  text-decoration: underline;
}

.footer-links .separator {
  color: rgba(255, 255, 255, 0.4);
  font-size: 0.85rem;
}

/* Mobile Results Cards */
.results-cards {
  display: none;
}

.result-card {
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 1rem;
  overflow: hidden;
}

.result-card-header {
  padding: 1rem;
  background: linear-gradient(135deg, var(--light-gray) 0%, var(--medium-gray) 100%);
  border-bottom: 1px solid var(--border-color);
}

.result-card-title {
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.result-card-body {
  padding: 1rem;
}

.result-card-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--medium-gray);
}

.result-card-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.result-card-label {
  font-weight: 600;
  color: var(--dark-gray);
  font-size: 0.85rem;
  min-width: 80px;
}

.result-card-value {
  text-align: right;
  font-size: 0.9rem;
  flex: 1;
  margin-left: 1rem;
  word-break: break-word;
}

.result-card-value.monospace {
  font-family: 'Courier New', monospace;
  font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .container {
    max-width: 100%;
    margin: 0;
  }
  
  .main-content {
    padding: 1.5rem;
  }
}

@media (max-width: 992px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  
  .results-table th,
  .results-table td {
    padding: 1rem 0.75rem;
    font-size: 0.85rem;
  }
  
  .results-table td:nth-child(3),
  .results-table td:nth-child(5) {
    min-width: 200px;
  }
}

@media (max-width: 768px) {
  .header-content h1 {
    font-size: 2rem;
  }
  
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .main-content {
    padding: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Switch to card view on tablets */
  .table-container .results-table {
    display: none;
  }
  
  .results-cards {
    display: block;
  }
  
  .notification {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

@media (max-width: 640px) {
  .card-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .card-header {
    padding: 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  .form-row {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 1.5rem 1rem;
  }
  
  .header-content h1 {
    font-size: 1.5rem;
  }
  
  .header-content h1 i {
    display: block;
    margin: 0 0 0.5rem 0;
  }
  
  .main-content {
    padding: 0.75rem;
  }
  
  .card-header {
    padding: 0.75rem;
  }
  
  .card-body {
    padding: 0.75rem;
  }
  
  .btn {
    min-width: 120px;
    padding: 0.65rem 1rem;
  }
  
  .footer {
    padding: 1.5rem 0.75rem 1rem;
  }
  
  .footer-links {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .footer-links .separator {
    display: none;
  }
}

.btn-ns-add.active {
  background: var(--primary-blue);
  color: white;
  border-color: var(--primary-blue);
}

.btn-ns-clear {
  background: transparent;
  color: var(--dark-gray);
}

.form-input[readonly] {
  background: var(--light-gray);
  cursor: default;
}

.status-error {
  background: rgba(243, 156, 18, 0.12) !important;
  color: var(--warning-orange);
  font-weight: 600;
}
