@import url('https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&display=swap');

/* RANK AI Shopify Extension - Optimized Styles */

/* CSS Variables */
:root {
    --color-primary: #667eea;
    --color-brand: #563ac9;
    --color-brand-dark: #221750;
    --color-brand-light: #6e57cc;
    --color-text: #2c3e50;
    --color-text-muted: #666;
    --color-text-light: #999;
    --color-success: #28a745;
    --color-danger: #dc3545;
    --color-danger-dark: #c82333;
    --color-warning: #ffc107;
    --color-border: #e9ecef;
    --color-bg-light: #f8f9fa;
    --color-bg-white: white;
    --radius-sm: 3px;
    --radius-md: 4px;
    --radius-lg: 6px;
    --radius-xl: 8px;
    --transition: all 0.2s;
}

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

body {
    font-family: Barlow, system-ui, -apple-system, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    color: #333;
    background: #f9f9f9;
    min-height: 100vh;
    padding: 20px;
}

/* Container */
.rank-container {
    background: var(--color-bg-white);
    border-radius: var(--radius-xl);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
    max-width: 1200px;
    margin: 0 auto;
    min-height: 920px;
    position: relative;
}

/* Header */
.rank-header {
    background: linear-gradient(135deg, var(--color-brand-dark) 0%, var(--color-brand) 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.rank-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon { width: 24px; height: 24px; }

.rank-logo h1 {
    font-size: 19px;
    font-weight: 600;
    margin: 0;
}

.rank-version { font-size: 13px; opacity: 0.8; }

/* Connection Status */
.connection-status {
    padding: 12px 20px;
    background: var(--color-bg-light);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-warning);
}

.status-indicator.connected { background: var(--color-success); }
.status-indicator.disconnected { background: var(--color-danger); }
.status-indicator.warning { background: var(--color-warning); }

/* Active Job Notification Bar */
.active-job-bar {
    padding: 10px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    animation: pulse-bg 2s ease-in-out infinite;
}

@keyframes pulse-bg {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.9; }
}

.active-job-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    font-weight: 500;
}

.active-job-icon {
    animation: spin 2s linear infinite;
}

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

.active-job-bar .button-small {
    padding: 6px 14px;
    font-size: 13px;
    background: white;
    color: var(--color-brand);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.active-job-bar .button-small:hover {
    background: #f0f0f0;
    transform: scale(1.02);
}

/* Connection Tabs */
.connection-tabs {
    display: flex;
    margin: 16px 0;
    border-bottom: 2px solid var(--color-border);
}

.conn-tab {
    flex: 1;
    padding: 12px 16px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--color-text-muted);
    transition: var(--transition);
}

.conn-tab:hover { background: var(--color-bg-light); }

.conn-tab.active {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
    background: var(--color-bg-light);
}

.connection-panel { display: none; padding-top: 16px; }
.connection-panel.active { display: block; }

/* OAuth Pending */
.oauth-pending {
    background: #fff9e6;
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.pending-icon { font-size: 49px; margin-bottom: 10px; }
.oauth-pending h4 { color: var(--color-text); font-size: 17px; margin-bottom: 8px; }
.oauth-pending p { color: var(--color-text-muted); font-size: 14px; margin-bottom: 8px; }
.pending-note { font-size: 13px; color: var(--color-text-light); font-style: italic; }

/* Sections */
.section { padding: 20px; }
.section h3 { font-size: 17px; font-weight: 600; margin-bottom: 16px; color: var(--color-text); }
.description { color: var(--color-text-muted); margin-bottom: 20px; font-size: 14px; line-height: 1.5; }

/* Form Controls - Consolidated */
.shop-input, .api-input, .fixes-search-input, select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 14px;
    background: var(--color-bg-white);
    transition: var(--transition);
}

.shop-input, .api-input {
    flex: 1;
    max-width: 450px;
}

.shop-input:focus, .api-input:focus, .fixes-search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

select { width: 100%; }

