/* ======================================================================
   Hreflang Checker Pro – Styles
   ====================================================================== */

/* === 1. CSS CUSTOM PROPERTIES === */

:root {
    --hlc-primary: #4f46e5;
    --hlc-primary-hover: #4338ca;
    --hlc-primary-light: #eef2ff;
    --hlc-primary-subtle: #c7d2fe;

    --hlc-success: #059669;
    --hlc-success-light: #d1fae5;
    --hlc-danger: #dc2626;
    --hlc-danger-light: #fee2e2;
    --hlc-warning: #d97706;
    --hlc-warning-light: #fef3c7;
    --hlc-info: #3b82f6;
    --hlc-info-light: #dbeafe;

    --hlc-gray-50: #f9fafb;
    --hlc-gray-100: #f3f4f6;
    --hlc-gray-200: #e5e7eb;
    --hlc-gray-300: #d1d5db;
    --hlc-gray-400: #9ca3af;
    --hlc-gray-500: #6b7280;
    --hlc-gray-600: #4b5563;
    --hlc-gray-700: #374151;
    --hlc-gray-800: #1f2937;
    --hlc-gray-900: #111827;

    --hlc-bg: #ffffff;
    --hlc-bg-secondary: var(--hlc-gray-50);
    --hlc-text: var(--hlc-gray-900);
    --hlc-text-secondary: var(--hlc-gray-500);
    --hlc-border: var(--hlc-gray-200);

    --hlc-radius: 12px;
    --hlc-radius-sm: 8px;
    --hlc-radius-xs: 6px;
    --hlc-shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.06);
    --hlc-shadow-md: 0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.06);
    --hlc-shadow-lg: 0 10px 15px rgba(0,0,0,.1), 0 4px 6px rgba(0,0,0,.05);
    --hlc-transition: .2s ease;
    --hlc-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

/* === 2. DARK MODE === */

.hlc-app.dark {
    --hlc-bg: #0f172a;
    --hlc-bg-secondary: #1e293b;
    --hlc-text: #f1f5f9;
    --hlc-text-secondary: #94a3b8;
    --hlc-border: #334155;
    --hlc-shadow: 0 1px 3px rgba(0,0,0,.3);
    --hlc-shadow-md: 0 4px 6px rgba(0,0,0,.3);
    --hlc-shadow-lg: 0 10px 15px rgba(0,0,0,.4);
    --hlc-primary-light: #1e1b4b;
    --hlc-success-light: #064e3b;
    --hlc-danger-light: #450a0a;
    --hlc-warning-light: #451a03;
    --hlc-info-light: #172554;
    --hlc-gray-50: #1e293b;
    --hlc-gray-100: #1e293b;
    --hlc-gray-200: #334155;
    --hlc-gray-300: #475569;
    --hlc-gray-700: #cbd5e1;
    --hlc-gray-800: #e2e8f0;
    --hlc-gray-900: #f8fafc;
}

/* === 3. BASE === */

.hlc-app {
    font-family: var(--hlc-font);
    color: var(--hlc-text);
    background: var(--hlc-bg);
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px;
    line-height: 1.6;
}

.hlc-app *, .hlc-app *::before, .hlc-app *::after {
    box-sizing: border-box;
}

.hlc-app h2, .hlc-app h3, .hlc-app h4 {
    margin: 0;
    line-height: 1.3;
}

/* === 4. HEADER === */

.hlc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 28px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--hlc-border);
}

.hlc-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.hlc-header-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--hlc-radius);
    background: var(--hlc-primary-light);
    color: var(--hlc-primary);
    flex-shrink: 0;
}

.hlc-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--hlc-text);
}

.hlc-subtitle {
    font-size: 14px;
    color: var(--hlc-text-secondary);
    margin: 2px 0 0;
}

.hlc-dark-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--hlc-border);
    background: var(--hlc-bg);
    color: var(--hlc-text-secondary);
    cursor: pointer;
    transition: all var(--hlc-transition);
    flex-shrink: 0;
}

.hlc-dark-toggle:hover {
    background: var(--hlc-bg-secondary);
    color: var(--hlc-text);
}

.hlc-app .hlc-icon-moon { display: none; }
.hlc-app.dark .hlc-icon-sun { display: none; }
.hlc-app.dark .hlc-icon-moon { display: block; }

