.card {
    background-color: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-block: 1rem;
    padding: 1rem;
}

.header-section {
    display: flex;
    flex-direction: column;
    /* Set to column to stack the title and search bar */
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

@media (min-width: 768px) {
    .header-section {
        flex-direction: column;
        /* Still column on larger screens */
    }
}

.header-title {
    font-size: 1.5rem;
    font-weight: bold;
}

.search-container {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
    max-width: 1000px;
    /* Set max-width to 900px */
}

@media (min-width: 640px) {
    .search-container {
        flex-direction: row;
        align-items: center;
        width: 100%;
        /* Keep width at 100% to fill container */
    }
}

.horse-stats-container table th,
.horse-stats-container table td {
    text-align: center;
}

.horse-list-container {
    overflow-x: auto;
}

.horse-list-table {
    width: 100%;
    border-collapse: collapse;
}

.horse-list-table thead th {
    background-color: #166534;
    /* Darker green for the header */
    color: #fff;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9em;
    position: sticky;
    top: 0;
    z-index: 10;
    /* cursor: pointer; */
    white-space: nowrap;
}

.horse-list-table th,
.horse-list-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.horse-list-table td:nth-child(1) {
    color: var(--color-primary);
    font-weight: bold;
}

/* Zebra striping for table rows */
.horse-list-table tbody tr:nth-child(even) {
    background-color: #f5f5f5;
}

.horse-list-table tbody tr {
    cursor: pointer;
}

/* Hover effect for table rows */
.horse-list-table tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.input-text {
    border: 1px solid #d1d5db;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    width: 100%;
    font-size: 0.875rem;
}

/* Specific CSS to make the select element's width fit its content */
.search-container .search-select {
    width: max-content;
}

.search-inputs {
    display: flex;
    gap: 0.5rem;
    width: 100%;
}

.btn-primary {
    background-color: #1f2937;
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 600;
}

.filter-bar {
    background-color: #166534;
    color: white;
    padding: 0.75rem;
    border-radius: 0.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    font-weight: 600;
}

.filter-bar span {
    padding: 0.5rem;
}


.pagination {
    margin-top: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
}

.pagination a {
    text-decoration: none;
    color: #1f2937;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    transition: background-color 0.3s ease;
    cursor: pointer;
}

.pagination a:hover {
    background-color: #f3f4f6;
}

.pagination a.active {
    background-color: #166534;
    color: white;
    border-color: #166534;
}


/* Grid layout for the three columns */
.profile-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.profile-details-column,
.profile-text-column,
.profile-image-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 1rem;
    color: #374151;
}

.profile-info-column p,
.profile-details-column p {
    margin: 0;
}

.prize-money-card,
.total-card {
    background-color: #f3f4f6;
    padding: 0.5rem;
    border-radius: 0.375rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
}

.prize-money-card div {
    flex: 1;
}

.prize-money-card div:last-child {
    text-align: right;
}

.prize-money-card .text-xs {
    font-size: 0.75rem;
    color: #6b7280;
}

.prize-money-card .font-semibold {
    font-weight: 600;
}

.info-section-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.info-section-buttons button {
    background-color: #e5e7eb;
    color: #374151;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-weight: 600;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
}

.info-section-buttons button:hover {
    /* filter: saturate(200%) brightness(80%); */
    color: white;
    background-color: var(--color-primary);
}

.horse-image-container {
    position: relative;
    width: 100%;
}

.horse-image {
    width: 100%;
    max-height: 20rem;
    object-fit: contain;
    border-radius: 10px;
}

.club-logo {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: white;
    border: 3px solid white;
    border-radius: 50%;
    /* padding: 0.5rem; */
    /* box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); */
}

.club-logo img {
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    object-fit: contain;
}

.race-times-section {
    background-color: #e5e7eb;
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    /* font-weight: 600; */
    color: #374151;
    flex-wrap: wrap;
}

.race-times-section span {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.race-times-section div span[id] {
    font-weight: bold;
}

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

.table-container {
    overflow-x: auto;
    margin-block: 0.5rem;
}

.race-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    min-width: 1000px;
}

.prize-table {
    min-width: 300px;
}

.race-table th,
.race-table td {
    padding-block: 0.5rem;
    padding-inline: 0.2rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
    /* white-space: nowrap; */
    vertical-align: text-top;
}

.race-table th {
    background-color: #ebf0eb;
    font-weight: 600;
    text-transform: uppercase;
}

.race-table th[data-label="Running Position"],
.race-table td[data-label="Running Position"] {
    max-width: 4rem;
}

.race-table th[data-label="Top 3 Finishers"],
.race-table td[data-label="Top 3 Finishers"] {
    max-width: 10rem;
    text-wrap: wrap;
    /* word-break: break-all; */
    text-transform: uppercase;

}

.race-table th[data-label="Div"],
.race-table td[data-label="Div"] {
    max-width: 2rem;
    text-wrap: wrap;
    /* word-break: break-all; */
}

.legend-section {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    font-size: small;
}

.legend-section p {
    margin-block: 10px;
}

@media (min-width: 640px) {
    .legend-section {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .legend-section {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-item i {
    font-size: 1rem;
    color: #dc2626;
    /* Red color for the icons */
}