/* Decatur Public Library Genealogy Database Styles */

:root {
    --primary: #362C5F;
    --primary-dark: #2a2249;
    --primary-light: #4a3d7a;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --green-600: #059669;
    --red-600: #dc2626;
}
.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: #000;
    color: #fff;
    padding: 8px 16px;
    z-index: 100;
    text-decoration: none;
}

.skip-link:focus {
    top: 0;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-900);
    background: var(--gray-50);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

header {
    background: var(--primary);
    color: white;
    padding: 24px 0;
    margin-bottom: 32px;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

header a {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    opacity: 0.9;
}

header a:hover {
    opacity: 1;
    text-decoration: underline;
}

.search-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.search-card h2 {
    font-size: 1.1rem;
    color: var(--gray-700);
    margin-bottom: 16px;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.95rem;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.button-row {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    transition: background-color 0.15s;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--green-600);
    color: white;
}

.btn-success:hover {
    background: #047857;
}

.btn-danger {
    background: var(--red-600);
    color: white;
}

.btn-danger:hover {
    background: #b91c1c;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.results-count {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-700);
}

.results-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    overflow: hidden;
}

.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead {
    background: var(--gray-100);
}

th {
    text-align: left;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid var(--gray-200);
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--gray-100);
    font-size: 0.95rem;
}

tbody tr:hover {
    background: var(--gray-50);
}

.detail-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.detail-link:hover {
    text-decoration: underline;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 20px;
    border-top: 1px solid var(--gray-200);
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    text-decoration: none;
    color: var(--gray-700);
    background: var(--gray-100);
    transition: background-color 0.15s;
}

.pagination a:hover {
    background: var(--gray-200);
}

.pagination .active {
    background: var(--primary);
    color: white;
}

.pagination .disabled {
    opacity: 0.5;
    pointer-events: none;
}

.record-detail {
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 24px;
    margin-bottom: 24px;
}

.record-detail h2 {
    font-size: 1.3rem;
    margin-bottom: 16px;
    color: var(--gray-900);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.detail-item {
    padding: 12px;
    background: var(--gray-50);
    border-radius: 6px;
}

.detail-item label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-500);
    text-transform: uppercase;
    margin-bottom: 4px;
}

.detail-item span {
    font-size: 1rem;
    color: var(--gray-900);
}

.login-card {
    max-width: 400px;
    margin: 80px auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    padding: 32px;
}

.login-card h2 {
    text-align: center;
    margin-bottom: 24px;
}

.login-card .form-group {
    margin-bottom: 16px;
}

.login-card .btn {
    width: 100%;
}

.error-message {
    background: #fef2f2;
    color: var(--red-600);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.success-message {
    background: #ecfdf5;
    color: var(--green-600);
    padding: 12px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 0.9rem;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

footer {
    text-align: center;
    padding: 24px;
    color: var(--gray-500);
    font-size: 0.9rem;
}

@media (max-width: 768px) {
    .container {
        padding: 12px;
    }
    
    header .container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .search-grid {
        grid-template-columns: 1fr;
    }
    
    th, td {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .button-row {
        flex-direction: column;
    }
}