/* === 5. INPUT SECTION === */

.hlc-input-section {
    background: var(--hlc-bg);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius);
    padding: 24px;
    box-shadow: var(--hlc-shadow);
    margin-bottom: 24px;
}

.hlc-input-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--hlc-bg-secondary);
    border-radius: var(--hlc-radius-sm);
    padding: 4px;
}

.hlc-input-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hlc-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--hlc-radius-xs);
    cursor: pointer;
    transition: all var(--hlc-transition);
    font-family: var(--hlc-font);
}

.hlc-input-tab:hover {
    color: var(--hlc-text);
}

.hlc-input-tab.active {
    background: var(--hlc-bg);
    color: var(--hlc-primary);
    box-shadow: var(--hlc-shadow);
    font-weight: 600;
}

.hlc-input-panel {
    display: none;
}

.hlc-input-panel.active {
    display: block;
}

/* Textarea */
.hlc-textarea {
    width: 100%;
    min-height: 160px;
    padding: 14px 16px;
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius-sm);
    background: var(--hlc-bg-secondary);
    color: var(--hlc-text);
    font-family: 'SF Mono', 'Fira Code', 'Fira Mono', 'Roboto Mono', monospace;
    font-size: 13px;
    line-height: 1.7;
    resize: vertical;
    transition: border-color var(--hlc-transition);
}

.hlc-textarea:focus {
    outline: none;
    border-color: var(--hlc-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, .12);
}

.hlc-textarea::placeholder {
    color: var(--hlc-gray-400);
}

.hlc-textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.hlc-url-count {
    font-size: 13px;
    color: var(--hlc-text-secondary);
    font-weight: 500;
}

.hlc-url-count.limit {
    color: var(--hlc-danger);
}

.hlc-text-btn {
    background: none;
    border: none;
    color: var(--hlc-text-secondary);
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--hlc-radius-xs);
    font-family: var(--hlc-font);
    transition: all var(--hlc-transition);
}

.hlc-text-btn:hover {
    color: var(--hlc-danger);
    background: var(--hlc-danger-light);
}

/* Dropzone */
.hlc-dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed var(--hlc-border);
    border-radius: var(--hlc-radius);
    background: var(--hlc-bg-secondary);
    color: var(--hlc-text-secondary);
    cursor: pointer;
    transition: all var(--hlc-transition);
    text-align: center;
}

.hlc-dropzone:hover, .hlc-dropzone.dragover {
    border-color: var(--hlc-primary);
    background: var(--hlc-primary-light);
    color: var(--hlc-primary);
}

.hlc-dropzone-text {
    font-size: 15px;
    font-weight: 500;
    margin: 12px 0 4px;
}

.hlc-dropzone-hint {
    font-size: 13px;
    margin: 0;
}

.hlc-dropzone-link {
    color: var(--hlc-primary);
    text-decoration: underline;
}

/* CSV Preview */
.hlc-csv-preview {
    margin-top: 12px;
}

.hlc-csv-preview-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--hlc-bg-secondary);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius-sm);
    font-size: 13px;
    color: var(--hlc-text);
}

.hlc-csv-filename {
    font-weight: 600;
    flex: 1;
}

.hlc-csv-count {
    color: var(--hlc-text-secondary);
}

/* Action Row */
.hlc-action-row {
    display: flex;
    gap: 10px;
    margin-top: 16px;
}

.hlc-primary-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    background: var(--hlc-primary);
    border: none;
    border-radius: var(--hlc-radius-sm);
    cursor: pointer;
    transition: all var(--hlc-transition);
    font-family: var(--hlc-font);
}

.hlc-primary-btn:hover {
    background: var(--hlc-primary-hover);
    box-shadow: var(--hlc-shadow-md);
    transform: translateY(-1px);
}

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

.hlc-primary-btn:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.hlc-secondary-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 500;
    color: var(--hlc-text);
    background: var(--hlc-bg);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius-sm);
    cursor: pointer;
    transition: all var(--hlc-transition);
    font-family: var(--hlc-font);
}

.hlc-secondary-btn:hover {
    background: var(--hlc-bg-secondary);
    border-color: var(--hlc-gray-300);
}

/* === 6. PROGRESS === */

.hlc-progress {
    margin-bottom: 24px;
    padding: 20px 24px;
    background: var(--hlc-bg);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius);
    box-shadow: var(--hlc-shadow);
}

