/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: #f5f5f5;
    padding: 20px;
}

/* Container */
.container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 5px;
}

.record-count {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* Main content */
main {
    padding: 30px;
}

/* Search section */
.search-section {
    background: #f9fafb;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.search-section h2 {
    margin-bottom: 20px;
    color: #4a5568;
    font-size: 1.5rem;
}

/* Form styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #4a5568;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.checkbox-group {
    margin-top: 10px;
    margin-bottom: 10px;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
    gap: 10px;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    margin: 0;
}

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

button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

button[type="submit"] {
    background: #667eea;
    color: white;
}

button[type="submit"]:hover {
    background: #5568d3;
}

button[type="reset"] {
    background: #e5e7eb;
    color: #4a5568;
}

button[type="reset"]:hover {
    background: #d1d5db;
}

/* Loading indicator */
.htmx-indicator {
    display: none;
    color: #667eea;
    font-weight: 600;
    margin-top: 15px;
}

.htmx-indicator.htmx-request {
    display: block;
}

.loading-spinner {
    display: inline-block;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Results section */
.results-section {
    margin-top: 30px;
}

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

.results-header h3 {
    color: #4a5568;
    font-size: 1.3rem;
}

/* Table styles */
.table-container {
    overflow-x: auto;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.results-table thead {
    background: #f9fafb;
}

.results-table th {
    padding: 14px 12px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    white-space: nowrap;
}

.results-table td {
    padding: 12px;
    border-bottom: 1px solid #e5e7eb;
}

.results-table tbody tr:hover {
    background: #f9fafb;
}

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

/* Empty state */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
}

.empty-state p {
    font-size: 1.1rem;
}

/* Footer */
footer {
    background: #f9fafb;
    padding: 20px;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
    border-top: 1px solid #e5e7eb;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header {
        padding: 20px;
    }

    header h1 {
        font-size: 1.8rem;
    }

    main {
        padding: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .results-table {
        font-size: 0.85rem;
    }

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