.input-group {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

#shop-domain-oauth { opacity: 0.7; font-size: 14px; }
.help-text { color: var(--color-text-muted); font-size: 12px; padding-top: 8px; }

/* Buttons - Consolidated */
.button, .rollback-btn, .csv-export-btn, .page-btn, .rollback-session-btn {
    padding: 8px 16px;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    background: var(--color-bg-white);
    color: #333;
}

.button:hover, .page-btn:hover { background: var(--color-bg-light); }
.button:disabled, .page-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.button-primary {
    background: var(--color-brand);
    color: white;
    border-color: #30216b;
}

.button-primary:hover { background: var(--color-brand-light); }

.fix-button {
    width: 100%;
    padding: 10px;
    background: var(--color-brand);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.fix-button:hover:not(:disabled) { background: var(--color-brand-light); }

.fix-button:disabled {
    background: #E0E7FF;
    cursor: not-allowed;
    color: #413f59;
}

.button-secondary {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}

#disconnect-store:hover { background: #6c757d; opacity: 0.8; }

.rollback-btn, .rollback-session-btn {
    background: var(--color-danger);
    color: white;
    border: none;
    padding: 6px 12px;
    font-size: 13px;
}

.rollback-btn:hover, .rollback-session-btn:hover:not(:disabled) { background: var(--color-danger-dark); }
.rollback-session-btn:disabled { background: #6c757d; cursor: not-allowed; }

.csv-export-btn {
    background: var(--color-bg-light);
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
}

.csv-export-btn:hover { background: var(--color-border); border-color: #ccc; }
.csv-export-btn:disabled { opacity: 0.6; cursor: wait; }

.page-btn { padding: 6px 12px; border-radius: var(--radius-sm); font-size: 13px; }
.page-btn:hover { border-color: var(--color-primary); }
.page-btn.active { background: var(--color-primary); color: white; border-color: var(--color-primary); }

/* Tab Navigation */
.tab-nav {
    display: flex;
    gap: 16px;
    border-bottom: 2px solid #96afc8;
    background: var(--color-bg-white);
    padding: 0 8px;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: #e2e3ec;
    color: #413f5b;
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    font-weight: bold;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.tab-btn:hover { background: rgba(102, 126, 234, 0.1); }
.tab-btn.active { background: rgb(241, 243, 254); color: var(--color-brand); }

.tab-content { display: none; padding: 20px; }
.tab-content.active { display: block; }

/* AI Credits Display */
.ai-credits-display {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, rgb(149 122 252) 0%, rgb(49, 46, 129) 100%);
    color: white;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    max-width: 200px;
}

.credits-label { font-weight: 600; }
.credits-value { font-weight: 700; font-size: 14px; }
.credits-separator { opacity: 0.7; }
.credits-total { opacity: 0.9; }

/* Health Issues */
.health-issues-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 20px;
}

.issue-type {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    background: var(--color-bg-white);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.issue-type.no-issues {
    border-color: rgb(52, 211, 153);
    border-width: 1px;
}

.issue-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.issue-icon { font-size: 19px; }
.issue-label { flex: 1; font-weight: 600; color: var(--color-text); }
.issue-count {
    font-size: 13px;
    color: var(--color-text-muted);
    background: var(--color-bg-light);
    padding: 4px 8px;
    border-radius: 12px;
}

/* Processing Area */
.processing-area {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    background: var(--color-bg-light);
    margin-top: 16px;
    min-height: 430px;
}

.processing-area h3 { color: var(--color-success); margin-bottom: 8px; }

.progress-container { margin: 16px 0; }

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-success);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text { font-size: 13px; color: var(--color-text-muted); margin-top: 8px; }

.processing-log {
    height: 350px;
    overflow-y: auto;
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin: 12px 0;
    font-size: 14px;
}

.log-entry { margin-bottom: 8px; padding: 2px 0; }
.log-entry.success { color: #333; }
.log-entry.error { color: var(--color-danger); }
.log-entry.processing { color: var(--color-warning); }
.log-entry.warning { color: #856404; }
.log-entry a { color: inherit; text-decoration: underline; word-break: break-all; font-weight: 500; }
.log-entry a:hover { opacity: 0.8; }

.processing-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.proceed-info {
    background: #e7f3ff;
    border-left: 3px solid var(--color-primary);
    padding: 12px;
    margin: 12px 0;
    border-radius: var(--radius-md);
    font-size: 13px;
    line-height: 1.5;
    color: var(--color-text);
}

/* Fixes Accordion */
.fixes-accordion { margin: 16px 0 20px; }

.fix-category {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    overflow: hidden;
}

.fix-category.no-fixes { opacity: 0.6; }
.fix-category.no-fixes .category-header { cursor: default; }
.fix-category.no-fixes .category-header:hover { background: var(--color-bg-light); }

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--color-bg-light);
    cursor: pointer;
    transition: background 0.2s;
}

.category-header:hover { background: var(--color-border); }

.category-icon { font-size: 17px; }
.category-label { flex: 1; font-weight: 500; color: var(--color-text); }

.fix-count {
    background: var(--color-primary);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
}

.fix-count.error { background: var(--color-danger); }

.expand-icon {
    font-size: 13px;
    color: var(--color-text-muted);
    transition: transform 0.2s;
}

.fix-category.expanded .expand-icon { transform: rotate(180deg); }

.category-content {
    display: none;
    padding: 16px;
    background: var(--color-bg-white);
    border-top: 1px solid var(--color-border);
}

.fix-category.expanded .category-content { display: block; }

/* Fixes Footer */
.fixes-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--color-border);
}

/* Settings */
.setting-group {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--color-border);
}