.hlc-progress-bar-container {
    height: 8px;
    background: var(--hlc-gray-200);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 10px;
}

.hlc-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--hlc-primary), #818cf8);
    border-radius: 999px;
    transition: width .3s ease;
}

.hlc-progress-bar.indeterminate {
    width: 40% !important;
    animation: hlc-progress-indeterminate 1.5s infinite ease-in-out;
}

@keyframes hlc-progress-indeterminate {
    0% { margin-left: 0; }
    50% { margin-left: 60%; }
    100% { margin-left: 0; }
}

.hlc-progress-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--hlc-text-secondary);
    font-weight: 500;
}

#hlc-progress-percent {
    font-weight: 700;
    color: var(--hlc-primary);
}

/* === 7. ERROR === */

.hlc-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: var(--hlc-danger-light);
    color: var(--hlc-danger);
    border-radius: var(--hlc-radius-sm);
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

/* === 8. STATS GRID === */

.hlc-stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.hlc-stat-card {
    padding: 20px;
    background: var(--hlc-bg);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius);
    box-shadow: var(--hlc-shadow);
    text-align: center;
    transition: transform var(--hlc-transition), box-shadow var(--hlc-transition);
}

.hlc-stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--hlc-shadow-md);
}

.hlc-stat-number {
    font-size: 28px;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 4px;
}

.hlc-stat-label {
    font-size: 13px;
    color: var(--hlc-text-secondary);
    font-weight: 500;
}

.hlc-stat-card.danger .hlc-stat-number { color: var(--hlc-danger); }
.hlc-stat-card.warning .hlc-stat-number { color: var(--hlc-warning); }
.hlc-stat-card.success .hlc-stat-number { color: var(--hlc-success); }
.hlc-stat-card.info .hlc-stat-number { color: var(--hlc-info); }

.hlc-stat-card.danger { border-left: 4px solid var(--hlc-danger); }
.hlc-stat-card.warning { border-left: 4px solid var(--hlc-warning); }
.hlc-stat-card.success { border-left: 4px solid var(--hlc-success); }
.hlc-stat-card.info { border-left: 4px solid var(--hlc-info); }

/* === 9. CHARTS === */

.hlc-charts-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 28px;
}

.hlc-chart-card {
    background: var(--hlc-bg);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius);
    padding: 20px;
    box-shadow: var(--hlc-shadow);
}

.hlc-chart-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--hlc-text);
    margin-bottom: 16px;
}

.hlc-chart-wrap {
    position: relative;
    height: 260px;
}

.hlc-chart-wrap-bar {
    height: 320px;
}

/* === 10. TABS === */

.hlc-tabs {
    display: flex;
    gap: 2px;
    background: var(--hlc-bg-secondary);
    border-radius: var(--hlc-radius-sm);
    padding: 4px;
    margin-bottom: 20px;
}

.hlc-tab {
    display: flex;
    align-items: center;
    gap: 6px;
    flex: 1;
    justify-content: center;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 500;
    color: var(--hlc-text-secondary);
    background: transparent;
    border: none;
    border-radius: var(--hlc-radius-xs);
    cursor: pointer;
    transition: all var(--hlc-transition);
    font-family: var(--hlc-font);
    white-space: nowrap;
}

.hlc-tab:hover {
    color: var(--hlc-text);
}

.hlc-tab.active {
    background: var(--hlc-bg);
    color: var(--hlc-primary);
    box-shadow: var(--hlc-shadow);
    font-weight: 600;
}

.hlc-tab-content {
    display: none;
}

.hlc-tab-content.active {
    display: block;
    animation: hlc-fade-in .25s ease;
}

@keyframes hlc-fade-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === 11. TOOLBAR === */

.hlc-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 16px;
}

.hlc-toolbar-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.hlc-toolbar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.hlc-search-box {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: var(--hlc-bg-secondary);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius-sm);
    color: var(--hlc-text-secondary);
    transition: border-color var(--hlc-transition);
}

.hlc-search-box:focus-within {
    border-color: var(--hlc-primary);
}

.hlc-filter-input {
    border: none;
    background: transparent;
    color: var(--hlc-text);
    font-size: 13px;
    outline: none;
    width: 180px;
    font-family: var(--hlc-font);
}

