/* Configuration Page Styles */

:root {
    --primary-color: #4361ee;
    --primary-light: #e0e7ff;
    --secondary-color: #3a0ca3;
    --accent-color: #f72585;
    --text-color: #2b2d42;
    --text-light: #6c757d;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --success-color: #4cc9f0;
    --warning-color: #f8961e;
    --danger-color: #ef233c;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
    --border-radius: 12px;
    --border-radius-sm: 6px;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: var(--text-color);
    background-color: var(--bg-color);
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* Configuration Header */
.config-header {
    background: linear-gradient(135deg, #2b2d42 0%, #353850 100%);
    color: white;
    padding: 2rem 2rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
}

.config-header h1 {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 2rem;
    margin: 0 0 0.5rem 0;
    font-weight: 700;
    color: white;
}

.config-header h1 svg {
    width: 40px;
    height: 40px;
    fill: white;
}

.config-header p {
    margin: 0;
    opacity: 0.9;
    font-size: 1rem;
    color: white;
}

/* Scraper Status Section */
.scraper-status-section {
    margin-bottom: 3rem;
}

.scraper-status-section h2 {
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-weight: 600;
}

.scraper-status-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

/* Status Card Base */
.status-card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.status-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--border-color);
}

.card-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-color);
    font-weight: 600;
}

.card-icon {
    width: 28px;
    height: 28px;
    color: var(--primary-color);
}

/* Countdown Card */
.countdown-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
}

