/* DepDrift — Dark Ocean Theme
   Uses glassmorphism, subtle glowing animations, and clean ocean palette. */

/* ── Reset & Base ──────────────────────────────────────────────── */

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

[hidden], .modal-backdrop[hidden] {
    display: none !important;
}

:root {
    /* ocean palette */
    --bg-deep:       #060a13;
    --bg-primary:    #0a1020;
    --bg-card:       rgba(13, 22, 45, 0.75);
    --glass:         rgba(255, 255, 255, 0.04);
    --glass-border:  rgba(255, 255, 255, 0.08);
    --glass-hover:   rgba(255, 255, 255, 0.07);

    /* text */
    --text-primary:   #e8ecf4;
    --text-secondary: #7b8ba8;
    --text-muted:     #4a5672;

    /* accents */
    --accent:    #0069ff;
    --cyan:      #00c9db;
    --teal:      #00b386;

    /* risk colors */
    --critical:  #ff4757;
    --breaking:  #ffa348;
    --safe:      #2ed573;
    --skip:      #596275;
    --current:   #3d5a80;
    --unknown:   #a55eea;

    /* layout */
    --max-width: 900px;
    --radius:    12px;
    --radius-sm: 8px;

    /* typography */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono:    'JetBrains Mono', 'Fira Code', monospace;
}

html {
    background: var(--bg-deep);
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    background: radial-gradient(circle at 50% -10%, rgba(0, 105, 255, 0.18), transparent 50%),
                radial-gradient(circle at 85% 30%, rgba(0, 201, 219, 0.08), transparent 40%),
                var(--bg-deep);
}

a {
    color: var(--cyan);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* ── Particle Canvas ───────────────────────────────────────────── */

#particles {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.55;
}

/* ── Container ─────────────────────────────────────────────────── */

.container {
    position: relative;
    z-index: 1;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 56px 24px 80px;
}

/* ── Hero ──────────────────────────────────────────────────────── */

.hero {
    text-align: center;
    padding: 64px 0 36px;
    animation: fadeUp 0.8s ease-out both;
}

.hero__title {
    font-family: var(--font-heading);
    font-size: clamp(2.8rem, 6vw, 4.2rem);
    font-weight: 800;
    letter-spacing: -1.5px;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--cyan) 0%, var(--accent) 55%, var(--teal) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    -webkit-text-fill-color: transparent;
    margin: 0 auto 16px;
    text-align: center;
    display: block;
}

.hero__icon {
    display: inline-block;
    animation: spinSlow 12s linear infinite;
    -webkit-text-fill-color: initial;
    filter: drop-shadow(0 0 10px rgba(0, 201, 219, 0.4));
}

.hero__subtitle {
    color: var(--text-secondary);
    font-size: 1.12rem;
    max-width: 540px;
    margin: 0 auto 36px;
    line-height: 1.7;
}

.hero__sub-detail {
    color: var(--text-muted);
    font-size: 0.92rem;
}

/* ── Scan Form Capsule ─────────────────────────────────────────── */

.scan-form {
    max-width: 560px;
    margin: 0 auto;
}

.scan-form__input-wrap {
    display: flex;
    align-items: stretch;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--glass-border);
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    transition: border-color 0.25s, box-shadow 0.25s;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}

.scan-form__input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 24px rgba(0, 105, 255, 0.35);
}

.scan-form__input {
    flex: 1;
    min-width: 0;
    background: transparent;
    border: none;
    padding: 14px 20px;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.95rem;
    outline: none;
}

.scan-form__input::placeholder {
    color: var(--text-muted);
}

