<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Updated Dog Showings CSS</title>
    <style>
/* Dog Showings Search Styles */
.showings-search-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Search Filters Section */
.search-filters {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.search-filters h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.4em;
}

/* Filter Form Layout */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.filter-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
    font-size: 14px;
}

.filter-input,
.filter-select {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.filter-input:focus,
.filter-select:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0,123,255,.25);
}

/* Loading state for selects */
.filter-select.loading {
    background-color: #f8f9fa;
    cursor: wait;
}

.filter-select:disabled {
    background-color: #e9ecef;
    cursor: not-allowed;
}

/* Autocomplete Styles */
.ui-autocomplete {
    max-height: 200px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 1000;
    background: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.ui-menu-item {
    padding: 8px 12px;
    cursor: pointer;
}

.ui-menu-item:hover,
.ui-state-focus {
    background-color: #007bff;
    color: white;
}

/* Filter Actions */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-start;
}

.search-button,
.reset-button {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.search-button {
    background-color: #007bff;
    color: white;
}

.search-button:hover {
    background-color: #0056b3;
}

.reset-button {
    background-color: #cccc00 !important;
    color: white !important;
    background: #cccc00 !important;
}

.reset-button:hover {
    background-color: #b3b300 !important; /* Slightly darker yellow on hover */
    background: #b3b300 !important;
}

/* Also target button element in case it's a button tag */
button.reset-button {
    background-color: #cccc00 !important;
    color: white !important;
    background: #cccc00 !important;
}

button.reset-button:hover {
    background-color: #b3b300 !important;
    background: #b3b300 !important;
}

/* Results Section */
.search-results-wrapper {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #dee2e6;
}

.results-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.4em;
}

.results-count {
    font-weight: 600;
    color: #495057;
}

/* Loading Spinner */
.search-loading {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(0,123,255,.3);
    border-radius: 50%;
    border-top-color: #007bff;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Results Table */
.showings-results-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

/* UPDATED: Header with purple background and white text */
.showings-results-table thead {
    background-color: #990099;
}

.showings-results-table th {
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: white; /* Changed to white */
    border-bottom: 2px solid #dee2e6;
    white-space: nowrap;
    background-color: #990099; /* Added purple background */
}

.showings-results-table th.sortable {
    cursor: pointer;
    user-select: none;
    position: relative;
    padding-right: 25px;
}

.showings-results-table th.sortable:hover {
    background-color: #7a007a; /* Darker purple on hover */
}

.showings-results-table th.sortable::after {
    content: "↕";
    position: absolute;
    right: 8px;
    opacity: 0.7; /* Increased opacity for better visibility on purple */
    color: white;
}

.showings-results-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: top;
}

/* NUCLEAR OPTION: Force remove ALL alternating row colors */
.showings-results-table tbody tr,
.showings-results-table tbody tr:nth-child(odd),
.showings-results-table tbody tr:nth-child(even),
.showings-results-table tbody tr:nth-child(2n),
.showings-results-table tbody tr:nth-child(2n+1),
.showings-results-table tbody tr:nth-of-type(odd),
.showings-results-table tbody tr:nth-of-type(even),
.showings-results-table tr,
.showings-results-table tr:nth-child(odd),
.showings-results-table tr:nth-child(even),
table tbody tr:nth-child(odd),
table tbody tr:nth-child(even),
tr:nth-child(odd),
tr:nth-child(even),
.odd,
.even {
    background-color: white !important;
    background: white !important;
    background-image: none !important;
}

/* Also target td cells in case background is applied there */
.showings-results-table tbody tr td,
.showings-results-table tbody tr:nth-child(odd) td,
.showings-results-table tbody tr:nth-child(even) td {
    background-color: transparent !important;
    background: transparent !important;
}

/* Override any possible class-based styling */
.showings-results-table tbody tr.odd,
.showings-results-table tbody tr.even,
.showings-results-table tbody tr.alt,
.showings-results-table tbody tr.alternate {
    background-color: white !important;
    background: white !important;
}

