/* Minimal overrides on top of Pico CSS */

/* Constrain login form */
.login-card {
    max-width: 24rem;
    margin: 2rem auto;
}

/* Job status badge colors */
.badge-running  { background-color: #3b82f6; color: #fff; }
.badge-pending  { background-color: #6b7280; color: #fff; }
.badge-failed   { background-color: #ef4444; color: #fff; }
.badge-warning  { background-color: #b45309; color: #fff; }
.badge-cancelled { background-color: #9ca3af; color: #fff; }
.badge-paused    { background-color: #d97706; color: #fff; }

/* Destructive action button */
.btn-danger {
    --pico-color: #ef4444;
    --pico-border-color: #ef4444;
}
.btn-danger:hover {
    --pico-background-color: #ef4444;
    --pico-color: #fff;
    --pico-border-color: #ef4444;
}

/* Pause button (amber outline) */
.btn-pause {
    --pico-color: #d97706;
    --pico-border-color: #d97706;
}
.btn-pause:hover {
    --pico-background-color: #d97706;
    --pico-color: #fff;
    --pico-border-color: #d97706;
}

/* Resume button (solid green) */
.btn-resume {
    --pico-background-color: #16a34a;
    --pico-border-color: #16a34a;
    --pico-color: #fff;
}
.btn-resume:hover {
    --pico-background-color: #15803d;
    --pico-border-color: #15803d;
}

progress {
    width: 100%;
    margin-bottom: 0.5rem;
}

#progress-text {
    font-size: 0.9rem;
    color: var(--pico-muted-color);
}

figure {
    overflow-x: auto;
}

table td code {
    font-size: 0.85rem;
}

fieldset a[role="button"] {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}

small {
    display: block;
    margin-bottom: 0.25rem;
    color: var(--pico-muted-color);
}

article mark {
    font-size: 0.85rem;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

/* Dashboard section separator */
.dashboard-jobs {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--pico-muted-border-color);
}

/* Allow nav items to wrap on small screens */
nav ul:last-child {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.25rem;
}

@media (max-width: 576px) {
    nav ul li {
        padding: 0;
    }
    nav a {
        font-size: 0.875rem;
    }
}

/* Logout form in nav */
.nav-logout-form {
    margin: 0;
    display: inline;
}
.nav-link-btn {
    background: none;
    border: none;
    color: var(--pico-primary);
    cursor: pointer;
    padding: 0;
    margin: 0;
    font-size: inherit;
    font-family: inherit;
}
.nav-link-btn:hover {
    color: var(--pico-primary-hover);
}

/* Dark mode toggle */
#theme-toggle {
    cursor: pointer;
    font-size: 0.875rem;
}

/* Screen reader only */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Inline SVG icon helper */
.dash-inline-icon {
    vertical-align: -2px;
}


/* ========================================================================
   Dashboard redesign
   ======================================================================== */

/* -- Greeting -- */
.dash-greeting {
    margin-bottom: 0.5rem;
}
.dash-greeting hgroup {
    margin-bottom: 0;
}
.dash-greeting h2 {
    margin-bottom: 0.15rem;
}
.dash-greeting p {
    margin-bottom: 0;
}

/* -- Stats row -- */
.dash-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
}
.dash-stat {
    text-align: center;
    padding: 1rem 0.75rem;
    margin-bottom: 0;
}
.dash-stat small {
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    margin-bottom: 0.35rem;
}
.dash-stat-value {
    display: block;
    font-size: 1.75rem;
    line-height: 1.2;
}
.dash-stat-success {
    color: #16a34a;
}
.dash-stat-active {
    color: #3b82f6;
}
.dash-stat-found {
    color: #8b5cf6;
}

/* -- Sections -- */
.dash-section {
    margin-bottom: 2.5rem;
}
.dash-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--pico-muted-border-color);
}
.dash-section-header h3 {
    margin-bottom: 0;
}
.dash-section-header a {
    font-size: 0.875rem;
}
.dash-section-header small {
    margin-bottom: 0;
}

/* -- Tool cards -- */
.dash-tool {
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: box-shadow 0.15s ease;
}
.dash-tool:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

/* Top accent stripe per tool */
.dash-tool::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}
.dash-tool--domain_generator::before {
    background: linear-gradient(90deg, #8b5cf6, #a78bfa);
}
.dash-tool--availability_checker::before {
    background: linear-gradient(90deg, #0ea5e9, #38bdf8);
}
.dash-tool--domain_filter::before {
    background: linear-gradient(90deg, #10b981, #34d399);
}
.dash-tool--keyword_expander::before {
    background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.dash-tool--whois_lookup::before {
    background: linear-gradient(90deg, #6366f1, #818cf8);
}
.dash-tool--price_checker::before {
    background: linear-gradient(90deg, #ec4899, #f472b6);
}
/* Icon */
.dash-tool-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    margin-bottom: 0.75rem;
    flex-shrink: 0;
}
.dash-tool--domain_generator .dash-tool-icon {
    background-color: rgba(139, 92, 246, 0.1);
    color: #8b5cf6;
}
.dash-tool--availability_checker .dash-tool-icon {
    background-color: rgba(14, 165, 233, 0.1);
    color: #0ea5e9;
}
.dash-tool--domain_filter .dash-tool-icon {
    background-color: rgba(16, 185, 129, 0.1);
    color: #10b981;
}
.dash-tool--keyword_expander .dash-tool-icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
}
.dash-tool--whois_lookup .dash-tool-icon {
    background-color: rgba(99, 102, 241, 0.1);
    color: #6366f1;
}
.dash-tool--price_checker .dash-tool-icon {
    background-color: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}
/* Dark mode icon backgrounds */
[data-theme="dark"] .dash-tool--domain_generator .dash-tool-icon {
    background-color: rgba(139, 92, 246, 0.18);
}
[data-theme="dark"] .dash-tool--availability_checker .dash-tool-icon {
    background-color: rgba(14, 165, 233, 0.18);
}
[data-theme="dark"] .dash-tool--domain_filter .dash-tool-icon {
    background-color: rgba(16, 185, 129, 0.18);
}
[data-theme="dark"] .dash-tool--keyword_expander .dash-tool-icon {
    background-color: rgba(245, 158, 11, 0.18);
}
[data-theme="dark"] .dash-tool--whois_lookup .dash-tool-icon {
    background-color: rgba(99, 102, 241, 0.18);
}
[data-theme="dark"] .dash-tool--price_checker .dash-tool-icon {
    background-color: rgba(236, 72, 153, 0.18);
}
/* Body */
.dash-tool-body {
    flex: 1;
}
.dash-tool-body strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.25rem;
}
.dash-tool-body p {
    font-size: 0.9rem;
    color: var(--pico-muted-color);
    margin-bottom: 0.5rem;
}
.dash-tool-meta small {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0.65;
}

/* Footer / launch button */
.dash-tool footer {
    padding-top: 0;
    margin-top: auto;
}
.dash-tool-launch {
    width: 100%;
    text-align: center;
    display: block;
}
.dash-tool--domain_generator .dash-tool-launch {
    --pico-primary: #8b5cf6;
    --pico-primary-hover: #7c3aed;
    --pico-primary-focus: rgba(139, 92, 246, 0.25);
}
.dash-tool--availability_checker .dash-tool-launch {
    --pico-primary: #0ea5e9;
    --pico-primary-hover: #0284c7;
    --pico-primary-focus: rgba(14, 165, 233, 0.25);
}
.dash-tool--domain_filter .dash-tool-launch {
    --pico-primary: #10b981;
    --pico-primary-hover: #059669;
    --pico-primary-focus: rgba(16, 185, 129, 0.25);
}
.dash-tool--keyword_expander .dash-tool-launch {
    --pico-primary: #f59e0b;
    --pico-primary-hover: #d97706;
    --pico-primary-focus: rgba(245, 158, 11, 0.25);
}
.dash-tool--whois_lookup .dash-tool-launch {
    --pico-primary: #6366f1;
    --pico-primary-hover: #4f46e5;
    --pico-primary-focus: rgba(99, 102, 241, 0.25);
}
.dash-tool--price_checker .dash-tool-launch {
    --pico-primary: #ec4899;
    --pico-primary-hover: #db2777;
    --pico-primary-focus: rgba(236, 72, 153, 0.25);
}
/* Pipeline hint */
.dash-pipeline-hint {
    margin-top: 0.75rem;
    text-align: center;
    opacity: 0.7;
}
.dash-pipeline-hint small {
    font-size: 0.8rem;
}

/* -- Recent jobs list -- */
.dash-jobs {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.dash-job {
    display: flex;
    align-items: stretch;
    text-decoration: none;
    color: inherit;
    border: 1px solid var(--pico-muted-border-color);
    border-bottom: none;
    background: var(--pico-card-background-color);
    transition: background-color 0.12s ease;
}
.dash-job:first-child {
    border-radius: 8px 8px 0 0;
}
.dash-job:last-child {
    border-bottom: 1px solid var(--pico-muted-border-color);
    border-radius: 0 0 8px 8px;
}
.dash-job:only-child {
    border-radius: 8px;
    border-bottom: 1px solid var(--pico-muted-border-color);
}
.dash-job:hover {
    background-color: var(--pico-card-sectioning-background-color);
}

/* Left color bar per status */
.dash-job-status-bar {
    width: 4px;
    flex-shrink: 0;
}
.dash-job--completed .dash-job-status-bar {
    background-color: #16a34a;
}
.dash-job--completed_with_errors .dash-job-status-bar {
    background-color: #b45309;
}
.dash-job--running .dash-job-status-bar {
    background-color: #3b82f6;
}
.dash-job--pending .dash-job-status-bar {
    background-color: #6b7280;
}
.dash-job--failed .dash-job-status-bar {
    background-color: #ef4444;
}
.dash-job--cancelled .dash-job-status-bar {
    background-color: #9ca3af;
}
.dash-job--paused .dash-job-status-bar {
    background-color: #d97706;
}

/* Content area */
.dash-job-content {
    flex: 1;
    padding: 0.75rem 1rem;
    min-width: 0;
}
.dash-job-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.dash-job-tool {
    font-size: 0.95rem;
}
.dash-job-top mark {
    font-size: 0.75rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
}
.dash-job-bottom {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}
.dash-job-bottom small {
    margin-bottom: 0;
    font-size: 0.78rem;
}
.dash-job-bottom code {
    font-size: 0.75rem;
    padding: 0.05rem 0.3rem;
}
.dash-job-time {
    opacity: 0.7;
}
.dash-job-error small {
    color: #ef4444;
    font-size: 0.78rem;
    margin-top: 0.2rem;
    margin-bottom: 0;
}

/* Arrow */
.dash-job-arrow {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    color: var(--pico-muted-color);
    flex-shrink: 0;
}

/* Empty state */
.dash-empty {
    text-align: center;
    padding: 2rem 1rem;
}
.dash-empty p {
    margin-bottom: 0;
    color: var(--pico-muted-color);
}

/* -- Responsive -- */
@media (max-width: 992px) {
    .dash-stats {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .dash-stats {
        grid-template-columns: repeat(2, 1fr);
    }
    .dash-stat-value {
        font-size: 1.5rem;
    }
}
@media (max-width: 480px) {
    .dash-stats {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .dash-stat {
        padding: 0.75rem 0.5rem;
    }
    .dash-stat-value {
        font-size: 1.25rem;
    }
    .dash-job-arrow {
        display: none;
    }
    .dash-job-bottom {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.15rem;
    }
}

/* ========================================================================
   Favorites / Star toggle
   ======================================================================== */

/* ========================================================================
   Results Viewer
   ======================================================================== */

.results-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.results-controls input[type="search"] {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}
.results-controls select {
    width: auto;
    min-width: 120px;
    margin-bottom: 0;
}
.results-actions {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.results-actions a[role="button"] {
    margin-bottom: 0;
    white-space: nowrap;
}

.results-pagination {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    flex-wrap: wrap;
    margin: 1rem 0;
}
.results-pagination button.pag-btn {
    width: auto;
    display: inline-block;
    padding: 0.35rem 0.65rem;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid var(--pico-muted-border-color);
    background: var(--pico-card-background-color) !important;
    color: var(--pico-color) !important;
    border-radius: 4px;
    margin: 0;
    --pico-background-color: var(--pico-card-background-color);
    --pico-color: inherit;
}
.results-pagination button.pag-btn:hover {
    background: var(--pico-card-sectioning-background-color) !important;
}
.results-pagination button.pag-active {
    background: var(--pico-primary) !important;
    color: #fff !important;
    border-color: var(--pico-primary);
}
.results-pagination button.pag-active:hover {
    background: var(--pico-primary-hover) !important;
}
.pag-dots {
    padding: 0.35rem 0.25rem;
    color: var(--pico-muted-color);
}

.chk-col {
    width: 2rem;
    text-align: center;
    padding: 0.25rem !important;
}
.chk-col input[type="checkbox"] {
    margin: 0;
}

.fav-col {
    width: 2rem;
    text-align: center;
    padding: 0.25rem !important;
}

.fav-star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: var(--pico-muted-color);
    padding: 0.15rem 0.3rem;
    line-height: 1;
    margin: 0;
    transition: color 0.15s ease;
}
.fav-star:hover {
    color: #eab308;
}
.fav-star--active {
    color: #eab308;
}

/* ========================================================================
   Live badge & auto-refresh
   ======================================================================== */

.live-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background-color: #16a34a;
    color: #fff;
    padding: 0.15rem 0.5rem;
    border-radius: 9999px;
    vertical-align: middle;
    margin-left: 0.5rem;
    animation: live-pulse 2s ease-in-out infinite;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.results-count-flash {
    color: #16a34a;
    font-weight: 700;
    transition: color 0.3s ease;
}

/* ========================================================================
   Sortable table headers
   ======================================================================== */

.sortable-th {
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}
.sortable-th:hover {
    background-color: var(--pico-card-sectioning-background-color);
}
.sortable-th.sorted {
    font-weight: 700;
}
.sort-arrow {
    font-size: 0.7em;
    margin-left: 0.3em;
    opacity: 0.5;
}
.sorted .sort-arrow {
    opacity: 1;
}

/* ========================================================================
   Domain Picker (tool form)
   ======================================================================== */

details.domain-picker {
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 6px;
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    background: var(--pico-card-background-color);
}
details.domain-picker summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--pico-primary);
}
details.domain-picker[open] summary {
    margin-bottom: 0.75rem;
}

.domain-picker-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--pico-muted-border-color);
    border-radius: 4px;
    padding: 0.5rem;
}
.domain-picker-item {
    display: block;
    padding: 0.15rem 0;
}
.domain-picker-item input {
    margin-right: 0.4rem;
}
.domain-picker-controls {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.domain-picker-controls input[type="search"] {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
}
.domain-picker-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
