/* Medical Tenders Monitor - Minimalist Styles */

:root {
  --primary-color: #2563eb;
  --primary-hover: #1d4ed8;
  --secondary-color: #64748b;
  --background: #f8fafc;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --success: #10b981;
  --error: #ef4444;
  --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--background);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Header */
header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 2px solid var(--border);
}

header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
}

/* Filters Section */
.filters-section {
  background: var(--surface);
  padding: 1.5rem;
  border-radius: 8px;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}

.filters {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: end;
  margin-bottom: 1rem;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.filter-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.filter-group input[type="date"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color 0.2s;
}

.filter-group input[type="date"]:focus,
.filter-group input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
}

.filter-group input[type="text"] {
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: var(--surface);
  transition: border-color 0.2s;
  min-width: 250px;
}

/* Buttons */
.btn-primary,
.btn-secondary {
  padding: 0.5rem 1.25rem;
  border: none;
  border-radius: 6px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

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

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

.btn-secondary {
  background: var(--surface);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--background);
}

/* Stats */
.stats {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.stat-badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--primary-color);
  color: white;
  border-radius: 20px;
  font-size: 0.875rem;
  font-weight: 600;
}

.stat-text {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Loading */
.loading {
  text-align: center;
  padding: 4rem 2rem;
}

.spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

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

/* Error & No Results */
.error,
.no-results {
  text-align: center;
  padding: 3rem 2rem;
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.error p:first-child,
.no-results p {
  font-size: 1.125rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

#errorMessage {
  color: var(--error);
  font-size: 0.875rem;
  margin-bottom: 1rem;
}

.hidden {
  display: none !important;
}

/* Table */
.table-container {
  background: var(--surface);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  background: var(--background);
  border-bottom: 2px solid var(--border);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background: var(--background);
}

/* Table columns */
.tender-title {
  font-weight: 500;
  color: var(--text-primary);
  max-width: 400px;
}

.tender-deadline {
  white-space: nowrap;
  color: var(--text-secondary);
}

.tender-deadline.urgent {
  color: var(--error);
  font-weight: 600;
}

.tender-ordering {
  max-width: 250px;
  color: var(--text-secondary);
}

.tender-value {
  font-weight: 500;
  white-space: nowrap;
}

.tender-keywords {
  max-width: 200px;
}

.keyword-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.75rem;
  margin: 0.125rem;
  color: var(--text-secondary);
}

.tender-source {
  font-size: 0.75rem;
}

.source-badge {
  display: inline-block;
  padding: 0.25rem 0.5rem;
  border-radius: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

/* Source-specific colors */
.source-bzp {
  background: #dbeafe;
  color: #1e40af;
}

.source-ted {
  background: #fef3c7;
  color: #92400e;
}

.source-uck {
  background: #e0e7ff;
  color: #4338ca;
}

.source-ncbr {
  background: #fce7f3;
  color: #9f1239;
}

.source-oferent {
  background: #d1fae5;
  color: #065f46;
}

.source-umw {
  background: #ede9fe;
  color: #5b21b6;
}

.source-umlub {
  background: #fef9c3;
  color: #713f12;
}

.source-gumed {
  background: #ddd6fe;
  color: #6b21a8;
}

.source-sum {
  background: #fecaca;
  color: #991b1b;
}

.tender-link a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.875rem;
}

.tender-link a:hover {
  text-decoration: underline;
}

/* Footer */
footer {
  text-align: center;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem;
}

footer a {
  color: var(--primary-color);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }

  header h1 {
    font-size: 1.5rem;
  }

  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-group {
    width: 100%;
  }

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

  table {
    min-width: 800px;
  }
}