.setting-group:last-child { border-bottom: none; }
.setting-group label { display: block; font-weight: 500; margin-bottom: 8px; color: var(--color-text); }
.setting-value { color: var(--color-text-muted); margin-bottom: 8px; font-size: 14px; }
.current-value { color: var(--color-text-muted); font-size: 13px; margin-top: 4px; display: block; }

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 12px;
}

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

/* Inline Spinner (for use in text) */
.spinner-inline {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid var(--color-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

/* Notifications */
.notifications { position: fixed; top: 20px; right: 20px; z-index: 1000; }

.notification {
    background: var(--color-bg-white);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    font-size: 14px;
    max-width: 300px;
}

.notification.success { border-left: 4px solid var(--color-success); }
.notification.error { border-left: 4px solid var(--color-danger); }
.notification.warning { border-left: 4px solid var(--color-warning); }

/* Rollback Section */
.rollback-section {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
}

.rollback-section h4 { font-size: 15px; font-weight: 600; margin-bottom: 12px; color: var(--color-text); }

.rollback-session {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 12px;
}

.rollback-session h5 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.rollback-session p { font-size: 13px; color: var(--color-text-muted); margin-bottom: 8px; }

/* Fixes List */
.fixes-list { max-height: 700px; overflow-y: auto; }

.fix-item {
    border-bottom: 1px solid #f1f3f4;
    padding: 16px;
    transition: opacity 0.2s;
}

.fix-item:last-child { border-bottom: none; }

.fix-item.rolled-back {
    opacity: 0.6;
    background: var(--color-bg-light);
}

.fix-item.rolled-back .fix-content {
    background: var(--color-border);
    border-left: 3px solid #6c757d;
}

.fix-item.rolled-back .rollback-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #6c757d;
    color: white;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 600;
}

.undo-rollback-btn {
    background: transparent;
    border: 1px solid white;
    color: white;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 11px;
    cursor: pointer;
    transition: var(--transition);
}

.undo-rollback-btn:hover { background: white; color: #6c757d; }

.fix-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.fix-info { display: flex; flex-direction: column; gap: 4px; }
.fix-field { font-weight: 600; color: var(--color-text); font-size: 14px; }
.fix-resource, .fix-identifier { font-size: 13px; color: var(--color-text-muted); }
.fix-actions { display: flex; gap: 8px; }

.edit-fix-btn, .rollback-fix-btn {
    padding: 4px 8px;
    border: 1px solid #ddd;
    border-radius: var(--radius-sm);
    background: var(--color-bg-white);
    font-size: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.edit-fix-btn:hover { background: var(--color-bg-light); border-color: var(--color-primary); color: var(--color-primary); }
.rollback-fix-btn { border-color: var(--color-danger); color: var(--color-danger); }
.rollback-fix-btn:hover { background: var(--color-danger); color: white; }

.fix-content {
    background: var(--color-bg-light);
    border-radius: var(--radius-md);
    padding: 12px;
}

/* Alt Tags */
.alt-tags-group { display: flex; flex-direction: column; gap: 10px; }

.alt-tag-image {
    background: var(--color-bg-white);
    border-radius: var(--radius-md);
    padding: 12px;
    border: 1px solid var(--color-border);
}

.alt-tag-image .image-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.alt-tag-image .fix-identifier { font-size: 13px; color: var(--color-text-muted); font-weight: 500; }
.alt-tag-image .fix-change { background: transparent; padding: 0; }
.alt-tag-image .fix-meta { margin-top: 8px; }

.fix-change {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 12px;
}

.original-value, .new-value { display: flex; flex-direction: column; gap: 4px; }
.original-value label, .new-value label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--color-text-muted); }
.original-value .value { color: var(--color-danger); font-style: italic; }
.new-value .value { color: var(--color-success); font-weight: 500; }
.value { font-size: 14px; line-height: 1.4; word-break: break-word; }

.fix-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--color-text-muted);
    border-top: 1px solid var(--color-border);
    padding-top: 8px;
}

