/* ADDB Application Styles */

.addb-app,
.addb-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
  text-align: left;
}

.addb-content {
  margin-top: 20px;
}

/* Page Header Layout */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #003366;
}

.page-header h1 {
  margin: 0;
  font-size: 28px;
  color: #003366;
  flex: 1;
  text-align: left;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  min-width: 250px;
}

.welcome-message {
  font-weight: bold;
  color: #003366;
  font-size: 14px;
  text-align: right;
  margin-bottom: 5px;
}

.action-buttons {
  display: flex;
  flex-direction: row;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.action-button {
  padding: 10px 18px;
  background-color: rgb(210, 63, 8);
  color: white;
  border: 1px solid rgb(210, 63, 8);
  border-radius: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
  text-transform: none;
}

.action-button:hover {
  background-color: white;
  color: rgb(210, 63, 8);
  border: 1px solid rgb(210, 63, 8);
}

.action-button.active {
  background-color: white;
  color: rgb(210, 63, 8);
  border: 1px solid rgb(210, 63, 8);
}

/* Introduction Section */
.intro-section {
  margin-bottom: 20px;
  text-align: left;
}

.intro-section p {
  font-size: 16px;
  line-height: 1.6;
  color: #333;
  margin-bottom: 12px;
  text-align: left;
}

.intro-section ul {
  margin: 12px 0;
  padding-left: 30px;
  line-height: 1.8;
  text-align: left;
}

.intro-section li {
  margin-bottom: 8px;
  color: #333;
  text-align: left;
}

.cta-text {
  font-size: 14px;
  color: #333;
  margin-top: 15px;
}

/* Search Box */
.search-box-container {
  margin-bottom: 30px;
}

.search-instructions {
  font-size: 14px;
  color: #333;
  margin-bottom: 10px;
}

.search-box {
  display: flex;
  gap: 10px;
  margin-bottom: 15px;
}

.search-input {
  flex: 1;
  padding: 12px;
  font-size: 16px;
  border: 2px solid #ccc;
  border-radius: 4px;
}

.search-button {
  padding: 12px 30px;
  background-color: rgb(210, 63, 8);
  color: white;
  border: 1px solid rgb(210, 63, 8);
  border-radius: 0;
  cursor: pointer;
  font-size: 16px;
  white-space: nowrap;
  transition: all 0.2s;
  text-transform: uppercase;
}

.search-button:hover {
  background-color: white;
  color: rgb(210, 63, 8);
  border: 1px solid rgb(210, 63, 8);
}

.search-button.secondary {
  background-color: rgb(210, 63, 8);
  color: white;
  border: 1px solid rgb(210, 63, 8);
}

.search-button.secondary:hover {
  background-color: white;
  color: rgb(210, 63, 8);
  border: 1px solid rgb(210, 63, 8);
}

.search-button:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

/* Advanced Search */
.advanced-search {
  background-color: #f9f9f9;
  padding: 25px;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.advanced-search h3 {
  margin: 0 0 10px 0;
  color: #003366;
  font-size: 20px;
}

.advanced-instructions {
  font-size: 14px;
  color: #666;
  margin-bottom: 20px;
  font-style: italic;
}

.advanced-search .form-group {
  margin-bottom: 20px;
}

.advanced-search .form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
  font-size: 14px;
}

.advanced-search .form-group input,
.advanced-search .form-group select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.advanced-search .form-group input:focus,
.advanced-search .form-group select:focus {
  outline: none;
  border-color: #003366;
}

/* Chip Input Component */
.chip-input-container {
  position: relative;
}

.chip-input-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 8px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background-color: white;
  min-height: 42px;
  cursor: text;
}

.chip-input-wrapper:focus-within {
  border-color: #003366;
  outline: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  background-color: #003366;
  color: white;
  border-radius: 16px;
  font-size: 13px;
  white-space: nowrap;
}

.chip-remove {
  background: none;
  border: none;
  color: white;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
  margin-left: 4px;
  font-weight: bold;
}

.chip-remove:hover {
  color: #ffcccc;
}

.chip-input {
  flex: 1;
  min-width: 150px;
  border: none !important;
  outline: none;
  padding: 0 !important;
  font-size: 14px;
  background: transparent;
}

