/* ── Texter Captcha Solver — Dashboard Styles ── */

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

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

:root {
    --bg-base: #0c0c14;
    --bg-surface: #14141f;
    --bg-card: #1a1a2e;
    --bg-card-hover: #21213a;
    --bg-elevated: #252540;
    --text-primary: #eaeaf5;
    --text-secondary: #a0a0c0;
    --text-muted: #606080;
    --accent: #7c6aff;
    --accent-light: #9b8dff;
    --accent-glow: rgba(124, 106, 255, 0.25);
    --accent-secondary: #ff6b8a;
    --accent-sec-glow: rgba(255, 107, 138, 0.2);
    --border: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(124, 106, 255, 0.3);
    --success: #34d399;
    --success-bg: rgba(52, 211, 153, 0.1);
    --warning: #fbbf24;
    --warning-bg: rgba(251, 191, 36, 0.1);
    --danger: #f87171;
    --danger-bg: rgba(248, 113, 113, 0.1);
    --info: #60a5fa;
    --info-bg: rgba(96, 165, 250, 0.1);
    --radius: 14px;
    --radius-sm: 10px;
    --radius-xs: 6px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app {
    max-width: 960px;
    margin: 0 auto;
}

/* ── Header ── */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, var(--bg-surface) 0%, rgba(124, 106, 255, 0.06) 100%);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(16px);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    max-width: 960px;
    margin: 0 auto;
}

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

.logo h1 {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.3px;
    background: linear-gradient(135deg, #7c6aff 0%, #ff6b8a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

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

.btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border: none;
    border-radius: var(--radius-xs);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.btn-clear {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid rgba(248, 113, 113, 0.2);
}

.btn-clear:hover {
    background: rgba(248, 113, 113, 0.2);
}

/* ── Content ── */
.content {
    padding: 20px 24px 40px;
}

/* ── Stats Grid ── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 28px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: all var(--transition);
}

.stat-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

.stat-icon {
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    flex-shrink: 0;
}

.stat-total .stat-icon {
    background: linear-gradient(135deg, rgba(124, 106, 255, 0.2), rgba(124, 106, 255, 0.05));
    color: var(--accent-light);
}

.stat-success .stat-icon {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(52, 211, 153, 0.05));
    color: var(--success);
}

.stat-fail .stat-icon {
    background: linear-gradient(135deg, rgba(248, 113, 113, 0.2), rgba(248, 113, 113, 0.05));
    color: var(--danger);
}

.stat-rate .stat-icon {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.05));
    color: var(--warning);
}

.stat-avg .stat-icon {
    background: linear-gradient(135deg, rgba(96, 165, 250, 0.2), rgba(96, 165, 250, 0.05));
    color: var(--info);
}

.stat-conf .stat-icon {
    background: linear-gradient(135deg, rgba(255, 107, 138, 0.2), rgba(255, 107, 138, 0.05));
    color: var(--accent-secondary);
}

.stat-saved .stat-icon {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.25), rgba(124, 106, 255, 0.1));
    color: #a5f3c4;
}

.stat-body {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.5px;
    line-height: 1.1;
}

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

/* ── Section ── */
.section {
    margin-bottom: 28px;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.section-header svg {
    color: var(--accent);
    opacity: 0.7;
}

.section-header h2 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--text-muted);
}

/* ── Engine Cards ── */
.engine-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.engine-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    transition: all var(--transition);
}

.engine-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

.engine-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.engine-badge {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 800;
    flex-shrink: 0;
}

.engine-badge.eci {
    background: linear-gradient(135deg, rgba(124, 106, 255, 0.2), rgba(124, 106, 255, 0.08));
    color: var(--accent-light);
    border: 1px solid rgba(124, 106, 255, 0.15);
}

