/* ============================================
   ClawSearch — Safe Skill Discovery
   Theme: ClawSec Lobster Red + Search Focus
   ============================================ */

@import url('shared-theme.css');

/* ─── Header ─── */
.header {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    gap: 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
    background: rgba(255,255,255,0.92);
}
.header-logo {
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    letter-spacing: -0.3px;
}
.header-logo .search { color: var(--primary); }
.header-logo .logo-icon { width: 24px; height: 24px; margin-right: 6px; }
.header-logo .logo-text { letter-spacing: -0.5px; }
.header-search {
    flex: 1;
    max-width: 480px;
    position: relative;
}
.header-search input {
    width: 100%;
    padding: 9px 16px 9px 36px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-family: var(--font-sans);
    outline: none;
    transition: all 0.2s;
    background: var(--bg-secondary);
}
.header-search input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-bg);
    background: var(--bg-card);
}
.header-search::before {
    content: '\1F50D';
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    opacity: 0.4;
}
.header-nav {
    display: flex;
    gap: 20px;
    font-size: 13px;
    font-weight: 500;
    flex-shrink: 0;
}
.header-nav { font-size: 14px; }
.header-nav a { color: var(--text-secondary); transition: color 0.15s; }
.header-nav a:hover { color: var(--primary); text-decoration: none; }

/* ─── Home ─── */
.home {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px 24px 48px;
}
.home-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.home-logo-icon {
    width: 48px;
    height: 48px;
}
.home-title {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.5px;
}
.home-title .search { color: var(--primary); }
.home-subtitle {
    color: var(--text-secondary);
    font-size: 16px;
    margin-bottom: 36px;
    font-weight: 400;
}
.home-search {
    width: 100%;
    max-width: 560px;
    margin-bottom: 48px;
    position: relative;
}
.home-search input {
    width: 100%;
    padding: 16px 24px 16px 48px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 16px;
    font-family: var(--font-sans);
    outline: none;
    transition: all 0.25s;
    background: var(--bg-card);
    box-shadow: var(--shadow-md);
}
.home-search input:focus {
    border-color: var(--primary);
    box-shadow: var(--shadow-red);
}
.home-search input::placeholder { color: var(--text-muted); }
.home-search::before {
    content: '\1F50D';
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.35;
}

/* ─── Language Hint ─── */
.home-lang-hint {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 36px;
    max-width: 560px;
}
.lang-tag {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 20px;
    transition: all 0.15s;
}
.lang-tag:last-child {
    color: var(--primary);
    border-color: var(--lobster-200);
    background: var(--primary-bg);
}

/* ─── Stats Bar ─── */
.stats-bar {
    display: flex;
    gap: 16px;
    margin-bottom: 56px;
    flex-wrap: wrap;
    justify-content: center;
}
.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 28px;
    text-align: center;
    min-width: 110px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s, box-shadow 0.15s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-value { font-size: 26px; font-weight: 700; letter-spacing: -0.5px; }
.stat-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-top: 4px;
    font-weight: 500;
}
.stat-value.total { color: var(--text-primary); }
.stat-value.safe { color: var(--safe); }
.stat-value.suspicious { color: var(--suspicious); }
.stat-value.malicious { color: var(--malicious); }

/* ─── Section ─── */
.section { width: 100%; max-width: 860px; margin: 0 auto; padding: 0 24px; }
.section-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.section-title::before {
    content: '';
    width: 4px;
    height: 18px;
    background: var(--primary);
    border-radius: 2px;
}

