/* ================================================================
   DigiForensicsBeta — effects.css
   Visual polish: scrollbars, selection, transitions, animations,
   entrance effects, micro-interactions.
   ================================================================ */

/* --- Selection & Scrollbars ---------------------------------------- */
::selection {
    background: rgba(37, 99, 235, 0.14);
    color: var(--ink);
}

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(12, 18, 34, 0.12); border-radius: 999px; }
::-webkit-scrollbar-thumb:hover { background: rgba(12, 18, 34, 0.22); }

/* --- Base Transitions ---------------------------------------------- */
.section-link { transition: color 0.15s ease; }
.section-link:hover { color: var(--accent-hover); }

.question-index-link { transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease; }
.question-index-link:hover { transform: scale(1.08); }

.answer-option-row { transition: border-color 0.12s ease, background 0.12s ease, transform 0.12s ease; }
.answer-option-row:hover:not(.is-disabled) { transform: translateX(4px); }

.content-outline-link { transition: color 0.12s ease, border-color 0.12s ease, background 0.12s ease; }
.dfb-nav-link { transition: color 0.12s ease, background 0.12s ease; }

.btn {
    transition: background 0.15s ease, border-color 0.12s ease, color 0.12s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.btn:active:not(:disabled) { transform: scale(0.97); }

.notice-bar { transition: opacity 0.2s ease, transform 0.2s ease; }

/* --- Card Hover Effects -------------------------------------------- */
.quick-link-card {
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.quick-link-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.timeline-item {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.timeline-item:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-1px);
}

.package-line {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.package-line:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.question-stage { transition: border-color 0.2s ease, box-shadow 0.2s ease; }

.hero-entry, .df-entry {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.25s ease;
}
.hero-entry:hover, .df-entry:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow);
    transform: translateY(-3px);
}

.stat-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.stat-card:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-sm);
    transform: translateY(-1px);
}

.feature-band {
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.feature-band:hover {
    border-color: var(--border-strong);
    transform: translateY(-1px);
}

.catalog-line {
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}
.catalog-line:hover {
    border-color: var(--border-strong);
    background: var(--surface-alt);
    transform: translateX(3px);
}

.info-rail-section {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.info-rail-section:hover {
    border-color: var(--border-strong);
    box-shadow: var(--shadow-xs);
}

/* --- Copy Button --------------------------------------------------- */
a[data-copy-text] { cursor: pointer; }
a[data-copy-text].is-copied { color: var(--positive); }

/* --- Progress Bar Animation ---------------------------------------- */
.progress-bar { animation: progress-fill 0.8s cubic-bezier(0.16, 1, 0.3, 1); }

@keyframes progress-fill {
    from { width: 0; }
}

/* --- Fade / Reveal Animations -------------------------------------- */
.fade.show { animation: fade-in 0.2s ease; }

@keyframes fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes reveal-scale {
    from { opacity: 0; transform: scale(0.96); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes reveal-left {
    from { opacity: 0; transform: translateX(-16px); }
    to { opacity: 1; transform: translateX(0); }
}

/* --- Scroll-triggered Entrance ------------------------------------- */
.question-stage,
.timeline-item,
.catalog-line,
.info-rail-section,
.stat-card,
.hero-entry,
.df-entry,
.package-line,
.feature-band {
    opacity: 0;
    transform: translateY(16px);
}

.question-stage.is-revealed,
.timeline-item.is-revealed,
.info-rail-section.is-revealed,
.stat-card.is-revealed,
.hero-entry.is-revealed,
.df-entry.is-revealed,
.package-line.is-revealed,
.feature-band.is-revealed {
    animation: reveal-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.catalog-line.is-revealed {
    animation: reveal-left 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.surface.is-revealed {
    animation: reveal-scale 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.question-stage:nth-child(1) { animation-delay: 0s; }
.question-stage:nth-child(2) { animation-delay: 0.05s; }
.question-stage:nth-child(3) { animation-delay: 0.1s; }
.question-stage:nth-child(4) { animation-delay: 0.15s; }
.question-stage:nth-child(5) { animation-delay: 0.2s; }

.catalog-line:nth-child(1) { animation-delay: 0s; }
.catalog-line:nth-child(2) { animation-delay: 0.04s; }
.catalog-line:nth-child(3) { animation-delay: 0.08s; }
.catalog-line:nth-child(4) { animation-delay: 0.12s; }
.catalog-line:nth-child(5) { animation-delay: 0.16s; }

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.06s; }
.stat-card:nth-child(3) { animation-delay: 0.12s; }
.stat-card:nth-child(4) { animation-delay: 0.18s; }

/* --- Header animation ---------------------------------------------- */
.dfb-header {
    animation: header-slide-down 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes header-slide-down {
    from { opacity: 0; transform: translateY(-100%); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- Page head entrance -------------------------------------------- */
.page-head {
    animation: reveal-up 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.1s backwards;
}

.competition-hero {
    animation: reveal-scale 0.5s cubic-bezier(0.16, 1, 0.3, 1) 0.05s backwards;
}

/* --- Breadcrumbs --------------------------------------------------- */
.breadcrumbs {
    animation: fade-in 0.3s ease 0.05s backwards;
}

/* --- Chip subtle pulse on hover ------------------------------------ */
.chip {
    transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.chip:hover {
    transform: scale(1.04);
}

/* --- Brand mark pulse ---------------------------------------------- */
.dfb-brand-mark {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dfb-brand:hover .dfb-brand-mark {
    transform: scale(1.06);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* --- Question status legend dot pulse ------------------------------ */
.question-status-legend .dot {
    transition: transform 0.2s ease;
}
.question-status-legend span:hover .dot {
    transform: scale(1.4);
}

/* --- Loading / spinner --------------------------------------------- */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.is-loading::after {
    content: "";
    display: inline-block;
    width: 14px; height: 14px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 6px;
    vertical-align: middle;
}

/* --- Focus rings --------------------------------------------------- */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--border-focus);
    outline-offset: 2px;
}

/* --- Smooth page transitions (for turbo/etc if added later) -------- */
.dfb-page {
    animation: page-enter 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes page-enter {
    from { opacity: 0; }
    to { opacity: 1; }
}