.hlc-filter-input::placeholder {
    color: var(--hlc-gray-400);
}

.hlc-select {
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius-sm);
    background: var(--hlc-bg);
    color: var(--hlc-text);
    cursor: pointer;
    font-family: var(--hlc-font);
    transition: border-color var(--hlc-transition);
}

.hlc-select:focus {
    outline: none;
    border-color: var(--hlc-primary);
}

.hlc-result-count {
    font-size: 13px;
    color: var(--hlc-text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

/* Export Dropdown */
.hlc-export-dropdown {
    position: relative;
}

.hlc-export-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--hlc-bg);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius-sm);
    box-shadow: var(--hlc-shadow-lg);
    min-width: 160px;
    z-index: 100;
    overflow: hidden;
}

.hlc-export-option {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--hlc-text);
    background: transparent;
    border: none;
    cursor: pointer;
    font-family: var(--hlc-font);
    transition: background var(--hlc-transition);
}

.hlc-export-option:hover {
    background: var(--hlc-bg-secondary);
}

/* === 12. RESULT ROWS === */

.hlc-url-results-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.hlc-result-row {
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius-sm);
    overflow: hidden;
    transition: box-shadow var(--hlc-transition);
}

.hlc-result-row:hover {
    box-shadow: var(--hlc-shadow);
}

.hlc-result-row.critical {
    border-left: 4px solid var(--hlc-danger);
}

.hlc-result-row.warning {
    border-left: 4px solid var(--hlc-warning);
}

.hlc-result-row.info {
    border-left: 4px solid var(--hlc-info);
}

.hlc-result-row.ok {
    border-left: 4px solid var(--hlc-success);
}

.hlc-result-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    cursor: pointer;
    user-select: none;
    transition: background var(--hlc-transition);
}

.hlc-result-header:hover {
    background: var(--hlc-bg-secondary);
}

.hlc-severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
}

.hlc-severity-badge.critical {
    background: var(--hlc-danger-light);
    color: var(--hlc-danger);
}

.hlc-severity-badge.warning {
    background: var(--hlc-warning-light);
    color: var(--hlc-warning);
}

.hlc-severity-badge.info {
    background: var(--hlc-info-light);
    color: var(--hlc-info);
}

.hlc-severity-badge.ok {
    background: var(--hlc-success-light);
    color: var(--hlc-success);
}

.hlc-result-url {
    flex: 1;
    font-size: 13px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--hlc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.hlc-result-counts {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.hlc-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 700;
    border-radius: 999px;
}

.hlc-count.critical {
    background: var(--hlc-danger-light);
    color: var(--hlc-danger);
}

.hlc-count.warning {
    background: var(--hlc-warning-light);
    color: var(--hlc-warning);
}

.hlc-count.info {
    background: var(--hlc-info-light);
    color: var(--hlc-info);
}

.hlc-result-status {
    font-size: 12px;
    font-weight: 600;
    color: var(--hlc-text-secondary);
    flex-shrink: 0;
    min-width: 60px;
    text-align: right;
}

.hlc-expand-arrow {
    color: var(--hlc-gray-400);
    font-size: 12px;
    transition: transform var(--hlc-transition);
    flex-shrink: 0;
}

.hlc-expand-arrow.open {
    transform: rotate(90deg);
}

/* Detail Panel */
.hlc-result-detail {
    padding: 0 16px 16px;
    border-top: 1px solid var(--hlc-border);
    background: var(--hlc-bg-secondary);
}

.hlc-detail-section {
    margin-top: 14px;
}

.hlc-detail-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--hlc-text-secondary);
    margin-bottom: 8px;
}

/* Hreflang Tags Table */
.hlc-hreflang-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.hlc-hreflang-table th {
    padding: 8px 10px;
    background: var(--hlc-bg);
    font-weight: 600;
    text-align: left;
    font-size: 12px;
    color: var(--hlc-text-secondary);
    border-bottom: 1px solid var(--hlc-border);
}

.hlc-hreflang-table td {
    padding: 7px 10px;
    border-bottom: 1px solid var(--hlc-border);
    color: var(--hlc-text);
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 12px;
    word-break: break-all;
}

.hlc-hreflang-table tr:last-child td {
    border-bottom: none;
}

