:root {
    --bg-color: #fafafa;
    --card-bg: #ffffff;
    --text-main: #171717;
    --text-muted: #737373;
    --border-color: #e5e5e5;
    --accent: #171717;
    --accent-hover: #404040;
    --accent-green: #171717;
    --accent-red: #171717;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    padding: 60px 20px;
    -webkit-font-smoothing: antialiased;
}

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

.monitor-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 40px;
    margin-bottom: 32px;
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
}

.header-left { flex: 1; min-width: 250px; }

.eyebrow {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

h1 {
    font-size: 24px;
    font-weight: 500;
    letter-spacing: -0.5px;
    color: var(--text-main);
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    margin-top: 12px;
    font-size: 13px;
    color: var(--text-muted);
}

.dot {
    width: 6px;
    height: 6px;
    background: #d4d4d4;
    border-radius: 50%;
    margin-right: 8px;
}

.dot.active { background: #64748b; }

.status-indicator .divider {
    color: var(--border-color);
    margin: 0 8px;
}

.status-indicator .doc-link {
    color: var(--text-main);
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    transition: color 0.15s;
}
.status-indicator .doc-link:hover {
    color: var(--text-muted);
}

.video-progress {
    color: var(--text-main);
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.stats-row {
    display: flex;
    gap: 24px;
}

.stat-item {
    text-align: right;
}

.stat-value {
    font-size: 24px;
    font-weight: 400;
}

.stat-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.feed-tabs {
    display: flex;
    gap: 24px;
    margin-top: 40px;
    border-bottom: 1px solid var(--border-color);
}

.feed-tab {
    background: none;
    border: none;
    padding: 12px 0;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 1px solid transparent;
    transition: color 0.15s;
    margin-bottom: -1px;
}

.feed-tab:hover { color: var(--text-main); }
.feed-tab.active {
    color: var(--text-main);
    border-bottom-color: var(--text-main);
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.url-box {
    display: flex;
    gap: 8px;
    flex: 1;
}

.url-box input {
    flex-grow: 1;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    font-size: 13px;
    outline: none;
    color: var(--text-muted);
    font-family: monospace;
}

.button {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    padding: 10px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.button:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); }
.button.btn-secondary { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); }
.button.btn-secondary:hover:not(:disabled) { background: #f5f5f5; }
.button.btn-outline { background: transparent; color: var(--text-main); border: 1px solid var(--border-color); }
.button.btn-outline:hover:not(:disabled) { background: #f5f5f5; }
.button:disabled { opacity: 0.5; cursor: not-allowed; }

.download-links-row {
    margin-top: 24px;
}

.download-link {
    font-size: 13px;
    color: var(--text-main);
    text-decoration: underline;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.download-link:hover { color: var(--accent-hover); }
.download-link.disabled { color: var(--text-muted); pointer-events: none; text-decoration: none; }

.alert-banner {
    font-size: 12px;
    color: var(--text-main);
    padding: 12px 16px;
    margin-top: 24px;
    border-left: 2px solid var(--text-muted);
    background: #f5f5f5;
    display: flex;
    align-items: center;
    gap: 8px;
}
.alert-banner.error { background: #f0f0f0; color: #171717; border-left-color: #171717; }

.console-section {
    background: #111;
    margin-bottom: 32px;
}
.console-header {
    padding: 12px 16px;
    border-bottom: 1px solid #333;
    display: flex;
    justify-content: space-between;
}
.console-header h3 { color: #fff; font-size: 11px; font-weight: normal; text-transform: uppercase; letter-spacing: 1px; }
.btn-close-console { background: none; border: none; color: #666; cursor: pointer; }
.console-body {
    padding: 16px;
    max-height: 250px;
    overflow-y: auto;
    font-family: monospace;
    font-size: 12px;
    color: #aaa;
    line-height: 1.4;
}
.console-line-info { color: #aaaaaa; }
.console-line-success { color: #ffffff; }
.console-line-warning { color: #dddddd; }
.console-line-error { color: #888888; }

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.filter-left { display: flex; align-items: center; gap: 16px; }
.filter-label { font-size: 13px; color: var(--text-muted); }
.filter-toggles { display: flex; gap: 4px; }
.filter-btn {
    padding: 6px 12px;
    font-size: 12px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
    color: var(--text-muted);
}
.filter-btn.active { border-bottom: 1px solid var(--text-main); color: var(--text-main); }
.filter-count { font-size: 12px; color: var(--text-muted); }
.search-input {
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid var(--border-color);
    background: transparent;
    font-size: 13px;
    width: 200px;
    outline: none;
}
.search-input:focus { border-color: var(--text-main); }

.vehicle-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 24px;
}

.vehicle-card {
    position: relative;
}

.badge-logo, .badge-ev { display: none; } /* hide to keep sleek */
.feed-tag { display: none; }

.vehicle-img-wrap {
    width: 100%;
    aspect-ratio: 1;
    background: #f5f5f5;
    margin-bottom: 12px;
}
.vehicle-img-wrap img {
    width: 100%; height: 100%; object-fit: cover;
}
.vehicle-info { padding: 0 4px; }
.vehicle-brand-model { font-size: 13px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 4px; }
.vehicle-details { font-size: 11px; color: var(--text-muted); margin-bottom: 8px; }
.vehicle-bottom { display: flex; justify-content: space-between; align-items: center; }
.vehicle-price { font-size: 13px; font-weight: 500; }
.vehicle-price span { font-size: 10px; color: var(--text-muted); margin-left: 4px; }
.vehicle-link { font-size: 11px; color: var(--text-muted); text-decoration: underline; }
.vehicle-link:hover { color: var(--text-main); }

.loading-state, .empty-state { grid-column: 1 / -1; text-align: center; padding: 60px 0; color: var(--text-muted); font-size: 13px; }

.footer-section { margin-top: 60px; padding-top: 24px; border-top: 1px solid var(--border-color); font-size: 11px; color: var(--text-muted); }
.footer-title { margin-bottom: 12px; font-weight: 500; color: var(--text-main); }
.footer-section ul { padding-left: 16px; line-height: 1.8; }

.hidden { display: none !important; }

/* Modal Styling */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.9); z-index: 1000;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-content {
    background: #fff; width: 100%; max-width: 600px;
    display: flex; flex-direction: column; max-height: 85vh;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0,0,0,0.05);
}
.modal-header { padding: 24px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { font-size: 16px; font-weight: 500; }
.btn-close-modal { background: none; border: none; font-size: 16px; cursor: pointer; color: var(--text-muted); }
.modal-body { padding: 24px; overflow-y: auto; }
.diff-section { margin-bottom: 24px; }
.diff-section h3 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border-color); padding-bottom: 8px; }
.diff-list { list-style: none; }
.diff-list li { font-size: 13px; padding: 8px 0; display: flex; justify-content: space-between; border-bottom: 1px solid #f5f5f5; }
.diff-added { color: var(--text-main); }
.diff-removed { color: var(--text-muted); text-decoration: line-through; }
.diff-price-old { color: var(--text-muted); text-decoration: line-through; margin-right: 8px; }
.modal-footer { padding: 24px; border-top: 1px solid var(--border-color); display: flex; justify-content: flex-end; gap: 12px; background: var(--bg-color); }


/* Layout Preview Modal (Zelf Check Tool) Styles */
.preview-modal-content {
    max-width: 900px !important;
}

.preview-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 0;
    color: var(--text-muted);
}

.preview-loading-state i {
    font-size: 32px;
    margin-bottom: 16px;
    color: var(--text-main);
}

.preview-loading-state p {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--text-main);
}

.preview-loading-subtext {
    font-size: 12px;
    color: var(--text-muted);
}

.preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

@media (max-width: 768px) {
    .preview-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.preview-column {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.preview-column h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 8px;
}

.actions-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.preview-card {
    background: #fafafa;
    border: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.preview-card-title {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
}

.preview-img-wrapper {
    width: 100%;
    background: #eaeaea;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.preview-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.horizontal-wrapper {
    aspect-ratio: 16 / 9;
}

.vertical-wrapper {
    aspect-ratio: 9 / 16;
    max-height: 280px; /* Keep vertical image height elegant inside grid */
}

/* Card layout check button styling */
.vehicle-card-btn-row {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
}

.btn-card-action {
    flex: 1;
    font-size: 11px;
    padding: 6px 8px;
    cursor: pointer;
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-main);
    transition: all 0.15s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-card-action:hover {
    background: #f5f5f5;
    border-color: var(--text-main);
}

.btn-card-action.btn-preview {
    font-weight: 500;
}

.review-stars {
    color: #ffc107; /* Bright yellow */
    font-size: 16px;
    letter-spacing: 2px;
}

.review-card {
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 16px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Card Title Constraint */
.review-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em; /* 2 * 1.4 */
    line-height: 1.4;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 8px;
}
.review-card-title.expanded {
    -webkit-line-clamp: unset;
    height: auto;
}

/* Review content wrapper to push footer down */
.review-content-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* The button wrapper to keep spacing consistent even if there is no button */
.read-more-wrapper {
    min-height: 24px;
    margin-top: 4px;
}

/* Spacer to push everything below it to the bottom */
.review-spacer {
    flex-grow: 1;
}

/* Footer layout */
.review-card-footer {
    margin-top: auto;
    border-top: 1px dashed var(--border-color);
    padding-top: 12px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    font-size: 11px;
}
.review-footer-left {
    color: var(--text-muted);
    display: flex;
    align-items: flex-start;
    gap: 4px;
    white-space: nowrap;
    flex-shrink: 0;
    min-height: 32px;
}
.review-footer-right {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    min-width: 0;
    min-height: 32px;
}
.review-author {
    font-weight: 600;
    color: var(--text-main);
}
.review-city {
    color: var(--text-muted);
    font-size: 10px;
}

/* Review Source Styling */
.source-google {
    border-top: 4px solid #4285F4;
}
.source-kiyoh {
    border-top: 4px solid #ff6a00;
}
.review-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.review-text-content {
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 6.4em;
}
.review-text-content.expanded {
    -webkit-line-clamp: unset;
    height: auto;
}
.read-more-btn {
    background: none;
    border: none;
    color: var(--accent);
    padding: 0;
    font-size: 11px;
    cursor: pointer;
    text-decoration: underline;
    font-weight: 500;
}
.read-more-btn:hover {
    color: var(--text-muted);
}

.review-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge-google {
    background-color: rgba(66, 133, 244, 0.1);
    color: #4285F4;
}
.badge-kiyoh {
    background-color: rgba(255, 106, 0, 0.1);
    color: #d95a00;
}

/* Aggregate Widgets */
.widget-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 16px 18px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 210px;
    flex: 0 0 210px;
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}
.widget-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 12px rgba(0,0,0,0.1);
}
.widget-card.source-google {
    border-top: 4px solid #4285F4;
}
.widget-card.source-kiyoh {
    border-top: 4px solid #ff6a00;
}
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}
.widget-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-color);
}
.widget-score {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
}
.widget-bottom {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-top: 8px;
}
.widget-total {
    font-size: 13px;
    color: var(--text-muted);
}
