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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: #052d47;
    min-height: 100vh;
    color: white;
    margin: 0;
}

#header-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 70px;
    background: #27536f;
    border-bottom: 1px solid #27536f;
    box-shadow: 0 2px 10px rgba(39, 83, 111, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 30px;
    gap: 30px;
}

.header-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff5e8;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.header-button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.header-button.logout {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
    height: 50px;
    line-height: 50px;
    text-align: center;
    padding: 0 12px;
    box-sizing: border-box;
}

.header-button.logout:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.button-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    margin-bottom: 2px;
}

.button-data {
    display: block;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
}

.header-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-section img {
    height: 40px;
}

.header-title {
    margin: 0;
    color: white;
    font-weight: 700;
    font-size: 18px;
    letter-spacing: -0.02em;
}



.main-content {
    padding: 90px 20px 20px 20px;
}



.container {
    max-width: 1200px;
    margin: 0 auto;
}



.main-section {
    background: #fff5e9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    color: #1e293b;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

.section-header h2 {
    color: #1e293b;
    font-size: 1.8em;
    font-weight: 600;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s;
}

.section-header h2:hover {
    color: #27536f;
}

.collapse-toggle {
    display: inline-block;
    margin-left: 10px;
    transition: transform 0.3s;
}

.collapse-toggle.collapsed {
    transform: rotate(-90deg);
}

.refresh-btn {
    background: #27536f;
    color: #fff5e8;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(39, 83, 111, 0.2);
    text-decoration: none;
    display: inline-block;
}

.refresh-btn:hover {
    background: #fff5e8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(39, 83, 111, 0.3);
    text-decoration: none;
    color: #27536f;
}

.refresh-btn.loading {
    opacity: 0.5;
    cursor: not-allowed;
}

.counties-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
    padding-bottom: 20px;
}

.county-tag {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
    transition: all 0.2s;
    cursor: pointer;
}

.county-tag:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: scale(1.02);
}

.county-tag.active {
    background: #27536f;
    border-color: #27536f;
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(39, 83, 111, 0.4);
    cursor: pointer;
}

.county-tag.inactive {
    background: #f8fafc;
    border-color: #f1f5f9;
    color: #94a3b8;
    opacity: 0.7;
    cursor: not-allowed;
}

.special-notes {
    margin-top: 15px;
    color: #64748b;
    font-size: 0.9em;
    padding: 12px;
    background: #fef3c7;
    border-radius: 6px;
    border: 1px solid #fbbf24;
}

.progress-bar {
    background: #fff5e8;
    border-radius: 10px;
    height: 40px;
    overflow: visible;
    margin: 15px 0;
    border: 1px solid #cbd5e1;
    position: relative;
    display: flex;
    align-items: center;
}

.progress-fill {
    background: linear-gradient(90deg, #27536f, #052d47);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 0.85em;
    transition: width 0.5s ease;
    border-radius: 10px 0 0 10px;
    min-width: 60px;
    position: relative;
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e2e8f0;
    border-top: 2px solid #27536f;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.error-message {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    color: #dc2626;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: #052d47;
}

.login-box {
    background: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.login-box h1 {
    color: white;
    text-align: center;
    margin-bottom: 30px;
    font-weight: 600;
    letter-spacing: -0.025em;
}

.login-input {
    width: 100%;
    padding: 12px;
    margin-bottom: 15px;
    background: #1e293b;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: white;
    font-size: 1em;
    transition: border-color 0.2s;
}

.login-input:focus {
    outline: none;
    border-color: #27536f;
}

.login-input::placeholder {
    color: #94a3b8;
}

.login-btn {
    width: 100%;
    padding: 12px;
    background: #27536f;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(39, 83, 111, 0.2);
}

.login-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(39, 83, 111, 0.3);
}

.parcel-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

.parcel-modal.active {
    display: flex;
}

.parcel-modal-content {
    background: #fff5e9;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 30px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.parcel-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 15px;
}

.parcel-modal-header h3 {
    color: #1e293b;
    font-size: 1.5em;
    font-weight: 600;
}

.parcel-close-btn {
    background: none;
    border: none;
    color: #64748b;
    font-size: 1.8em;
    cursor: pointer;
    transition: color 0.2s;
}

.parcel-close-btn:hover {
    color: #374151;
}

.parcel-input-group {
    margin-bottom: 15px;
}

.parcel-label {
    color: #374151;
    font-size: 0.875em;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 5px;
    display: block;
}

.parcel-input {
    width: 100%;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    color: #334155;
    font-size: 0.95em;
    transition: border-color 0.2s;
}

.parcel-input:focus {
    outline: none;
    border-color: #27536f;
}

.parcel-input::placeholder {
    color: #94a3b8;
}

.parcel-search-btn {
    width: 100%;
    padding: 12px;
    background: #27536f;
    border: none;
    color: white;
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(39, 83, 111, 0.2);
    margin-top: 10px;
}

.parcel-search-btn:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(39, 83, 111, 0.3);
}

.parcel-search-btn.loading {
    opacity: 0.5;
    cursor: not-allowed;
}