.hlc-hreflang-table .hlc-tag-self {
    background: var(--hlc-success-light);
}

.hlc-hreflang-table .hlc-tag-xdefault {
    background: var(--hlc-info-light);
}

/* Issues List */
.hlc-issue-item {
    display: flex;
    gap: 10px;
    padding: 10px 12px;
    background: var(--hlc-bg);
    border-radius: var(--hlc-radius-xs);
    margin-bottom: 6px;
    align-items: flex-start;
}

.hlc-issue-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    margin-top: 1px;
}

.hlc-issue-icon.critical {
    background: var(--hlc-danger-light);
    color: var(--hlc-danger);
}

.hlc-issue-icon.warning {
    background: var(--hlc-warning-light);
    color: var(--hlc-warning);
}

.hlc-issue-icon.info {
    background: var(--hlc-info-light);
    color: var(--hlc-info);
}

.hlc-issue-body {
    flex: 1;
    min-width: 0;
}

.hlc-issue-message {
    font-size: 13px;
    font-weight: 500;
    color: var(--hlc-text);
    margin-bottom: 2px;
}

.hlc-issue-recommendation {
    font-size: 12px;
    color: var(--hlc-text-secondary);
    line-height: 1.5;
}

/* === 13. MATRIX === */

.hlc-matrix-container {
    overflow-x: auto;
}

.hlc-matrix-table {
    border-collapse: collapse;
    font-size: 12px;
    width: 100%;
    min-width: 600px;
}

.hlc-matrix-table thead {
    position: sticky;
    top: 0;
    z-index: 10;
}

.hlc-matrix-table th {
    padding: 8px 6px;
    background: var(--hlc-bg-secondary);
    font-weight: 700;
    text-align: center;
    border: 1px solid var(--hlc-border);
    color: var(--hlc-text);
    white-space: nowrap;
}

.hlc-matrix-url-header {
    text-align: left !important;
    min-width: 200px;
    position: sticky;
    left: 0;
    z-index: 11;
}

.hlc-matrix-table td {
    padding: 6px;
    border: 1px solid var(--hlc-border);
    text-align: center;
    min-width: 50px;
}

.hlc-matrix-url {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 11px;
    color: var(--hlc-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
    text-align: left;
    position: sticky;
    left: 0;
    background: var(--hlc-bg);
    z-index: 5;
}

.hlc-matrix-cell {
    width: 20px;
    height: 20px;
}

.hlc-matrix-cell.present {
    background: var(--hlc-success-light);
}

.hlc-matrix-cell.present::after {
    content: "\2713";
    color: var(--hlc-success);
    font-weight: 700;
    font-size: 13px;
}

.hlc-matrix-cell.self {
    background: var(--hlc-info-light);
}

.hlc-matrix-cell.self::after {
    content: "\2B24";
    color: var(--hlc-info);
    font-size: 8px;
}

.hlc-matrix-cell.absent {
    background: var(--hlc-gray-100);
}

.hlc-matrix-cell.absent::after {
    content: "\2014";
    color: var(--hlc-gray-400);
    font-size: 11px;
}

.hlc-matrix-note {
    font-size: 13px;
    color: var(--hlc-text-secondary);
    margin-top: 12px;
    font-style: italic;
}

/* === 14. CLUSTERS === */

.hlc-clusters-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hlc-cluster-card {
    background: var(--hlc-bg);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius);
    padding: 18px;
    box-shadow: var(--hlc-shadow);
}

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

.hlc-cluster-langs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hlc-lang-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    font-size: 12px;
    font-weight: 600;
    background: var(--hlc-primary-light);
    color: var(--hlc-primary);
    border-radius: 999px;
}

.hlc-cluster-count {
    font-size: 13px;
    color: var(--hlc-text-secondary);
    font-weight: 500;
}

.hlc-cluster-urls {
    display: flex;
    flex-direction: column;
    gap: 4px;
    max-height: 200px;
    overflow-y: auto;
}