.countdown-card .card-header {
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.countdown-card h3 {
    color: white;
}

.countdown-card .card-icon {
    color: rgba(255, 255, 255, 0.9);
}

.countdown-display {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    padding: 2rem 1rem;
    background: rgba(0, 0, 0, 0.1);
    border-radius: var(--border-radius-sm);
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

.countdown-value {
    font-size: 2.5rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.countdown-label {
    font-size: 0.75rem;
    opacity: 0.9;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.countdown-separator {
    font-size: 2rem;
    font-weight: 300;
    opacity: 0.6;
    margin: 0 0.25rem;
}

/* Info Card */
.info-card {
    background: var(--card-bg);
}

.status-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.status-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-color);
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    flex-wrap: nowrap;
}

.status-row:hover {
    background: #f0f1f5;
}

.status-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.95rem;
    flex-shrink: 0;
}

.status-value {
    font-weight: 500;
    color: var(--text-color);
    font-size: 0.85rem;
    white-space: nowrap;
    text-align: right;
    flex-shrink: 1;
    min-width: 0;
}

/* Status badge colors */
.status-completed {
    background: linear-gradient(135deg, #4cc9f0 0%, #0096c7 100%);
    color: white !important;
    padding: 0.3rem 0.8rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
}

.status-running {
    background: linear-gradient(135deg, #f8961e 0%, #f3722c 100%);
    color: white !important;
    padding: 0.3rem 0.8rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
    animation: pulse 1.5s ease-in-out infinite;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

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

.status-error {
    background: linear-gradient(135deg, #ef233c 0%, #d62828 100%);
    color: white !important;
    padding: 0.3rem 0.8rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
}

.status-unknown {
    background: linear-gradient(135deg, #9b59b6 0%, #7d3c98 100%);
    color: white !important;
    padding: 0.3rem 0.8rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.85rem;
}

/* Highlight values */
.highlight-new {
    background: linear-gradient(135deg, #4cc9f0 0%, #0096c7 100%);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

.highlight-updated {
    background: linear-gradient(135deg, #f8961e 0%, #f3722c 100%);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

.highlight-total {
    background: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
}

/* Error row */
.error-row {
    background: #ffe0e0;
    border-left: 4px solid var(--danger-color);
}

.error-row .status-value.error {
    color: var(--danger-color);
}

/* Metrics Card */
.metrics-card {
    background: var(--card-bg);
    display: block;
    min-height: auto;
    grid-column: auto;
}

.metrics-container {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    width: 100%;
}

.metric-item {
    padding: 0.75rem 0;
    width: 100%;
}

.metric-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.95rem;
}

.metric-value {
    font-weight: 700;
    font-size: 1.15rem;
    min-width: 50px;
    text-align: right;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: var(--bg-color);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    position: relative;
    min-width: 0;
}

.progress-fill {
    height: 100%;
    border-radius: 12px;
    transition: width 0.6s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    overflow: hidden;
}

.cpu-fill {
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.ram-fill {
    background: linear-gradient(90deg, #f093fb 0%, #f5576c 100%);
}

.disk-fill {
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
}

.load-fill {
    background: linear-gradient(90deg, #fa709a 0%, #fee140 100%);
}

.metric-info {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 0.35rem;
    padding-left: 2px;
}

/* Details Card */
.details-card {
    grid-column: 1 / -1;
    background: var(--card-bg);
}

.scraper-details-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.scraper-detail-section {
    margin-bottom: 1.25rem;
    padding: 1rem;
    background-color: #f9f9f9;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.scraper-detail-section h4 {
    margin: 0 0 0.75rem 0;
    color: var(--text-color);
    font-size: 1.1em;
    font-weight: 700;
}

/* Responsive grid for scraper pages */
.scraper-pages-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.scraper-page-item {
    padding: 0.75rem;
    background-color: #ffffff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.25rem;
}

.scraper-page-label {
    color: #666;
    font-size: 0.8em;
    font-weight: 500;
}

.scraper-page-count {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 1.1em;
}

/* Total summary section */
.scraper-total-summary {
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, #5562f7 0%, #6722ce 100%);
    border-radius: 6px;
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.total-offers {
    font-size: 1.3em;
    display: block;
    font-weight: 700;
}

.total-info {
    font-size: 0.85em;
    opacity: 0.95;
    font-weight: 500;
}

/* Animations */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes spin-char {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* ============================================================================
 * DUPLICATES MANAGEMENT STYLES
 * ============================================================================ */

.duplicates-management-section {
    width: 100%;
    margin-top: -5rem;
}

.duplicates-management-section h2 {
    font-size: 1.5rem;
    margin: 0 0 2rem 0;
    color: var(--text-color);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.duplicates-management-section h2 svg {
    width: 28px;
    height: 28px;
    fill: var(--primary-color);
}

/* Empty State */
.duplicates-empty-state {
    text-align: center;
    padding: 3rem 2rem;
    background-color: rgba(76, 201, 240, 0.05);
    border-radius: var(--border-radius);
    border: 2px dashed var(--success-color);
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    fill: var(--success-color);
    opacity: 0.8;
}

.duplicates-empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.duplicates-empty-state p {
    color: var(--text-light);
    margin: 0;
}

/* Summary Section */
.duplicates-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin-bottom: 2rem;
}

.summary-stat {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--border-radius-sm);
}

.summary-label {
    color: var(--text-light);
    font-size: 0.95rem;
    font-weight: 500;
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    min-width: 80px;
}

/* Grid Section */
.duplicates-grid-section {
    width: 100%;
}

.duplicates-grid-container {
    width: 100%;
}

/* Groups Container */
.duplicates-groups {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Single Duplicate Group */
.duplicate-group {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 2rem;
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.duplicate-group:hover {
    box-shadow: var(--shadow-md);
}

/* Original Property Card */
.original-property-card {
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(67, 97, 238, 0.08), rgba(76, 201, 240, 0.08));
    border-radius: var(--border-radius-sm);
    border: 2px solid rgba(67, 97, 238, 0.2);
}

.property-item-group {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.group-title-badge {
    display: inline-block;
    width: fit-content;
    padding: 0.4rem 0.8rem;
    background-color: var(--success-color);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.group-property-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    line-height: 1.4;
}

.group-property-details {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0;
    border-top: 1px solid rgba(67, 97, 238, 0.1);
    border-bottom: 1px solid rgba(67, 97, 238, 0.1);
}

.group-property-details .detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.group-property-details .detail-label {
    color: var(--text-light);
    font-weight: 500;
}

.group-property-details .detail-value {
    color: var(--text-color);
    font-weight: 600;
}

.group-view-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    border: none;
    cursor: pointer;
}

.group-view-link:hover {
    background-color: var(--secondary-color);
    transform: translateX(2px);
}

.link-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Duplicates Section */
.duplicates-section {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.duplicates-section-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color);
}

.duplicates-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 500px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.duplicates-list::-webkit-scrollbar {
    width: 6px;
}

.duplicates-list::-webkit-scrollbar-track {
    background: var(--bg-color);
    border-radius: 3px;
}

.duplicates-list::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.duplicates-list::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Duplicate Item */
.duplicate-item {
    display: grid;
    grid-template-columns: 50px 1fr 40px;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    background-color: var(--bg-color);
    border-radius: var(--border-radius-sm);
    border-left: 4px solid var(--warning-color);
    transition: var(--transition);
}

.duplicate-item:hover {
    background-color: rgba(248, 150, 30, 0.05);
    border-left-color: var(--danger-color);
}

.duplicate-match-score {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f8961e, #fbc078);
    color: white;
    border-radius: var(--border-radius-sm);
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
}

.duplicate-match-score span {
    font-size: 1rem;
}

.duplicate-content {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 0;
}

.duplicate-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.duplicate-details {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    background-color: white;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 0.8rem;
}

.chip-label {
    color: var(--text-light);
    font-weight: 500;
}

.chip-value {
    color: var(--text-color);
    font-weight: 600;
}

.duplicate-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(67, 97, 238, 0.1);
    border-radius: var(--border-radius-sm);
    color: var(--primary-color);
    transition: var(--transition);
    border: none;
    cursor: pointer;
    padding: 0;
}

.duplicate-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: scale(1.1);
}

.duplicate-link svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* ============================================================================
   CONFIGURATION SECTION
   ============================================================================ */

.configuration-section {
    margin: 3rem 0 2rem 0;
}

.configuration-section h2 {
    font-size: 1.5rem;
    margin: 0 0 1.5rem 0;
    color: var(--text-color);
    font-weight: 600;
}

.config-form-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.form-label svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    fill: var(--primary-color);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text-color);
    background: var(--card-bg);
    transition: var(--transition);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    background: linear-gradient(to bottom, var(--card-bg), rgba(67, 97, 238, 0.02));
}

.form-input:disabled {
    background: var(--bg-color);
    color: var(--text-light);
    cursor: not-allowed;
}

.form-hint {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 0.5rem;
    line-height: 1.5;
}

.form-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.save-status {
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    display: inline-block;
}

.save-status.success {
    color: #099268;
    background: rgba(76, 201, 240, 0.1);
}

.save-status.error {
    color: var(--danger-color);
    background: rgba(239, 35, 60, 0.1);
}

.save-status.saving {
    color: var(--warning-color);
    background: rgba(248, 150, 30, 0.1);
}

/* ============================================================================
   SYSTEM LOGS SECTION
   ============================================================================ */

.system-logs-section {
    margin-top: -5rem;
    margin-bottom: 1rem;
    padding: 0 15rem;
}

.system-logs-section h2 {
    font-size: 1.2rem;
    margin: 0 0 1rem 0;
    color: var(--text-color);
    font-weight: 600;
    letter-spacing: -0.25px;
}

/* Logs Toolbar */
.logs-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(67, 97, 238, 0.02) 100%);
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: var(--shadow-sm);
}

/* Log Statistics */
.logs-stats {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.8rem;
    background: rgba(255, 255, 255, 0.01);
    border-radius: var(--border-radius-sm);
    font-size: 0.8rem;
    border: 1px solid rgba(255, 255, 255, 0.03);
}

.stat-item.error {
    background: rgba(239, 35, 60, 0.05);
    border: 1px solid rgba(239, 35, 60, 0.15);
    border-left: 2px solid var(--danger-color);
}

.stat-item.warning {
    background: rgba(248, 150, 30, 0.05);
    border: 1px solid rgba(248, 150, 30, 0.15);
    border-left: 2px solid var(--warning-color);
}

.stat-item.info {
    background: rgba(67, 97, 238, 0.05);
    border: 1px solid rgba(67, 97, 238, 0.15);
    border-left: 2px solid var(--primary-color);
}

.stat-label {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.8rem;
}

.stat-value {
    font-weight: 700;
    color: var(--text-color);
    font-size: 1rem;
    min-width: 20px;
    text-align: center;
}

.stat-item.error .stat-value {
    color: var(--danger-color);
}

.stat-item.warning .stat-value {
    color: var(--warning-color);
}

.stat-item.info .stat-value {
    color: var(--primary-color);
}

/* Log Controls */
.logs-controls {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
}

.log-filter {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    background: var(--card-bg);
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
}

.btn-clear-logs,
.btn-scroll-bottom {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius-sm);
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(67, 97, 238, 0.2);
}

/* Logs Console */
.logs-console {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 100%);
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(255, 255, 255, 0.06);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    height: 600px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.logs-console::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(79, 195, 247, 0.3), transparent);
}

.logs-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    font-family: 'Fira Code', 'Monaco', 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    line-height: 1.7;
    color: #b1bac4;
}

.logs-container::-webkit-scrollbar {
    width: 10px;
}

.logs-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}

.logs-container::-webkit-scrollbar-thumb {
    background: rgba(79, 195, 247, 0.2);
    border-radius: 5px;
    border: 2px solid rgba(255, 255, 255, 0.01);
}

/* Log Entry - Console Format */
.log-entry {
    display: block;
    padding: 0.4rem 0;
    margin: 0;
    border-left: none;
    background: transparent;
    border-radius: 0;
    border: none;
    font-family: 'Fira Code', 'Monaco', 'Courier New', Courier, monospace;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.log-entry:hover {
    background: rgba(79, 195, 247, 0.05);
    padding-left: 0.5rem;
    margin-left: -0.5rem;
}

.log-time {
    font-weight: 400;
    font-size: 0.8rem;
    opacity: 0.8;
}

.log-level-badge {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.log-category-badge {
    font-size: 0.8rem;
    font-weight: 600;
}

.log-message {
    word-break: break-word;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: pre-wrap;
}

/* Details Row */
.log-details-row {
    display: none;
}

.log-details-text {
    white-space: pre-wrap;
    word-break: break-word;
}

.log-details {
    font-size: 0.75rem;
    padding: 0.6rem 0.8rem;
    max-height: 120px;
}

.logs-empty-state, .logs-loading {
    font-size: 0.9rem;
}

/* ===== TABS STYLES ===== */

.tabs-container {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.tabs-nav {
    display: flex;
    gap: 0;
    border-bottom: 2px solid var(--border-color);
    padding: 0;
    background: linear-gradient(to right, #fafafa 0%, #ffffff 100%);
}

.tab-button {
    flex: 1;
    padding: 1.2rem 1.5rem;
    border: none;
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    white-space: nowrap;
    position: relative;
}

.tab-button:hover {
    background-color: #f5f5f5;
    color: var(--primary-color);
}

.tab-button.active {
    color: var(--primary-color);
    background-color: white;
    font-weight: 600;
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(to right, var(--primary-color), var(--accent-color));
}

.tab-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.tab-content-wrapper {
    padding: 2rem;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== DUPLICATES LIST STYLES ===== */

.duplicates-list-section {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.duplicates-list-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--text-color);
}

.duplicates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(800px, 1fr));
    gap: 1.5rem;
}

.duplicate-pair-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.duplicate-pair-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-2px);
}

.pair-header {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.pair-header h4 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.match-score {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.pair-content {
    display: flex;
    align-items: center;
    padding: 1.5rem;
    gap: 1rem;
}

.property-item {
    flex: 1;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--border-color);
}

.property-item.duplicate {
    border-left: 3px solid var(--danger-color);
}

.property-item.original {
    border-left: 3px solid var(--success-color);
}

.property-title {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
    color: var(--text-light);
}

.property-item p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
    color: var(--text-color);
}

.property-item strong {
    color: var(--text-color);
    font-weight: 600;
}

.portal-link {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1rem;
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    transition: var(--transition);
}

.portal-link:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.comparison-indicator {
    width: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.indicator-line {
    width: 2px;
    height: 100%;
    background: linear-gradient(to bottom, var(--danger-color), #ccc, var(--success-color));
    border-radius: 1px;
}

/* ============================================================================
 * ENHANCED LOG DETAILS STYLING
 * ============================================================================ */

/* Log details container grid layout */
.log-details-container {
    margin-top: 0.75rem;
    padding: 0.75rem 0 0 0;
}

.log-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

/* Individual detail items */
.detail-item {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.85rem;
    border-left: 3px solid rgba(255, 255, 255, 0.1);
    transition: all 0.2s ease;
}

.detail-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-left-color: rgba(255, 255, 255, 0.3);
}

/* Detail labels and values */
.detail-label {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.detail-value {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 500;
}

.detail-numeric {
    font-size: 0.95rem;
    font-weight: 700;
    font-family: 'Fira Code', 'Courier New', monospace;
    color: #4fc3f7;
}

/* Highlight styles for specific metrics */
.detail-item.highlight-new {
    border-left-color: #4cc9f0;
    background: rgba(76, 201, 240, 0.1);
}

.detail-item.highlight-new:hover {
    background: rgba(76, 201, 240, 0.15);
}

.detail-item.highlight-new .detail-numeric {
    color: #4cc9f0;
}

.detail-item.highlight-updated {
    border-left-color: #f8961e;
    background: rgba(248, 150, 30, 0.1);
}

.detail-item.highlight-updated:hover {
    background: rgba(248, 150, 30, 0.15);
}

.detail-item.highlight-updated .detail-numeric {
    color: #f8961e;
}

.detail-item.highlight-alerts {
    border-left-color: #f5576c;
    background: rgba(245, 87, 108, 0.1);
}

.detail-item.highlight-alerts:hover {
    background: rgba(245, 87, 108, 0.15);
}

.detail-item.highlight-alerts .detail-numeric {
    color: #f5576c;
}

/* Plain text details fallback */
.log-details-plain {
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.9);
    border-left: 3px solid rgba(255, 255, 255, 0.1);
}

/* ============================================================================
 * DARK MODE STYLING FOR CONFIGURATION PAGE
 * ============================================================================ */

html.dark-mode .tabs-nav {
    background: #1f1f33; /* Darker background for the tab navigation bar */
    border-bottom: 1px solid #3a3a4f; /* Softer border */
}

html.dark-mode .tab-button {
    color: #8d99ae; /* Lighter text for better readability */
    background-color: transparent;
    border: none;
    transition: background-color 0.3s, color 0.3s;
}

html.dark-mode .tab-button:hover {
    color: #e0e6f1; /* Brighter text on hover */
    background-color: #2d2d40; /* Subtle background highlight on hover */
}

html.dark-mode .tab-button.active {
    color: #ffffff; /* White text for active tab */
    background-color: #3a0ca3; /* Use secondary color for active tab background */
    font-weight: 600;
}

html.dark-mode .tab-button.active::after {
    background: var(--accent-color); /* Use accent color for the active indicator */
}

html.dark-mode .tab-icon {
    fill: currentColor; /* Ensure icon color matches text color */
}

/* Duplicates Management in Dark Mode */
html.dark-mode .duplicates-management-section h2 {
    color: #e4e4e7;
}

html.dark-mode .duplicates-management-section h2 svg {
    fill: #8ab4f8;
}

html.dark-mode .duplicates-empty-state {
    background-color: rgba(138, 180, 248, 0.05);
    border-color: #6d8fd8;
}

html.dark-mode .duplicates-empty-state h3 {
    color: #e4e4e7;
}

html.dark-mode .duplicates-empty-state p {
    color: #a0a0b8;
}

html.dark-mode .duplicates-summary {
    background-color: #27273a;
    border-color: #3a3a4f;
}

html.dark-mode .summary-stat {
    background-color: #1f1f33;
}

html.dark-mode .summary-label {
    color: #a0a0b8;
}

html.dark-mode .summary-value {
    color: #8ab4f8;
}

html.dark-mode .duplicate-group {
    background-color: #27273a;
    border-color: #3a3a4f;
}

html.dark-mode .duplicate-group:hover {
    box-shadow: 0 8px 24px rgba(138, 180, 248, 0.08);
}

html.dark-mode .original-property-card {
    background: linear-gradient(135deg, rgba(138, 180, 248, 0.06), rgba(138, 180, 248, 0.04));
    border-color: rgba(138, 180, 248, 0.2);
}

html.dark-mode .group-title-badge {
    background-color: #6d8fd8;
    color: #ffffff;
}

html.dark-mode .group-property-title {
    color: #e4e4e7;
}

html.dark-mode .group-property-details {
    border-top-color: rgba(138, 180, 248, 0.15);
    border-bottom-color: rgba(138, 180, 248, 0.15);
}

html.dark-mode .group-property-details .detail-label {
    color: #a0a0b8;
}

html.dark-mode .group-property-details .detail-value {
    color: #e4e4e7;
}

html.dark-mode .group-view-link {
    background-color: rgba(67, 97, 238, 0.8); /* Use primary color with 80% opacity */
    color: white;
}

html.dark-mode .group-view-link:hover {
    background-color: rgba(67, 97, 238, 1); /* Full primary color on hover */
}

html.dark-mode .duplicates-section-title {
    color: #e4e4e7;
    border-bottom-color: #3a3a4f;
}

html.dark-mode .duplicates-list {
    scrollbar-color: #6d8fd8 #1f1f33;
}

html.dark-mode .duplicates-list::-webkit-scrollbar {
    width: 6px;
}

html.dark-mode .duplicates-list::-webkit-scrollbar-track {
    background: #1f1f33;
}

html.dark-mode .duplicates-list::-webkit-scrollbar-thumb {
    background: #6d8fd8;
    border-radius: 3px;
}

html.dark-mode .duplicate-item {
    background-color: #1f1f33;
    border-left-color: var(--warning-color);
}

html.dark-mode .duplicate-item:hover {
    background-color: #2d2d40;
    border-left-color: var(--danger-color);
}

html.dark-mode .duplicate-match-score {
    /* Removed override to use the same opaque gradient as light mode */
}

html.dark-mode .duplicate-title {
    color: #e4e4e7;
}

html.dark-mode .detail-chip {
    background-color: #27273a;
    border-color: #3a3a4f;
}

html.dark-mode .chip-label {
    color: #a0a0b8;
}

html.dark-mode .chip-value {
    color: #e4e4e7;
}

html.dark-mode .duplicate-link {
    background-color: rgba(138, 180, 248, 0.15);
    color: #8ab4f8;
}

html.dark-mode .duplicate-link:hover {
    background-color: #8ab4f8;
    color: #1f1f33;
}

html.dark-mode .status-row:hover {
    background: #2d2d40;
}

html.dark-mode .scraper-detail-section {
    background-color: #27273a;
    border-left-color: #8ab4f8;
}

html.dark-mode .scraper-detail-section h4 {
    color: #e4e4e7;
}

html.dark-mode .scraper-page-item {
    background-color: #1f1f33;
    border-color: #3a3a4f;
}

html.dark-mode .scraper-page-label {
    color: #a0a0b8;
}

html.dark-mode .scraper-page-count {
    color: #8ab4f8;
}

html.dark-mode .scraper-total-summary {
    background: linear-gradient(135deg, #3a0ca3 0%, #4361ee 100%);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .scraper-status-cards {
        grid-template-columns: 1fr;
    }
    .log-details-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    .duplicates-grid {
        grid-template-columns: repeat(auto-fill, minmax(600px, 1fr));
    }
}

@media (max-width: 768px) {
    .app-container {
        padding: 1rem;
    }

    .config-header {
        padding: 1.5rem;
        margin-bottom: 1.5rem;
    }

    .config-header h1 {
        font-size: 1.6rem;
        gap: 0.75rem;
    }

    .config-header h1 svg {
        width: 32px;
        height: 32px;
    }

    .status-card {
        padding: 1.5rem;
    }

    .countdown-display {
        padding: 1.5rem 0.75rem;
        gap: 0.5rem;
    }

    .countdown-value {
        font-size: 2rem;
    }

    .countdown-separator {
        font-size: 1.8rem;
    }

    .scraper-status-cards {
        gap: 1.5rem;
    }

    .system-logs-section, .duplicates-management-section {
        margin-top: 2rem;
        padding: 0;
    }

    .logs-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .logs-stats {
        justify-content: space-around;
    }

    .logs-console {
        height: 400px;
    }

    .duplicate-group {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .duplicates-summary {
        grid-template-columns: 1fr;
        padding: 1.5rem;
    }

    .tabs-nav {
        overflow-x: auto;
    }

    .tab-button {
        flex-shrink: 0;
    }

    .duplicates-grid {
        grid-template-columns: 1fr;
    }

    .pair-content {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .app-container {
        padding: 0.75rem;
    }

    .config-header {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .config-header h1 {
        font-size: 1.4rem;
    }

    .config-header h1 svg {
        width: 28px;
        height: 28px;
    }

    .status-card {
        padding: 1rem;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .countdown-display {
        flex-wrap: wrap;
    }

    .countdown-value {
        font-size: 1.5rem;
    }

    .status-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .metric-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    .logs-stats {
        flex-direction: column;
        align-items: stretch;
    }

    .log-details-grid {
        grid-template-columns: 1fr;
    }

    .duplicates-actions {
        flex-direction: column;
    }

    .tab-button {
        font-size: 0.65rem;
        padding: 4px 4px;
        flex: 1;
        min-width: 0;
        white-space: normal;
        word-break: break-word;
        gap: 4px;
        line-height: 1.2;
    }
    
    .tabs-nav {
        gap: 0;
        padding: 0;
    }
    
    .tab-icon {
        width: 16px;
        height: 16px;
        flex-shrink: 0;
    }

    .tab-content-wrapper {
        padding: 1rem;
    }
}
