/* pages.css — Page-specific layouts */

/* ── Checker (full-width, no left panel) ────────────────────── */
.checker-layout {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.batch-textarea {
    width: 100%;
    min-height: 160px;
    border: none;
    background: transparent;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.6;
    padding: var(--space-3) var(--space-4);
    resize: vertical;
    outline: none;
}
.batch-textarea::placeholder { color: var(--text-muted); }

.input-toolbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-2) var(--space-4);
    border-top: 1px solid var(--border-default);
    background: var(--bg-elevated);
}

/* ── Result list (one-column, monospace, no truncation) ─────── */
.result-list {
    display: flex; flex-direction: column;
    font-family: var(--font-mono);
    font-size: var(--text-sm);
    line-height: 1.5;
}

.result-line {
    display: flex; align-items: flex-start;
    padding: var(--space-2) var(--space-4);
    border-bottom: 1px solid var(--border-default);
    gap: var(--space-3);
    transition: background 0.1s;
    word-break: break-all;
}
.result-line:hover { background: var(--bg-elevated); }
.result-line:last-child { border-bottom: none; }

.result-status {
    flex-shrink: 0;
    min-width: 56px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: var(--text-xs);
    font-weight: var(--weight-semibold);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.result-status.success { background: var(--success-soft); color: var(--success); }
.result-status.danger  { background: var(--danger-soft);  color: var(--danger); }
.result-status.warning { background: var(--warning-soft); color: var(--warning); }
.result-status.info    { background: var(--info-soft);    color: var(--info); }

.result-gate {
    flex-shrink: 0;
    min-width: 100px;
    max-width: 140px;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--text-xs);
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: default;
}

.result-text {
    flex: 1; min-width: 0;
    color: var(--text-primary);
    white-space: pre-wrap;
    word-break: break-all;
}

.result-actions {
    flex-shrink: 0;
    display: flex; align-items: center; gap: var(--space-1);
    opacity: 0;
    transition: opacity 0.1s;
}
.result-line:hover .result-actions { opacity: 1; }

/* ── Dashboard ──────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-4);
}
@media (max-width: 768px) {
    .dashboard-grid { grid-template-columns: 1fr; }
}

.activity-list { display: flex; flex-direction: column; }
.activity-item {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-default);
    font-size: var(--text-sm);
}
.activity-item:last-child { border-bottom: none; }
.activity-icon {
    width: 28px; height: 28px;
    border-radius: var(--radius-md);
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-elevated);
    color: var(--text-secondary);
    flex-shrink: 0;
}
.activity-icon svg { width: 14px; height: 14px; }
.activity-icon.success { background: var(--success-soft); color: var(--success); }
.activity-icon.danger { background: var(--danger-soft); color: var(--danger); }
.activity-icon.warning { background: var(--warning-soft); color: var(--warning); }
.activity-icon.info { background: var(--info-soft); color: var(--info); }

.activity-content { flex: 1; min-width: 0; }
.activity-title { color: var(--text-primary); font-weight: var(--weight-medium); }
.activity-time { color: var(--text-muted); font-size: var(--text-xs); margin-top: 2px; }

/* ── History ────────────────────────────────────────────────── */
.history-filters {
    display: flex; align-items: center; gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}
.history-filters .input { max-width: 280px; }

.history-meta {
    display: flex; align-items: center; gap: var(--space-3);
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin-bottom: var(--space-3);
}
.history-meta strong { color: var(--text-primary); font-weight: var(--weight-medium); }

/* ── Proxies ────────────────────────────────────────────────── */
.proxy-row {
    display: flex; align-items: center; gap: var(--space-3);
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--border-default);
    font-family: var(--font-mono);
    font-size: var(--text-sm);
}
.proxy-row:last-child { border-bottom: none; }
.proxy-row .text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.proxy-row .text-mono { color: var(--text-primary); }
.proxy-row-header { font-family: var(--font-sans); }
.proxy-checkbox {
    width: 14px; height: 14px;
    accent-color: var(--accent);
    cursor: pointer;
    flex-shrink: 0;
}
.proxy-row:hover { background: var(--bg-elevated); }
.proxy-test-status {
    display: inline-block;
    min-width: 100px;
    text-align: right;
    font-size: var(--text-xs);
}
.proxy-test-status[data-test="idle"] { display: none; }
.proxy-test-status[data-test="testing"]::before {
    content: '';
    display: inline-block;
    width: 8px; height: 8px;
    margin-right: 4px;
    border: 1.5px solid var(--text-muted);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    vertical-align: middle;
}