.hlc-cluster-url {
    font-size: 12px;
    font-family: 'SF Mono', 'Fira Code', monospace;
    color: var(--hlc-text-secondary);
    padding: 4px 8px;
    background: var(--hlc-bg-secondary);
    border-radius: var(--hlc-radius-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* === 15. SUMMARY TAB === */

.hlc-summary-container {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.hlc-summary-rule {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: var(--hlc-bg);
    border: 1px solid var(--hlc-border);
    border-radius: var(--hlc-radius-sm);
    box-shadow: var(--hlc-shadow);
}

.hlc-summary-rule-severity {
    flex-shrink: 0;
}

.hlc-summary-rule-info {
    flex: 1;
    min-width: 0;
}

.hlc-summary-rule-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--hlc-text);
    margin-bottom: 2px;
}

.hlc-summary-rule-desc {
    font-size: 12px;
    color: var(--hlc-text-secondary);
}

.hlc-summary-rule-count {
    font-size: 22px;
    font-weight: 800;
    flex-shrink: 0;
    min-width: 50px;
    text-align: center;
}

.hlc-summary-rule.critical .hlc-summary-rule-count { color: var(--hlc-danger); }
.hlc-summary-rule.warning .hlc-summary-rule-count { color: var(--hlc-warning); }
.hlc-summary-rule.info .hlc-summary-rule-count { color: var(--hlc-info); }

.hlc-summary-rule-bar {
    height: 4px;
    background: var(--hlc-gray-200);
    border-radius: 999px;
    margin-top: 6px;
    overflow: hidden;
}

.hlc-summary-rule-bar-fill {
    height: 100%;
    border-radius: 999px;
    transition: width .5s ease;
}

.hlc-summary-rule.critical .hlc-summary-rule-bar-fill { background: var(--hlc-danger); }
.hlc-summary-rule.warning .hlc-summary-rule-bar-fill { background: var(--hlc-warning); }
.hlc-summary-rule.info .hlc-summary-rule-bar-fill { background: var(--hlc-info); }

/* === 16. LOAD MORE === */

.hlc-load-more-wrapper {
    text-align: center;
    padding: 16px 0;
}

/* === 17. TOAST === */

.hlc-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--hlc-gray-800);
    color: #fff;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: var(--hlc-shadow-lg);
    opacity: 0;
    pointer-events: none;
    transition: all .35s cubic-bezier(.4,0,.2,1);
    z-index: 9999;
}

.hlc-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* === 18. EMPTY STATE === */

.hlc-empty-text {
    text-align: center;
    font-size: 14px;
    color: var(--hlc-text-secondary);
    padding: 40px 20px;
}

/* === 19. LOADING SPINNER === */

.hlc-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2.5px solid var(--hlc-gray-200);
    border-top-color: var(--hlc-primary);
    border-radius: 50%;
    animation: hlc-spin .7s linear infinite;
}

@keyframes hlc-spin {
    to { transform: rotate(360deg); }
}

/* === 20. RESPONSIVE === */

@media (max-width: 768px) {
    .hlc-app {
        padding: 20px 14px;
    }

    .hlc-header {
        flex-wrap: wrap;
        gap: 12px;
    }

    .hlc-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .hlc-charts-row {
        grid-template-columns: 1fr;
    }

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

    .hlc-toolbar-left, .hlc-toolbar-right {
        flex-wrap: wrap;
    }

    .hlc-filter-input {
        width: 140px;
    }

    .hlc-result-header {
        flex-wrap: wrap;
        gap: 8px;
    }

    .hlc-result-url {
        width: 100%;
        order: 3;
    }

    .hlc-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .hlc-tab {
        font-size: 12px;
        padding: 8px 10px;
    }
}

@media (max-width: 480px) {
    .hlc-stats-grid {
        grid-template-columns: 1fr;
    }

    .hlc-header-left {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .hlc-action-row {
        flex-direction: column;
    }

    .hlc-primary-btn, .hlc-secondary-btn {
        width: 100%;
        justify-content: center;
    }

    .hlc-chart-wrap {
        height: 220px;
    }

    .hlc-chart-wrap-bar {
        height: 280px;
    }
}

/* === 21. PRINT === */

@media print {
    .hlc-input-section,
    .hlc-progress,
    .hlc-dark-toggle,
    .hlc-toolbar,
    .hlc-load-more-wrapper,
    .hlc-toast,
    .hlc-tabs,
    .hlc-action-row {
        display: none !important;
    }

    .hlc-app {
        max-width: 100%;
        padding: 0;
    }

    .hlc-tab-content {
        display: block !important;
        page-break-inside: avoid;
    }

    .hlc-result-detail {
        display: block !important;
    }
}