/* ─── Skill Card ─── */
.skill-list { display: flex; flex-direction: column; gap: 6px; }
.skill-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.15s;
}
.skill-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 12px rgba(232, 82, 74, 0.08);
    transform: translateY(-1px);
}
.skill-info { flex: 1; min-width: 0; }
.skill-name { font-size: 16px; font-weight: 600; color: var(--text-primary); }
.skill-author { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.skill-intent {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 500px;
}
.skill-meta {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-shrink: 0;
}
.skill-downloads { font-size: 13px; color: var(--text-muted); font-family: var(--font-mono); }

/* Author trust colors */
.author-link { font-weight: 500; text-decoration: none !important; }
.author-link:hover { text-decoration: underline !important; }
.author-trusted { color: #059669; }
.author-established { color: #2563eb; }
.author-emerging { color: #d97706; }
.author-questionable { color: #ea580c; }
.author-untrusted { color: #dc2626; }
.author-unknown { color: var(--text-muted); }

/* ─── Trust Badge ─── */
.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.2px;
}
.trust-badge.verified_safe { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.trust-badge.mostly_safe { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.trust-badge.use_with_caution { background: #fffbeb; color: #b45309; border: 1px solid #fde68a; }
.trust-badge.suspicious { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.trust-badge.dangerous { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.trust-badge.unknown { background: #f8fafc; color: #64748b; border: 1px solid #e2e8f0; }
.trust-dots {
    display: inline-flex;
    gap: 3px;
    align-items: center;
}
.trust-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.25;
}
.trust-dot.filled { opacity: 1; }

/* ─── Verdict Tag ─── */
.verdict-tag {
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.verdict-tag.SAFE { background: var(--safe-bg); color: var(--safe); }
.verdict-tag.SUSPICIOUS { background: var(--suspicious-bg); color: var(--suspicious); }
.verdict-tag.MALICIOUS { background: var(--malicious-bg); color: var(--malicious); }
.verdict-tag.UNKNOWN { background: #f1f5f9; color: #64748b; }

/* ─── Search Results ─── */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.results-count { font-size: 14px; color: var(--text-secondary); }
.results-filters select {
    padding: 7px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    font-family: var(--font-sans);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
}

/* ─── Skill Detail ─── */
.detail { max-width: 680px; margin: 32px auto; padding: 0 24px; }
.detail-header { margin-bottom: 24px; }
.detail-name { font-size: 28px; font-weight: 700; letter-spacing: -0.3px; }
.detail-author { font-size: 15px; color: var(--text-muted); margin-top: 6px; }
.detail-trust-hero {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    padding: 20px;
    background: var(--primary-bg);
    border: 1px solid var(--lobster-100);
    border-radius: var(--radius);
}
.detail-trust-score {
    font-size: 36px;
    font-weight: 700;
    color: var(--primary);
    font-family: var(--font-mono);
}
.detail-section {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-sm);
}
.detail-section h3 {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

/* ─── Trust Breakdown Bars ─── */
.trust-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.trust-bar-label { width: 110px; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.trust-bar-track {
    flex: 1;
    height: 6px;
    background: var(--border-light);
    border-radius: 3px;
    overflow: hidden;
}
.trust-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.trust-bar-value {
    width: 40px;
    text-align: right;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-mono);
    color: var(--text-primary);
}

/* ─── Compare ─── */
.compare-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    padding: 32px 24px;
    max-width: 960px;
    margin: 0 auto;
}
.compare-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-sm);
}
.compare-card h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }

/* ─── Detail Info Grid ─── */
.detail-info-grid { display: flex; flex-direction: column; gap: 10px; }
.detail-info-item {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 13px; padding-bottom: 8px; border-bottom: 1px solid var(--border-light);
}
.detail-info-item:last-child { border: none; padding: 0; }
.detail-info-label { color: var(--text-muted); font-weight: 500; }
.detail-install-cmd {
    font-family: var(--font-mono); font-size: 12px; color: var(--primary);
    background: var(--primary-bg); padding: 2px 8px; border-radius: 4px;
}

/* ─── Audit Card ─── */
.audit-card { border-left: 3px solid var(--primary); }
.audit-summary-text {
    font-size: 15px; line-height: 1.7; color: var(--text-secondary);
    margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border-light);
}
.audit-threat-bar {
    display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap;
}
.audit-threat-item {
    display: flex; flex-direction: column; align-items: center;
    padding: 10px 16px; border-radius: var(--radius-sm);
    background: var(--bg-secondary); min-width: 64px;
}
.audit-threat-count { font-size: 22px; font-weight: 700; font-family: var(--font-mono); }
.audit-threat-label { font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }
.audit-threat-item.high .audit-threat-count { color: #ef4444; }
.audit-threat-item.medium .audit-threat-count { color: #f59e0b; }
.audit-threat-item.low .audit-threat-count { color: #6b7280; }
.audit-threat-item.safe .audit-threat-count { color: #10b981; }

.audit-sandbox {
    margin-bottom: 20px; padding: 14px; background: #f8fafc;
    border-radius: var(--radius-sm); border: 1px solid var(--border-light);
}
.audit-sandbox h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 10px; }
.audit-sandbox-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 8px; }
.audit-sandbox-label { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.audit-sandbox-value { font-size: 14px; font-weight: 600; font-family: var(--font-mono); }

.audit-recommendations { margin-bottom: 20px; }
.audit-recommendations h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--text-muted); margin-bottom: 10px; }
.audit-rec-item {
    font-size: 14px; color: var(--text-secondary); line-height: 1.6;
    padding: 8px 12px; margin-bottom: 6px;
    background: #fffbeb; border-left: 2px solid #f59e0b; border-radius: 0 4px 4px 0;
}

.audit-full-link {
    display: inline-flex; align-items: center;
    font-size: 14px; font-weight: 600; color: var(--primary);
    padding: 8px 16px; border: 1px solid var(--primary);
    border-radius: var(--radius-sm); transition: all 0.15s;
}
.audit-full-link:hover {
    background: var(--primary); color: white; text-decoration: none;
}

/* ─── Responsive Detail ─── */
@media (max-width: 640px) {
    .detail-trust-hero { flex-wrap: wrap; }
    div[style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; }
    .audit-sandbox-grid { grid-template-columns: 1fr 1fr; }
}

/* ─── Install Command ─── */
.install-cmd {
    background: #1e293b;
    color: #e2e8f0;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    margin-top: 8px;
    user-select: all;
}

/* ─── Misc ─── */
.loading { text-align: center; padding: 48px; color: var(--text-muted); font-size: 15px; }
.page { display: none; }
.page.active { display: block; }

/* ─── Footer ─── */
.footer {
    text-align: center;
    padding: 32px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border-light);
    margin-top: 64px;
}
.footer a { color: var(--primary); }

/* ─── Animations ─── */
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.skill-card { animation: fadeUp 0.3s ease both; }
.skill-card:nth-child(1) { animation-delay: 0s; }
.skill-card:nth-child(2) { animation-delay: 0.04s; }
.skill-card:nth-child(3) { animation-delay: 0.08s; }
.skill-card:nth-child(4) { animation-delay: 0.12s; }
.skill-card:nth-child(5) { animation-delay: 0.16s; }
.stat-card { animation: fadeUp 0.4s ease both; }
.stat-card:nth-child(1) { animation-delay: 0.1s; }
.stat-card:nth-child(2) { animation-delay: 0.2s; }
.stat-card:nth-child(3) { animation-delay: 0.3s; }
.stat-card:nth-child(4) { animation-delay: 0.4s; }

/* ─── Responsive ─── */
@media (max-width: 640px) {
    .home { padding: 60px 16px 32px; }
    .home-title { font-size: 24px; }
    .home-search input { padding: 14px 20px 14px 44px; font-size: 15px; }
    .stats-bar { gap: 8px; }
    .stat-card { min-width: 72px; padding: 12px 16px; }
    .stat-value { font-size: 20px; }
    .header-nav { display: none; }
    .skill-meta { flex-wrap: wrap; gap: 6px; }
    .skill-intent { max-width: 200px; }
}