/* ── Slogan (gate sidebar footer) ──────────────────────────── */
.footer-slogan {
    justify-content: center;
    text-align: center;
    padding: var(--space-3) var(--space-3);
    background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-overlay) 100%);
}
.slogan-text {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--danger);
    font-style: italic;
    text-shadow: 0 0 8px rgba(235, 87, 87, 0.35);
    animation: slogan-pulse 2.5s ease-in-out infinite;
}
@keyframes slogan-pulse {
    0%, 100% { opacity: 0.85; text-shadow: 0 0 6px rgba(235, 87, 87, 0.30); }
    50%      { opacity: 1.0;  text-shadow: 0 0 14px rgba(235, 87, 87, 0.65); }
}
.slogan-text { animation-duration: 3.5s; }

/* ── Pills (role, status, credits) ──────────────────────────── */
.role-pill {
    display: inline-flex; align-items: center;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.role-pill-admin  { background: var(--accent-soft); color: var(--accent); border: 1px solid rgba(94,106,210,0.3); }
.role-pill-user   { background: var(--bg-elevated);    color: var(--text-tertiary); border: 1px solid var(--border-default); }

/* Editable pill selects (role + status) */
.role-pill-select,
.status-pill-select {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: var(--weight-semibold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='%238a8f98'%3E%3Cpath d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 6px center;
    background-size: 8px;
    padding-right: 22px;
    outline: none;
    transition: filter 0.12s ease, box-shadow 0.12s ease;
}
.role-pill-select:hover,
.status-pill-select:hover { filter: brightness(1.1); }
.role-pill-select:focus,
.status-pill-select:focus { box-shadow: 0 0 0 3px rgba(94,106,210,0.18); }

.status-pill {
    display: inline-flex; align-items: center;
    padding: 1px 8px;
    border-radius: var(--radius-full);
    font-size: 10px;
    font-weight: var(--weight-medium);
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.status-pill-active    { background: var(--success-soft); color: var(--success); }
.status-pill-suspended { background: var(--danger-soft);  color: var(--danger); }

.credits-pill {
    display: inline-flex; align-items: center;
    padding: 2px 10px;
    border-radius: var(--radius-full);
    font-family: var(--font-mono);
    font-weight: var(--weight-semibold);
    font-size: var(--text-sm);
}
.credits-pill-high { background: var(--success-soft); color: var(--success); }
.credits-pill-mid  { background: var(--warning-soft); color: var(--warning); }
.credits-pill-low  { background: var(--danger-soft);  color: var(--danger); }

/* Editable credits input (pill-styled) */
.credits-input {
    display: inline-block;
    width: 90px;
    height: 28px;
    padding: 2px 10px;
    text-align: right;
    border: 1px solid transparent;
    border-radius: var(--radius-full);
    background: transparent;
    font-family: var(--font-mono);
    font-weight: var(--weight-semibold);
    font-size: var(--text-sm);
    cursor: pointer;
    transition: all 0.15s ease;
}
.credits-input.credits-pill-high,
.credits-input.credits-pill-mid,
.credits-input.credits-pill-low {
    border-color: transparent;
}
.credits-input:hover { border-color: var(--border-strong); }
.credits-input:focus {
    background: var(--bg-input);
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-soft);
    cursor: text;
}

/* Activity feed status colors */
.activity-icon.live    { background: var(--success-soft); color: var(--success); }
.activity-icon.dead    { background: var(--danger-soft);  color: var(--danger); }
.activity-icon.error   { background: var(--warning-soft); color: var(--warning); }
.activity-icon.pending { background: var(--bg-elevated);  color: var(--text-muted); }

/* ── Loading skeleton (shimmer) ─────────────────────────────── */
.skeleton {
    background: linear-gradient(90deg,
        var(--bg-elevated) 0%,
        var(--bg-overlay) 50%,
        var(--bg-elevated) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-sm);
    display: block;
    height: 14px;
    width: 100%;
}
.skeleton-line {
    height: 12px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    background: linear-gradient(90deg,
        var(--bg-elevated) 0%,
        var(--bg-overlay) 50%,
        var(--bg-elevated) 100%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s ease-in-out infinite;
}
.skeleton-line:nth-child(2) { width: 80%; animation-delay: 0.1s; }
.skeleton-line:nth-child(3) { width: 60%; animation-delay: 0.2s; }
.skeleton-line:nth-child(4) { width: 90%; animation-delay: 0.3s; }
@keyframes skeleton-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ── Empty state enhancements ──────────────────────────────── */
.empty {
    background: radial-gradient(ellipse at top, var(--bg-elevated) 0%, transparent 70%);
}
.empty .empty-icon {
    animation: empty-float 3s ease-in-out infinite;
    opacity: 0.5;
}
@keyframes empty-float {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-4px); }
}

/* Stat card glow on hover */
.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-1px);
    transition: all 0.15s ease;
}

/* ── Settings ───────────────────────────────────────────────── */
.config-grid {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 1px;
    background: var(--border-default);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.config-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    background: var(--bg-surface);
}
.config-key { font-size: var(--text-sm); color: var(--text-secondary); }
.config-value { font-size: var(--text-sm); color: var(--text-primary); font-weight: var(--weight-medium); font-family: var(--font-mono); }