.scan-form__btn {
    padding: 14px 28px;
    background: linear-gradient(135deg, var(--accent), #0050cc);
    color: #fff;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s, box-shadow 0.2s;
    min-width: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.scan-form__btn:hover {
    opacity: 0.92;
    box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.2);
}

.scan-form__btn:active {
    transform: scale(0.98);
}

.scan-form__btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.scan-form__hint {
    margin-top: 14px;
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
}

.link-btn {
    background: none;
    border: none;
    color: var(--cyan);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    padding: 0 2px;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    transition: color 0.15s;
}

.link-btn:hover {
    color: var(--text-primary);
}

/* ── Live Log Section ──────────────────────────────────────────── */

.log-section {
    animation: fadeUp 0.4s ease-out both;
    margin: 24px 0;
}

.log-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    background: var(--glass);
    border: 1px solid var(--glass-border);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--text-secondary);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

/* ── Stats ─────────────────────────────────────────────────────── */

.stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    margin: 32px 0 24px;
    animation: fadeUp 0.5s ease-out both;
}

@media (max-width: 820px) {
    .stats { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 520px) {
    .stats { grid-template-columns: repeat(2, 1fr); }
}

.stat-card {
    text-align: center;
    padding: 22px 14px;
    border-radius: var(--radius);
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(12px);
    transition: transform 0.2s, border-color 0.2s;
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.15);
}

.stat-card__number {
    display: block;
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-primary);
    font-variant-numeric: tabular-nums;
}

.stat-card--warn .stat-card__number   { color: var(--breaking); }
.stat-card--danger .stat-card__number { color: var(--critical); }
.stat-card--bb .stat-card__number     { color: #f59e0b; }
.stat-card--accent .stat-card__number { color: var(--cyan); }

.stat-card__label {
    display: block;
    margin-top: 4px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* ── Action Strip (Filter & Fast Actions) ───────────────────────── */

.action-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
    animation: fadeUp 0.4s ease-out both;
}

.filter-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.filter-pill {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 100px;
    padding: 5px 14px;
    font-size: 0.78rem;
    font-family: var(--font-mono);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.15s;
}

.filter-pill:hover {
    color: var(--text-primary);
    background: var(--glass-hover);
}

.filter-pill.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.filter-pill--critical.active { background: var(--critical); border-color: var(--critical); }
.filter-pill--breaking.active { background: var(--breaking); border-color: var(--breaking); }
.filter-pill--safe.active     { background: var(--safe); border-color: var(--safe); }
.filter-pill--current.active  { background: var(--current); border-color: var(--current); }

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

.btn-action {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 6px 14px;
    font-size: 0.8rem;
    font-family: var(--font-body);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}

.btn-action:hover {
    background: var(--glass-hover);
    border-color: rgba(255, 255, 255, 0.2);
}

/* ── Results ───────────────────────────────────────────────────── */

.results {
    animation: fadeUp 0.5s ease-out both;
}

.repo-group {
    margin-bottom: 32px;
    animation: fadeUp 0.5s ease-out both;
}

.repo-group__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-radius: var(--radius) var(--radius) 0 0;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-bottom: none;
}

.repo-group__name {
    font-family: var(--font-mono);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
}

.repo-group__name a { color: inherit; }
.repo-group__name a:hover { color: var(--cyan); }

.repo-group__stats {
    margin-left: auto;
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* Dependency card */
.dep-card {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 16px;
    padding: 16px 20px;
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-top: none;
    transition: background 0.2s, transform 0.1s;
    animation: fadeIn 0.3s ease-out both;
    cursor: pointer;
}

.dep-card:last-child {
    border-radius: 0 0 var(--radius) var(--radius);
}

.dep-card:hover {
    background: var(--glass-hover);
}

.dep-card__name {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.92rem;
    color: #fff;
}

.dep-card__version {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text-muted);
}

.dep-card__version .arrow {
    color: var(--text-muted);
    margin: 0 4px;
}

.dep-card__version .latest {
    color: var(--text-secondary);
}

.dep-card__badge {
    justify-self: end;
    align-self: start;
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.dep-card__bb-tag {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 2px 0;
}

.bb-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.35);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
}

