h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: #000;
  margin-bottom: 0.75rem;
}

.dark h3 {
  color: #fff;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
}

thead th {
  text-align: center;
}

.table-container {
  overflow-x: auto;
  border-radius: 0.75rem;
  box-shadow:
    0 1px 3px 0 rgba(0, 0, 0, 0.1),
    0 1px 2px 0 rgba(0, 0, 0, 0.06);
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
}

.dark .table-container {
  background-color: #1f2937;
  border-color: #374151;
}

/* Alternating row colors */
table tr:nth-child(even) {
  background-color: #f9fafb; /* Tailwind's gray-50 */
}
.dark table tr:nth-child(even) {
  background-color: #1f2937; /* Tailwind's gray-800 */
}

table tr:nth-child(odd) {
  background-color: #ffffff;
}
.dark table tr:nth-child(odd) {
  background-color: #111827; /* Tailwind's gray-900 */
}

/* Hover highlight */
table tr:hover {
  background-color: #f3f4f6; /* Tailwind's gray-100 */
}
.dark table tr:hover {
  background-color: #4b5563; /* Tailwind's gray-600 */
}

/* Column dividing line */
td:not(:last-child) {
  border-right: 1px solid #e5e7eb;
}
.dark td:not(:last-child) {
  border-right: 1px solid #4b5563;
}

th:not(:last-child) {
  border-right: 1px solid #e5e7eb;
}
.dark th:not(:last-child) {
  border-right: 1px solid #4b5563;
}

th {
  background-color: #f3f4f6; /* Tailwind's gray-100 */
  border: none;
  padding: 0.75rem 1rem;
}
.dark th {
  background-color: #374151; /* Tailwind's gray-700 */
}

td {
  border: none;
  padding: 0.75rem 1rem;
  text-align: left;
}

/* Center non-text content in table cells */


/* Card table styling */
.card-info-table {
  table-layout: fixed;
}

.card-info-table td:first-child {
  width: 30%;
  min-width: 150px;
}

.card-info-table td:last-child {
  width: 70%;
}

.card-info-table td {
  text-overflow: ellipsis;
  overflow: hidden;
}

/* Card content */
.card-article {
  position: relative;
  display: flex;
  justify-content: center;
  max-width: 1200px;
  height: calc(100% - 40px);
  max-height: 90vh;
  margin: 0 0;
  z-index: 10;
  overflow: hidden;
  border-radius: 20px;
}

/* Modal section headings */
.card-container h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.card-container section:first-child h2 {
  margin-top: 0;
}

.section-title h2 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

.card-container {
  position: relative;
  background: linear-gradient(135deg, #ffffff 0%, #eef2ff 50%, #e0e7ff 100%);
  border: 1px solid #e5e7eb;
  padding: 2rem;
  padding-top: 6rem;
  overflow: auto;
  height: 100%;
  box-sizing: border-box;
  box-shadow:
    0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.dark .card-container {
  background: linear-gradient(135deg, #111827 0%, #1f2937 50%, #111827 100%);
  border-color: #374151;
}

.card-top-controls {
  position: absolute;
  top: 15px;
  right: 32px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
  z-index: 30;
}

.card-close-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  padding: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease-in-out;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  cursor: pointer;
}

.card-close-btn:hover {
  background-color: #fef2f2;
}

.dark .card-close-btn {
  background-color: #1f2937;
  border-color: #374151;
}

.dark .card-close-btn:hover {
  background-color: #7f1d1d;
}

.card-tickbox {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  white-space: nowrap;
  margin-bottom: 0;
}

/* Card navigation buttons */
.card-nav-btn {
  display: flex;
  justify-content: center;
  align-items: center;
  position: static;
  z-index: 15;
  background-color: #ffffff;
  border: 1px solid #d1d5db;
  border-radius: 50%;
  padding: 0.5rem;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
  transition: all 0.15s ease-in-out;
  flex-shrink: 0;
  margin: 10px;
  height: 50px;
  width: 50px;
  cursor: pointer;
}

#arrow-right svg {
  margin-left: 2px;
}

#arrow-left svg {
  margin-right: 2px;
}

.card-nav-btn:hover {
  background-color: #eef2ff;
}

.card-nav-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3);
}

.dark .card-nav-btn {
  background-color: #1f2937;
  border-color: #4b5563;
}

.dark .card-nav-btn:hover {
  background-color: #3730a3;
}

/* Scrollbar styling for better UX */
.card-container::-webkit-scrollbar {
  width: 10px;
}

.card-container::-webkit-scrollbar-track {
  background: #f1f5f9;
  border-radius: 4px;
}

.card-container::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

.card-container::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

.dark .card-container::-webkit-scrollbar-track {
  background: #1e293b;
}

.dark .card-container::-webkit-scrollbar-thumb {
  background: #475569;
}

.dark .card-container::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

/* Chart rendering */
.home-modal-charts-grid {
  display: grid;
  grid-template-columns: 49% 49%;
  margin-top: 1rem;
  gap: 2%;
}

.home-modal-charts-grid .funding-history-container {
  grid-column: span 2;
}

.chart-container {
  position: relative;
  height: 220px;
  background-color: #f9fafb; /* Tailwind's gray-50 */
  transition: background-color 0.15s ease-in-out;
}

.dark .chart-container {
  background-color: #374151; /* Tailwind's gray-700 */
}

.chart-container canvas {
  max-height: 200px;
}

.dark .chart-container {
  background-color: #374151;
}

.text-yellow-400 {
  color: rgb(250 204 21 / var(--tw-text-opacity, 1));
}

.justify-center {
  justify-content: center;
}

.items-center {
  align-items: center;
}

.flex {
  display: flex;
}

.gap-2 {
  gap: 5px;
}

@media (max-width: 1200px) {
  .home-modal-charts-grid {
    grid-template-columns: 100%;
  }

  .home-modal-charts-grid .funding-history-container {
    grid-column: 1;
  }
}

@media (max-width: 768px) {
  #arrow-right, #arrow-left {
    display: none;
  }

  .card-article {
    margin-left: 20px;
    margin-right: 20px;
  }

  .card-container {
    padding: 1.5rem;
    padding-top: 4rem;
  }

  .card-top-controls {
    top: 15px;
    right: 20px;
    gap: 15px;
  }

  .card-info-table td:first-child {
    width: 55%;
  }

  .card-nav-btn-left {
    left: 0.5rem;
  }

  .card-nav-btn-right {
    right: 0.5rem;
  }

  .natural-language-input {
    width: 100%;
    min-width: auto;
  }

  .profile-image {
    width: 20vw;
    height: 20vw;
    max-width: 120px;
    max-height: 120px;
  }
}

@media (max-width: 480px) {
  .card-container {
    width: calc(100vw - 1rem);
    max-height: calc(100vh - 1rem);
    padding: 1rem;
    padding-top: 3.5rem;
  }

  .card-nav-btn {
    padding: 0.375rem;
  }

  .card-nav-btn svg {
    width: 20px;
    height: 20px;
  }

  .popup-company-card {
    cursor: pointer;
  }
}