.loading-indicator {
    display: none;
    text-align: center;
    padding: 30px;
    margin-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.loading-indicator.active {
    display: block;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #27536f;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

.loading-text {
    color: #64748b;
    font-size: 0.95em;
    margin-top: 10px;
}

.parcel-results {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
}

.parcel-result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 0.9em;
}

.parcel-result-label {
    color: #374151;
    font-weight: 600;
}

.parcel-result-value {
    color: #1e293b;
    text-align: right;
    word-break: break-word;
    max-width: 60%;
}

.collapsible-content {
    max-height: none;
    overflow: visible;
    transition: all 0.3s ease;
}

.collapsible-content.collapsed {
    display: none;
}

#countiesSection {
    max-height: 600px;
    overflow-y: auto;
    padding-right: 15px;
}

/* Custom scrollbar styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
}

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



/* Logs table styling */
.logs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85em;
}

.logs-table th, .logs-table td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    color: #1e293b; /* Dark gray text to match admin page */
}

.logs-table th {
    background: #f1f5f9;
    color: #1e293b;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 10;
}

.logs-table tbody {
    background: #fff5e9; /* Light cream background to match admin sections */
}

.logs-table thead th {
    cursor: pointer;
    user-select: none;
    position: sticky;
    top: 0;
    z-index: 10;
    user-select: none;
    cursor: pointer;
    padding: 12px 8px;
    transition: background-color 0.2s;
    background: #f1f5f9;
}

.logs-table thead th:hover {
    background: #e2e8f0;
}

.logs-table thead th.sortable {
    position: relative;
    padding-right: 25px;
}

.logs-table thead th .sort-icon {
    font-size: 0.9em;
    margin-right: 8px;
    opacity: 0.7;
}

.logs-table thead th .sort-arrow {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.7em;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.logs-table thead th.sort-asc .sort-arrow,
.logs-table thead th.sort-desc .sort-arrow {
    opacity: 1;
}

.logs-table tbody tr:hover {
    background: rgba(220, 38, 38, 0.05);
}

.logs-table .url-cell {
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: underline;
    text-decoration-color: #27536f;
    color: #27536f;
    display: inline-block;
    vertical-align: top;
    font-weight: 500;
}

.logs-table .url-cell:hover {
    text-decoration-color: #1e293b;
    color: #1e293b;
}

.logs-table .actions-cell {
    white-space: nowrap;
    text-align: center;
}

.logs-table .action-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    color: #64748b;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    margin: 0 2px;
    transition: all 0.2s;
    font-size: 0.8em;
    font-weight: 500;
}

.logs-table .action-btn:hover {
    background: #e2e8f0;
    border-color: #cbd5e1;
    transform: scale(1.02);
}

.logs-table .action-btn.delete {
    background: #fef2f2;
    border-color: #fecaca;
    color: #dc2626;
}

.logs-table .action-btn.delete:hover {
    background: #dc2626;
    border-color: #dc2626;
    color: white;
}

.logs-table .failure-type {
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: bold;
}

.logs-table .failure-type.no_data {
    background: rgba(220, 38, 38, 0.1);
    color: #ef4444;
}

.logs-table .failure-type.no_results {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.logs-table .failure-type.ScrapingBlocked {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}

.logs-table .failure-type.ScrapeError {
    background: rgba(220, 38, 38, 0.15);
    color: #dc2626;
}

.logs-table .failure-type.UnexpectedError {
    background: rgba(139, 69, 19, 0.1);
    color: #8b4513;
}

#logsSection {
    max-height: 800px;
    overflow-y: auto;
}

/* Additional styles */
.search-type-toggle {
    display: flex;
    margin-bottom: 15px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.search-type-toggle button {
    flex: 1;
    padding: 8px 16px;
    background: #f8fafc;
    border: none;
    color: #64748b;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.search-type-toggle button.active {
    background: #27536f;
    color: #fff5e8;
}

.parcel-address-input {
    display: none;
}

.full-api-response {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-top: 20px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85em;
    color: #64748b;
    line-height: 1.4;
    overflow-x: auto;
}

.api-response-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    padding: 10px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

.api-response-toggle input[type="checkbox"] {
    margin-right: 8px;
}

.api-response-toggle label {
    color: #64748b;
    font-size: 0.9em;
    font-weight: 500;
}

/* Console Logs Styling */
.console-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    align-items: center;
}

.console-controls input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    flex: 1;
}

.console-controls input[type="checkbox"] {
    margin-right: 8px;
}

.console-controls label {
    color: #64748b;
    font-size: 0.9em;
    font-weight: 500;
}

/* Console/Terminal-like styling */
.console-logs-container {
    background: #0f172a;
    border: 1px solid #1e293b;
    border-radius: 8px;
    padding: 15px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.85em;
    line-height: 1.4;
    color: #e2e8f0;
    overflow-x: auto;
}

.console-log-entry {
    padding: 4px 0;
    border-bottom: 1px solid #1e293b;
    white-space: pre-wrap;
    word-break: break-word;
    display: block;
}

.console-log-entry:last-child {
    border-bottom: none;
}

.console-log {
    color: #e2e8f0;
}

.console-warn {
    color: #fbbf24;
}

.console-error {
    color: #ef4444;
    font-weight: bold;
}

#consoleLogsSection {
    /* Removed max-height and overflow-y - scrolling is handled by inner container */
    /* The consoleLogsContent div (400px height) handles scrolling */
}