.chip-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background-color: white;
  border: 1px solid #ccc;
  border-top: none;
  border-radius: 0 0 4px 4px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}

.chip-option {
  padding: 10px;
  cursor: pointer;
  font-size: 14px;
}

.chip-option:hover {
  background-color: #f0f0f0;
}

.advanced-actions {
  display: flex;
  gap: 10px;
  margin-top: 25px;
}

.advanced-actions button {
  padding: 12px 24px;
}

/* Debug Query Container */
.debug-query-container {
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  padding: 15px;
  margin: 15px 0;
}

.debug-query-container strong {
  color: #856404;
  display: block;
  margin-bottom: 8px;
}

.debug-query-url {
  font-family: monospace;
  font-size: 13px;
  color: #212529;
  word-break: break-all;
  background-color: #fff;
  padding: 8px;
  border-radius: 3px;
  border: 1px solid #dee2e6;
}

/* Search Results */
.search-results-container {
  margin-top: 20px;
}

.results-header {
  margin-bottom: 20px;
}

.results-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

@media (max-width: 768px) {
  .results-list {
    grid-template-columns: 1fr;
  }
}

.company-card {
  padding: 20px;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.company-card:hover {
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-color: #003366;
}

.company-card h4 {
  margin: 0 0 10px 0;
  color: #003366;
  font-size: 20px;
}

.company-card p {
  margin: 5px 0;
  color: #666;
}

.company-card .location {
  color: #003366;
  font-weight: 500;
}

.company-card .services {
  font-size: 14px;
  line-height: 1.5;
}

.company-card .register-notice {
  font-style: italic;
  color: #999;
  margin-top: 10px;
}

.no-results {
  text-align: center;
  padding: 40px;
  color: #666;
}

.results-summary {
  padding: 15px;
  background-color: #f9f9f9;
  border-left: 4px solid #003366;
  margin-bottom: 20px;
}

.register-prompt {
  padding: 15px;
  background-color: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 4px;
  margin-bottom: 20px;
}

.register-prompt a {
  color: #003366;
  font-weight: bold;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
}

.results-table th,
.results-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.results-table th {
  background-color: #003366;
  color: white;
  font-weight: bold;
}

.results-table tr:hover {
  background-color: #f5f5f5;
}

.pagination {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid #ccc;
  background-color: white;
  cursor: pointer;
  border-radius: 0;
}

.pagination button:hover:not(:disabled) {
  background-color: #f0f0f0;
}

.pagination button:disabled {
  color: #ccc;
  cursor: not-allowed;
}

/* Forms */
.login-form-container,
.register-form-container {
  max-width: 600px;
  margin: 0 auto;
  padding: 30px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-form-container h2,
.register-form-container h2 {
  margin-top: 0;
  color: #003366;
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #ddd;
}

.btn-link {
  background: none;
  border: none;
  color: #003366;
  text-decoration: underline;
  cursor: pointer;
  padding: 0;
  font-size: inherit;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-group input {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 14px;
}

.form-group input:focus {
  outline: none;
  border-color: #003366;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 0;
  font-size: 16px;
  cursor: pointer;
  text-transform: uppercase;
}

.btn-primary {
  background-color: rgb(210, 63, 8);
  color: white;
  border: 1px solid rgb(210, 63, 8);
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-primary:hover:not(:disabled) {
  background-color: white;
  color: rgb(210, 63, 8);
  border: 1px solid rgb(210, 63, 8);
}

.btn-primary:disabled {
  background-color: #ccc;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: white;
  color: rgb(210, 63, 8);
  border: 1px solid rgb(210, 63, 8);
  transition: all 0.2s;
  text-transform: uppercase;
}

.btn-secondary:hover {
  background-color: rgb(210, 63, 8);
  color: white;
  border: 1px solid rgb(210, 63, 8);
}

/* Admin Dashboard */
.admin-dashboard {
  padding: 20px;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.metric-card {
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  border-left: 4px solid #003366;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.metric-card h3 {
  margin: 0 0 10px 0;
  font-size: 14px;
  color: #666;
  text-transform: uppercase;
}

.metric-value {
  font-size: 32px;
  font-weight: bold;
  color: #003366;
  margin: 0;
}

.dashboard-section {
  margin-bottom: 30px;
}

.dashboard-section h2 {
  color: #003366;
  border-bottom: 2px solid #003366;
  padding-bottom: 10px;
  margin-bottom: 20px;
}

.activity-table,
.keywords-table {
  width: 100%;
  border-collapse: collapse;
}

.activity-table th,
.activity-table td,
.keywords-table th,
.keywords-table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #ddd;
}

.activity-table th,
.keywords-table th {
  background-color: #003366;
  color: white;
  font-weight: bold;
}

.activity-table tr:hover,
.keywords-table tr:hover {
  background-color: #f5f5f5;
}

/* Messages */
.error-message {
  padding: 15px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  border-radius: 4px;
  margin-bottom: 20px;
}

.success-message {
  padding: 15px;
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
  border-radius: 4px;
  margin-bottom: 20px;
}

.loading {
  text-align: center;
  padding: 40px;
  color: #666;
  font-size: 18px;
}

/* Company Detail Modal */
.company-detail-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  padding: 20px;
}

.company-detail-content {
  background-color: white;
  border-radius: 8px;
  max-width: 1200px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.modal-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  border-bottom: 2px solid #003366;
  position: sticky;
  top: 0;
  background-color: white;
  z-index: 1;
  position: relative;
}

.modal-header h2 {
  margin: 0;
  color: #003366;
  font-size: 24px;
  text-align: center;
}

.close-button {
  background: none;
  border: none;
  font-size: 32px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
}

.close-button:hover {
  background-color: #f0f0f0;
  color: #333;
}

.modal-body {
  padding: 20px;
}

/* 3-Column Layout */
.company-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 30px;
}

.company-columns .column {
  min-width: 0; /* Prevents grid blowout */
}

.company-columns .column h3 {
  color: #003366;
  font-size: 18px;
  margin: 0 0 10px 0;
}

.company-columns .column h4 {
  color: #003366;
  font-size: 16px;
  margin: 0 0 10px 0;
}

.newBlock {
  margin-top: 15px;
  line-height: 1.6;
}

.newBlock b {
  color: #333;
}

.notice {
  margin-top: 30px;
  padding: 15px;
  background-color: #f9f9f9;
  border-left: 4px solid #ff9800;
  font-size: 13px;
  line-height: 1.6;
}

.register-prompt {
  margin-top: 30px;
  padding: 20px;
  background-color: #e3f2fd;
  border-left: 4px solid #003366;
  text-align: center;
}

.register-prompt p {
  margin: 0;
  color: #003366;
}

@media (max-width: 968px) {
  .company-columns {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

.detail-section {
  margin-bottom: 30px;
}

.detail-section h3 {
  color: #003366;
  margin: 0 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 1px solid #ddd;
  font-size: 18px;
}

.description {
  line-height: 1.6;
  color: #333;
  margin-bottom: 20px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.detail-item.full-width {
  grid-column: 1 / -1;
}

.detail-item strong {
  color: #666;
  font-size: 14px;
}

.detail-item span {
  color: #333;
  font-size: 16px;
}

.detail-item a {
  color: #003366;
  text-decoration: none;
}

.detail-item a:hover {
  text-decoration: underline;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #ddd;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background-color: white;
}

.alert {
  padding: 15px;
  border-radius: 4px;
  margin-bottom: 15px;
}

.alert-danger {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

/* Responsive */
@media (max-width: 768px) {
  .page-header {
    flex-direction: column;
  }

  .header-content {
    padding-right: 0;
    margin-bottom: 20px;
  }

  .header-actions {
    width: 100%;
  }

  .search-box {
    flex-direction: column;
  }

  .search-button {
    width: 100%;
  }

  .advanced-actions {
    flex-direction: column;
  }

  .advanced-actions button {
    width: 100%;
  }

  .metrics-grid {
    grid-template-columns: 1fr;
  }

  .results-table {
    font-size: 14px;
  }

  .results-table th,
  .results-table td {
    padding: 8px;
  }

  .company-detail-content {
    max-height: 95vh;
    margin: 10px;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .modal-header h2 {
    font-size: 20px;
  }
}