.rollback-status {
    background: var(--color-warning);
    color: #212529;
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-weight: 500;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    padding: 16px;
    margin-top: 20px;
    border-top: 1px solid var(--color-border);
}

#page-info { font-size: 14px; color: var(--color-text-muted); }

/* Empty States */
.error-message, .no-fixes-message, .no-sessions, .empty-state {
    text-align: center;
    padding: 24px;
    color: var(--color-text-muted);
    font-style: italic;
}

.error-message { color: var(--color-danger); }

.empty-state {
    padding: 60px 20px;
    background: var(--color-bg-light);
    border-radius: var(--radius-lg);
    margin: 16px 0;
    font-style: normal;
}

.empty-state p { font-size: 15px; line-height: 1.5; }

/* Loading State */
.loading-state { text-align: center; padding: 40px 20px; color: var(--color-text-muted); }

/* Rollback Sessions */
.rollback-sessions-list { margin-top: 16px; }

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

.session-name { font-weight: 600; color: var(--color-text); }

.session-status {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
}

.status-completed { background: #d4edda; color: #155724; }
.status-processing { background: #fff3cd; color: #856404; }
.status-failed { background: #f8d7da; color: #721c24; }

.session-details {
    display: flex;
    gap: 16px;
    margin-bottom: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
}

.session-actions { display: flex; justify-content: flex-end; }

/* Fix Edit Inline */
.fix-edit-tooltip {
    background: var(--color-bg-light);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 12px;
    margin-top: 12px;
}

.fix-edit-textarea {
    width: 100%;
    border: 1px solid #ddd;
    border-radius: var(--radius-md);
    padding: 10px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    min-height: 70px;
    margin-bottom: 10px;
}

.fix-edit-textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

.fix-edit-buttons { display: flex; justify-content: flex-end; gap: 8px; }

.fix-edit-btn {
    padding: 6px 14px;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.fix-edit-btn-cancel { background: var(--color-bg-white); border: 1px solid #ddd; color: var(--color-text-muted); }
.fix-edit-btn-cancel:hover { background: var(--color-bg-light); border-color: #bbb; }

.fix-edit-btn-save { background: var(--color-primary); border: 1px solid var(--color-primary); color: white; }
.fix-edit-btn-save:hover:not(:disabled) { background: #5a6fd6; }
.fix-edit-btn-save:disabled { background: #a0aec0; border-color: #a0aec0; cursor: not-allowed; }

.fix-edit-btn-rollback { background: var(--color-danger); border: 1px solid var(--color-danger); color: white; }
.fix-edit-btn-rollback:hover:not(:disabled) { background: var(--color-danger-dark); }
.fix-edit-btn-rollback:disabled { background: #e57373; border-color: #e57373; cursor: not-allowed; }

/* Fixes Table */
.fixes-search-container {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 8px;
}

.fixes-search-input {
    flex: 1;
    max-width: 300px;
    border-radius: var(--radius-lg);
    font-family: inherit;
}

.fixes-search-input::placeholder { color: #adb5bd; }
.fixes-search-count { font-size: 13px; color: #6c757d; }

.fixes-table-container { overflow-x: auto; max-height: 600px; overflow-y: auto; }

/* Data Tables - Consolidated */
.fixes-table, .articles-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.fixes-table th, .fixes-table td,
.articles-table th, .articles-table td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

.fixes-table th, .articles-table th {
    background: var(--color-bg-light);
    font-weight: 600;
    color: var(--color-text);
    font-size: 12px;
    text-transform: uppercase;
    position: sticky;
    top: 0;
    z-index: 1;
}

.fixes-table tbody tr:hover, .articles-table tbody tr:hover { background: var(--color-bg-light); }

.fixes-table .col-url { width: 25%; min-width: 180px; }
.fixes-table .col-url a { color: var(--color-primary); text-decoration: none; word-break: break-all; }
.fixes-table .col-url a:hover { text-decoration: underline; }
.fixes-table .col-new { width: 60%; }
.fixes-table .col-action { width: 15%; min-width: 80px; text-align: right; }

.fix-row.rolled-back { opacity: 0.6; background: var(--color-bg-light); }
.fix-row.rolled-back td { text-decoration: line-through; color: #6c757d; }
.fix-row.rolled-back .col-action { text-decoration: none; }

.fix-identifier-small { display: block; font-size: 11px; color: var(--color-text-light); margin-top: 2px; }
.new-value-text { color: var(--color-success); line-height: 1.4; display: block; max-height: 60px; overflow: hidden; text-overflow: ellipsis; }

.action-buttons { display: flex; gap: 4px; justify-content: flex-end; }

.icon-btn {
    background: transparent;
    border: none;
    padding: 4px 6px;
    cursor: pointer;
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
}

.icon-btn:hover { background: var(--color-border); }
.icon-btn.edit-fix-btn:hover { background: #e7f3ff; }
.icon-btn.rollback-fix-btn:hover { background: #ffe7e7; }
.icon-btn.undo-rollback-btn:hover { background: #e7ffe7; }

/* Fix Edit Row */
.fix-edit-row td { background: var(--color-bg-light); padding: 12px; }

.fix-edit-inline { display: flex; gap: 12px; align-items: stretch; }
.fix-edit-inline .fix-edit-textarea { flex: 1; margin-bottom: 0; min-height: 50px; }
.fix-edit-inline .fix-edit-buttons { display: flex; flex-direction: column; gap: 6px; justify-content: flex-end; min-width: 90px; }
.fix-edit-inline .fix-edit-btn { padding: 6px 12px; white-space: nowrap; width: 100%; }

.fix-readonly-textarea { background: #f1f3f4; color: var(--color-text-muted); cursor: not-allowed; border-color: #ddd; }
.fix-readonly-textarea:focus { box-shadow: none; border-color: #ddd; }

.rollback-preview { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.rollback-label { font-size: 12px; font-weight: 500; color: var(--color-text-muted); text-transform: uppercase; }
.fix-rollback-row .rollback-label { color: var(--color-danger); }
.fix-undo-row .rollback-label { color: var(--color-success); }

/* Blog Selector */
.blog-selector { margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.blog-selector label { font-weight: 500; color: var(--color-text); }
.blog-selector select { min-width: 250px; width: 250px; }

/* Bulk Actions */
.bulk-actions {
    background: #f1f3fd;
    border: 1px solid #9caec6;
    padding: 12px 16px;
    border-radius: var(--radius-lg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

#selected-count { font-weight: 500; color: var(--color-text); }

/* Articles Table */
.articles-table-container { margin: 16px 0; overflow-x: auto; min-height: 200px; }
.articles-table { border: 1px solid var(--color-border); }
.articles-table th, .articles-table td { padding: 12px; }
.articles-table .checkbox-col { width: 40px; text-align: center; }
.articles-table .date-col { width: 120px; }
.articles-table .status-col { width: 80px; text-align: center; }
.articles-table .title-col { min-width: 200px; }
.articles-table input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.articles-table tbody tr.selected { background: #e7f3ff; }
.articles-table tbody tr.uploaded { background: var(--color-bg-light); }
.uploaded-check { color: var(--color-success); font-size: 17px; }

/* Issues Notification Bar */
.issues-notification-bar {
    display: none;
    position: absolute;
    bottom: 40px;
    left: 40px;
    right: 40px;
    background: #FFF9E6;
    border-left: 4px solid #E6A100;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    border-radius: var(--radius-md);
}

.issues-notification-bar.visible { display: block; }
.issues-notification-bar a { color: #0066CC; text-decoration: underline; }
.issues-notification-bar a:hover { color: #004499; }

/* Website Not Found Message */
.website-not-found-message {
    background: #fff3cd;
    border: 1px solid var(--color-warning);
    border-radius: var(--radius-xl);
    padding: 24px;
    margin: 20px 0;
    text-align: center;
}

.website-not-found-message h3 { color: #856404; font-size: 16px; font-weight: 500; line-height: 1.5; margin: 0; }
.website-not-found-message a { color: #0066CC; text-decoration: underline; font-weight: 600; }
.website-not-found-message a:hover { color: #004499; }

/* Scanning Message - shown when website is being crawled */
.scanning-message {
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 2px solid #2196f3;
    border-radius: var(--radius-xl);
    padding: 40px 30px;
    margin: 20px 0;
    text-align: center;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.2);
}

.scanning-message .scanning-icon {
    font-size: 48px;
    margin-bottom: 16px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.scanning-message h3 {
    color: #1565c0;
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 12px 0;
}

.scanning-message p {
    color: #1976d2;
    font-size: 16px;
    line-height: 1.6;
    margin: 0 0 8px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.scanning-message .button-scanning-refresh {
    margin-top: 20px;
    background: #1976d2;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.scanning-message .button-scanning-refresh:hover {
    background: #1565c0;
    color: white;
}

/* Responsive */
@media (max-width: 1024px) {
    .health-issues-container { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    body { padding: 10px; }
    .health-issues-container { grid-template-columns: 1fr; }
    .input-group, .processing-actions, .tab-nav, .session-details { flex-direction: column; }
    .tab-btn { text-align: left; }
    .fix-change { grid-template-columns: 1fr; gap: 12px; }
    .fix-header, .session-header { flex-direction: column; gap: 8px; align-items: flex-start; }
    .fix-actions { align-self: flex-end; }
    .fixes-table .col-url { width: 30%; }
    .fixes-table .col-new { width: 50%; }
    .new-value-text { max-height: 40px; }
    .fix-edit-inline { flex-direction: column; }
    .fix-edit-inline .fix-edit-buttons { flex-direction: row; justify-content: flex-end; }
    .blog-selector { flex-direction: column; align-items: flex-start; gap: 8px; }
    .blog-selector select { width: 100%; min-width: unset; }
    .bulk-actions { flex-direction: column; gap: 12px; text-align: center; }
    .articles-table .date-col { display: none; }
    .pagination { flex-wrap: wrap; }
}