.engine-badge.uidai {
    background: linear-gradient(135deg, rgba(251, 191, 36, 0.2), rgba(251, 191, 36, 0.08));
    color: var(--warning);
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.engine-badge.wbreg {
    background: linear-gradient(135deg, rgba(52, 211, 153, 0.2), rgba(52, 211, 153, 0.08));
    color: var(--success);
    border: 1px solid rgba(52, 211, 153, 0.15);
}

.engine-badge.banglarbhumi {
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(34, 211, 238, 0.08));
    color: #22d3ee;
    border: 1px solid rgba(34, 211, 238, 0.15);
}

.engine-badge.wbpds {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.08));
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.15);
}

.engine-badge.rupashree {
    background: linear-gradient(135deg, rgba(8, 145, 178, 0.2), rgba(8, 145, 178, 0.08));
    color: #0891b2;
    border: 1px solid rgba(8, 145, 178, 0.15);
}

.engine-badge.edistwb {
    background: linear-gradient(135deg, rgba(100, 116, 139, 0.2), rgba(100, 116, 139, 0.08));
    color: #64748b;
    border: 1px solid rgba(100, 116, 139, 0.15);
}

.engine-badge.kanyashree {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.2), rgba(236, 72, 153, 0.08));
    color: #ec4899;
    border: 1px solid rgba(236, 72, 153, 0.15);
}

.engine-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
}

.engine-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.engine-stat {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.engine-stat-label {
    font-size: 9px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.engine-stat-value {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-primary);
}

.engine-stat-value.success {
    color: var(--success);
}

.engine-stat-value.danger {
    color: var(--danger);
}

.engine-stat-value.accent {
    color: var(--accent-light);
}

/* ── Progress Bar ── */
.progress-bar {
    width: 100%;
    height: 4px;
    background: var(--bg-elevated);
    border-radius: 4px;
    margin-top: 12px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--accent), var(--success));
    transition: width 0.5s ease;
}

/* ── Site Table ── */
.site-table-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.site-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.site-table thead th {
    padding: 10px 14px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--text-muted);
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
}

.site-table tbody tr {
    transition: background var(--transition);
}

.site-table tbody tr:hover {
    background: var(--bg-card-hover);
}

.site-table tbody td {
    padding: 10px 14px;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border);
    font-weight: 500;
}

.site-table tbody tr:last-child td {
    border-bottom: none;
}

.site-table .hostname {
    color: var(--accent-light);
    font-weight: 600;
}

.site-table .success-val {
    color: var(--success);
    font-weight: 600;
}

.site-table .fail-val {
    color: var(--danger);
    font-weight: 600;
}

.empty-table {
    padding: 30px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
    display: none;
}

/* ── Activity Feed ── */
.activity-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    max-height: 360px;
    overflow-y: auto;
}

.activity-list::-webkit-scrollbar {
    width: 4px;
}

.activity-list::-webkit-scrollbar-track {
    background: transparent;
}

.activity-list::-webkit-scrollbar-thumb {
    background: var(--bg-elevated);
    border-radius: 10px;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
    animation: fadeIn 0.2s ease;
}

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

.activity-item:hover {
    background: var(--bg-card-hover);
}

.activity-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.activity-dot.success {
    background: var(--success);
    box-shadow: 0 0 8px rgba(52, 211, 153, 0.4);
}

.activity-dot.fail {
    background: var(--danger);
    box-shadow: 0 0 8px rgba(248, 113, 113, 0.4);
}

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

.activity-text {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
}

.activity-text strong {
    color: var(--text-primary);
    font-weight: 600;
}

.activity-text .solved-val {
    color: var(--accent-light);
    font-weight: 700;
}

.activity-meta {
    display: flex;
    gap: 12px;
    margin-top: 2px;
}

.activity-meta span {
    font-size: 10px;
    color: var(--text-muted);
}

.activity-time {
    font-size: 11px;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}

.empty-activity {
    padding: 30px;
    text-align: center;
    font-size: 12px;
    color: var(--text-muted);
}

/* ── Animations ── */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Responsive ── */
@media (max-width: 700px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .engine-cards {
        grid-template-columns: 1fr;
    }
}