.bb-session {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.dep-card__cve-banner {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 71, 87, 0.12);
    border: 1px solid rgba(255, 71, 87, 0.3);
    color: var(--critical);
    font-size: 0.78rem;
    padding: 4px 10px;
    border-radius: 4px;
    margin: 3px 0;
}

.dep-card__summary {
    grid-column: 1 / -1;
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.dep-card__action {
    grid-column: 1 / -1;
    font-size: 0.8rem;
    color: var(--text-muted);
    font-style: italic;
}

/* risk badge colors */
.badge--CRITICAL  { background: rgba(255, 71, 87, 0.15); color: var(--critical); border: 1px solid rgba(255, 71, 87, 0.3); }
.badge--BREAKING  { background: rgba(255, 163, 72, 0.15); color: var(--breaking); border: 1px solid rgba(255, 163, 72, 0.3); }
.badge--SAFE      { background: rgba(46, 213, 115, 0.12); color: var(--safe); border: 1px solid rgba(46, 213, 115, 0.25); }
.badge--SKIP      { background: rgba(89, 98, 117, 0.15); color: var(--skip); border: 1px solid rgba(89, 98, 117, 0.3); }
.badge--CURRENT   { background: rgba(61, 90, 128, 0.12); color: var(--current); border: 1px solid rgba(61, 90, 128, 0.25); }
.badge--UNKNOWN   { background: rgba(165, 94, 234, 0.12); color: var(--unknown); border: 1px solid rgba(165, 94, 234, 0.25); }

/* changelog link */
.dep-card__link {
    font-size: 0.78rem;
    color: var(--cyan);
    opacity: 0.75;
    transition: opacity 0.2s;
}

.dep-card__link:hover {
    opacity: 1;
}

/* ── Spinner ───────────────────────────────────────────────────── */

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.15);
    border-top-color: var(--cyan);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner--sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

/* ── Modal Dialogs ─────────────────────────────────────────────── */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 8, 18, 0.82);
    backdrop-filter: blur(14px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop:not([hidden]) {
    display: flex;
}

.modal-card {
    background: #0a1122;
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 24px;
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.75);
    animation: fadeUp 0.3s ease-out both;
}

.modal-card--lg {
    max-width: 720px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 12px;
}

.modal-title {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.btn-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: color 0.15s;
    padding: 0 4px;
}

.btn-close:hover {
    color: #fff;
}

.modal-desc {
    font-size: 0.86rem;
    color: var(--text-secondary);
    margin-bottom: 14px;
    line-height: 1.5;
}

.manifest-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 12px;
    outline: none;
    resize: vertical;
}

.manifest-textarea:focus {
    border-color: var(--accent);
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 16px;
}

.inspect-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 10px;
}

@media (max-width: 560px) {
    .inspect-grid { grid-template-columns: 1fr; }
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    text-transform: uppercase;
    font-weight: 500;
}

.modal-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    padding: 9px 12px;
    outline: none;
}

.modal-input:focus {
    border-color: var(--accent);
}

.single-result-box {
    margin-top: 18px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
}

.diag-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 0.85rem;
}

.diag-status--ok { color: var(--safe); font-weight: 600; }
.diag-status--warn { color: var(--breaking); font-weight: 600; }

/* ── Toast ─────────────────────────────────────────────────────── */

.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    background: #0d162d;
    border: 1px solid var(--cyan);
    color: #fff;
    padding: 10px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.2s ease-out both;
}

/* ── Footer ────────────────────────────────────────────────────── */

.footer {
    margin-top: 48px;
    padding: 24px;
    text-align: center;
    font-size: 0.82rem;
    color: var(--text-muted);
    border-top: 1px solid var(--glass-border);
    animation: fadeUp 0.5s ease-out both;
}

.footer a { color: var(--cyan); }

/* ── Animations ────────────────────────────────────────────────── */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes spinSlow {
    to { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 8px var(--teal); }
    50%      { opacity: 0.4; box-shadow: 0 0 4px var(--teal); }
}