.showings-results-table tbody tr:hover {
    background-color: #f0f0f0 !important; /* Light grey on hover for better UX */
}

/* Table Cell Styles */
.trial-info .date {
    font-weight: 600;
    margin-bottom: 4px;
}

.trial-info .date a {
    color: #007bff;
    text-decoration: none;
}

.trial-info .date a:hover {
    text-decoration: underline;
}

.trial-info .location {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.trial-info .club {
    font-size: 0.9em;
    color: #495057;
}

.officials .judges {
    margin-bottom: 4px;
}

.officials .decoys {
    color: #6c757d;
    font-size: 0.9em;
}

.dog-handler .dog {
    margin-bottom: 4px;
}

.dog-handler .dog a {
    color: #007bff;
    text-decoration: none;
}

.dog-handler .dog a:hover {
    text-decoration: underline;
}

.dog-handler .breed {
    color: #6c757d;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.dog-handler .handler {
    font-size: 0.9em;
    color: #495057;
}

/* UPDATED: Result Badges with rounded corners and new colors */
.result-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 23px; /* Higher radius for more rounded button appearance */
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    text-align: center;
    min-width: 35px;
}

/* Q badge - Blue background with white text */
.result-badge.result-q {
    background-color: #0099ff;
    color: white;
}

/* NQ badge - Red background with white text */
.result-badge.result-nq {
    background-color: #cc0000;
    color: white;
}

/* DQ/INJ/PULL badges - Grey background with white text */
.result-badge.result-dq,
.result-badge.result-inj,
.result-badge.result-pull,
.result-badge.result-dq_inj_pull {
    background-color: #7a7a7a;
    color: white;
}

/* No Results Message */
.no-results {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-size: 1.1em;
}

/* Pagination */
.pagination-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
}

.pagination-info {
    color: #6c757d;
    font-size: 0.95em;
}

.load-more-button {
    padding: 10px 20px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.load-more-button:hover:not(:disabled) {
    background-color: #0056b3;
}

.load-more-button:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    opacity: 0.65;
}

/* ENHANCED: Responsive Design for better mobile experience */
@media (max-width: 768px) {
    .filter-row {
        grid-template-columns: 1fr;
    }
    
    .showings-search-wrapper {
        padding: 10px;
    }
    
    .showings-results-table {
        font-size: 0.9em;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .showings-results-table th,
    .showings-results-table td {
        padding: 8px 6px;
        font-size: 14px;
    }
    
    /* Make badges slightly larger for better touch targets on mobile */
    .result-badge {
        padding: 6px 12px;
        font-size: 0.9em;
        min-width: 40px;
        min-height: 28px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .pagination-wrapper {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .load-more-button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* Hide the table header completely on phones */
    .showings-results-table thead {
        display: none;
    }
    
    /* Stack table on very small screens for better readability */
    .showings-results-table,
    .showings-results-table tbody,
    .showings-results-table td,
    .showings-results-table tr {
        display: block;
    }
    
    .showings-results-table tr {
        border: 1px solid #dee2e6;
        margin-bottom: 10px;
        border-radius: 8px;
        padding: 10px;
    }
    
    .showings-results-table td {
        border: none;
        position: relative;
        padding: 8px;
        min-height: 30px;
    }
    
    /* Remove the label system since we're hiding headers */
    .showings-results-table td:before {
        display: none;
    }
    
    /* Ensure result badges display properly in mobile view */
    .result-badge {
        display: inline-block;
        margin-left: 0;
    }
    
    /* Adjust font sizes for better mobile readability */
    body {
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .trial-info .location,
    .trial-info .club,
    .dog-handler .breed,
    .dog-handler .handler,
    .officials .decoys {
        font-size: 0.85em;
    }
}
    </style>
</head>
<body>
    <!-- Example HTML to demonstrate the styles -->
    <div class="showings-search-wrapper">
        <div class="search-results-wrapper">
            <div class="results-header">
                <h3>Search Results</h3>
                <span class="results-count">Showing 5 results</span>
            </div>
            
            <table class="showings-results-table">
                <thead>
                    <tr>
                        <th class="sortable">Trial Date</th>
                        <th class="sortable">Dog</th>
                        <th>Officials</th>
                        <th>Result</th>
                        <th class="sortable">Score</th>
                    </tr>
                </thead>
                <tbody>
                    <tr>
                        <td class="trial-info">
                            <div class="date"><a href="#">March 15, 2024</a></div>
                            <div class="location">Springfield, OH</div>
                            <div class="club">Springfield Dog Club</div>
                        </td>
                        <td class="dog-handler">
                            <div class="dog"><a href="#">Max</a></div>
                            <div class="breed">German Shepherd</div>
                            <div class="handler">John Smith</div>
                        </td>
                        <td class="officials">
                            <div class="judges">Judge: Jane Doe</div>
                            <div class="decoys">Decoy: Bob Johnson</div>
                        </td>
                        <td><span class="result-badge result-q">Q</span></td>
                        <td>95</td>
                    </tr>
                    <tr>
                        <td class="trial-info">
                            <div class="date"><a href="#">March 16, 2024</a></div>
                            <div class="location">Columbus, OH</div>
                            <div class="club">Columbus K9 Club</div>
                        </td>
                        <td class="dog-handler">
                            <div class="dog"><a href="#">Luna</a></div>
                            <div class="breed">Belgian Malinois</div>
                            <div class="handler">Sarah Johnson</div>
                        </td>
                        <td class="officials">
                            <div class="judges">Judge: Mike Wilson</div>
                            <div class="decoys">Decoy: Tom Davis</div>
                        </td>
                        <td><span class="result-badge result-nq">NQ</span></td>
                        <td>82</td>
                    </tr>
                    <tr>
                        <td class="trial-info">
                            <div class="date"><a href="#">March 17, 2024</a></div>
                            <div class="location">Cincinnati, OH</div>
                            <div class="club">Queen City Dog Sports</div>
                        </td>
                        <td class="dog-handler">
                            <div class="dog"><a href="#">Rex</a></div>
                            <div class="breed">Dutch Shepherd</div>
                            <div class="handler">David Brown</div>
                        </td>
                        <td class="officials">
                            <div class="judges">Judge: Emily White</div>
                            <div class="decoys">Decoy: Chris Green</div>
                        </td>
                        <td><span class="result-badge result-dq">DQ</span></td>
                        <td>-</td>
                    </tr>
                    <tr>
                        <td class="trial-info">
                            <div class="date"><a href="#">March 18, 2024</a></div>
                            <div class="location">Dayton, OH</div>
                            <div class="club">Dayton Training Club</div>
                        </td>
                        <td class="dog-handler">
                            <div class="dog"><a href="#">Bella</a></div>
                            <div class="breed">Rottweiler</div>
                            <div class="handler">Lisa Taylor</div>
                        </td>
                        <td class="officials">
                            <div class="judges">Judge: Robert Lee</div>
                            <div class="decoys">Decoy: Mark Thompson</div>
                        </td>
                        <td><span class="result-badge result-inj">INJ</span></td>
                        <td>-</td>
                    </tr>
                    <tr>
                        <td class="trial-info">
                            <div class="date"><a href="#">March 19, 2024</a></div>
                            <div class="location">Cleveland, OH</div>
                            <div class="club">Cleveland Canine Club</div>
                        </td>
                        <td class="dog-handler">
                            <div class="dog"><a href="#">Duke</a></div>
                            <div class="breed">Doberman</div>
                            <div class="handler">Michael Harris</div>
                        </td>
                        <td class="officials">
                            <div class="judges">Judge: Patricia Moore</div>
                            <div class="decoys">Decoy: Steve Williams</div>
                        </td>
                        <td><span class="result-badge result-pull">PULL</span></td>
                        <td>-</td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
</body>
</html>