/* ================================================================
   DigiForensics2026 — 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; }
}

/* ================================================================
   DigiForensics2026 motion overrides
   ================================================================ */

::selection {
    background: rgba(255, 215, 0, 0.22);
    color: #111116;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: #0d0d1a;
}

::-webkit-scrollbar-thumb {
    background: #2a2a4a;
    border: 1px solid #0d0d1a;
}

body.theme-DigiForensics2026 .btn,
body.theme-DigiForensics2026 .catalog-line,
body.theme-DigiForensics2026 .package-line,
body.theme-DigiForensics2026 .timeline-item,
body.theme-DigiForensics2026 .feature-band,
body.theme-DigiForensics2026 .writeup-card,
body.theme-DigiForensics2026 .df26-console,
body.theme-DigiForensics2026 .df26-entry-card {
    transition:
        transform 0.14s steps(2, end),
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

body.theme-DigiForensics2026 .btn:hover,
body.theme-DigiForensics2026 .catalog-line:hover,
body.theme-DigiForensics2026 .package-line:hover,
body.theme-DigiForensics2026 .timeline-item:hover,
body.theme-DigiForensics2026 .feature-band:hover,
body.theme-DigiForensics2026 .writeup-card:hover,
body.theme-DigiForensics2026 .df26-console:hover,
body.theme-DigiForensics2026 .df26-entry-card:hover {
    box-shadow: 6px 6px 0 rgba(0, 0, 0, 0.42), 0 0 18px rgba(255, 215, 0, 0.08);
}

body.theme-DigiForensics2026 .surface.is-revealed {
    animation: reveal-scale 0.28s steps(6, end) forwards;
}

body.theme-DigiForensics2026 .catalog-line.is-revealed {
    animation: reveal-left 0.26s steps(6, end) forwards;
}

body.theme-DigiForensics2026 .page-head {
    animation: reveal-up 0.3s steps(6, end) 0.05s backwards;
}

/* ================================================================
   Cross-page consistency layer
   ================================================================ */

body.theme-DigiForensics2026 {
    --theme-panel-bg: rgba(13, 18, 34, 0.88);
    --theme-panel-muted-bg: rgba(17, 23, 42, 0.8);
    --theme-panel-border: rgba(60, 63, 103, 0.96);
    --theme-panel-shadow: 6px 6px 0 rgba(0, 0, 0, 0.38);
    --theme-panel-shadow-soft: 4px 4px 0 rgba(0, 0, 0, 0.3);
    --theme-card-radius: 0;
    --theme-row-radius: 0;
    --theme-page-bottom: clamp(44px, 6vw, 82px);
}

body.theme-DigiForensics2026 .dfb-page {
    padding-bottom: var(--theme-page-bottom);
}

body.theme-DigiForensics2026 .dfb-page > .dfb-container > :last-child {
    margin-bottom: clamp(22px, 4vw, 48px);
}

body.theme-DigiForensics2026 .breadcrumbs {
    margin-bottom: 14px;
    color: #a9b4ce;
    font-size: 12px;
    line-height: 1.7;
    letter-spacing: 0.02em;
}

body.theme-DigiForensics2026 .breadcrumbs a {
    color: #cbd5f5;
}

body.theme-DigiForensics2026 .breadcrumbs strong {
    color: #f8fbff;
    font-weight: 650;
}

body.theme-DigiForensics2026 .page-head,
body.theme-DigiForensics2026 header.page-head,
body.theme-DigiForensics2026 .page-head-compact,
body.theme-DigiForensics2026 header.page-head-compact {
    margin-bottom: clamp(18px, 2.4vw, 30px);
    padding-top: clamp(10px, 1.4vw, 18px);
    padding-bottom: clamp(10px, 1.4vw, 18px);
}

body.theme-DigiForensics2026 .page-title {
    max-width: 920px;
    color: #fff6c5;
    font-size: clamp(25px, 2.8vw, 38px);
    line-height: 1.16;
    letter-spacing: 0.015em;
    text-shadow: none;
}

body.theme-DigiForensics2026 .page-lead {
    max-width: 780px;
    margin-top: 10px;
    color: #aeb8cf;
    font-size: clamp(14px, 1.25vw, 17px);
    line-height: 1.78;
}

body.theme-DigiForensics2026 .page-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 12px;
    color: #98a4bf;
    font-size: 12px;
}

body.theme-DigiForensics2026 .section-head,
body.theme-DigiForensics2026 .panel-head,
body.theme-DigiForensics2026 .catalog-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

body.theme-DigiForensics2026 .section-title,
body.theme-DigiForensics2026 .dash-section-title,
body.theme-DigiForensics2026 .catalog-title,
body.theme-DigiForensics2026 .panel-head h2,
body.theme-DigiForensics2026 .panel-head h3 {
    color: #ffe45c;
    line-height: 1.25;
    letter-spacing: 0.02em;
    text-shadow: none;
}

body.theme-DigiForensics2026 :is(.surface, .surface-muted, .surface-plain, .workspace-panel, .auth-panel, .quick-link-card, .timeline-item, .package-line, .feature-band, .info-rail-section, .stat-card, .catalog-line, .writeup-card, .notice-bar, .empty-state, .df-panel, .doc-rail, .doc-outline-panel, .writeup-meta-card, .info-copy-card, .query-bar, .compact-query-bar) {
    border-color: var(--theme-panel-border) !important;
    border-radius: var(--theme-card-radius) !important;
    box-shadow: none !important;
}

body.theme-DigiForensics2026 :is(.page-head, .competition-hero, .surface, .surface-muted, .surface-plain, .workspace-panel, .quick-link-card, .timeline-item, .package-line, .feature-band, .info-rail-section, .stat-card, .catalog-line, .writeup-card, .empty-state, .df-panel, .query-bar, .compact-query-bar) {
    opacity: 1 !important;
    transform: none !important;
    animation: none !important;
}

body.theme-DigiForensics2026 :is(.surface, .surface-plain, .workspace-panel, .auth-panel, .quick-link-card, .timeline-item, .package-line, .feature-band, .info-rail-section, .stat-card, .writeup-card, .notice-bar, .empty-state, .df-panel, .doc-rail, .doc-outline-panel, .writeup-meta-card, .info-copy-card, .query-bar, .compact-query-bar) {
    background: var(--theme-panel-bg) !important;
}

body.theme-DigiForensics2026 :is(.surface-muted, .catalog-line) {
    background: var(--theme-panel-muted-bg) !important;
}

body.theme-DigiForensics2026 :is(.catalog-line, .writeup-card, .quick-link-card, .package-line, .timeline-item, .info-link-card) {
    border-radius: var(--theme-row-radius) !important;
}

body.theme-DigiForensics2026 :is(.catalog-line, .writeup-card, .quick-link-card, .package-line, .timeline-item, .info-link-card):hover {
    border-color: rgba(255, 215, 0, 0.82) !important;
    box-shadow: var(--theme-panel-shadow-soft) !important;
    transform: none !important;
}

body.theme-DigiForensics2026 :is(.surface-pad-lg, .auth-panel, .workspace-panel .panel-body) {
    padding: clamp(18px, 2.1vw, 28px);
}

body.theme-DigiForensics2026 .catalog {
    display: grid;
    gap: 12px;
}

body.theme-DigiForensics2026 .catalog-line {
    padding: clamp(14px, 1.6vw, 20px);
}

body.theme-DigiForensics2026 .catalog-title,
body.theme-DigiForensics2026 .catalog-title-link,
body.theme-DigiForensics2026 .writeup-card-title,
body.theme-DigiForensics2026 .card-title-link {
    font-weight: 750;
    letter-spacing: 0.015em;
}

body.theme-DigiForensics2026 .catalog-summary,
body.theme-DigiForensics2026 .writeup-card-lead,
body.theme-DigiForensics2026 .section-summary {
    color: #aeb8cf;
    line-height: 1.72;
}

body.theme-DigiForensics2026 :is(.query-bar, .compact-query-bar, .query-grid, .query-grid-compact) {
    gap: 12px;
    margin-bottom: clamp(16px, 2vw, 24px);
}

body.theme-DigiForensics2026 :is(.form-control, .form-select, .query-control) {
    min-height: 42px;
    border-color: rgba(69, 73, 119, 0.96);
    border-radius: 0;
    background-color: rgba(14, 20, 38, 0.96);
    color: #eef4ff;
    font-size: 14px;
}

body.theme-DigiForensics2026 textarea.form-control {
    min-height: 132px;
    line-height: 1.68;
}

body.theme-DigiForensics2026 :is(.form-control, .form-select, .query-control):focus {
    border-color: rgba(0, 229, 255, 0.78);
    box-shadow: 0 0 0 1px rgba(0, 229, 255, 0.36);
}

body.theme-DigiForensics2026 .content-shell,
body.theme-DigiForensics2026 .doc-index,
body.theme-DigiForensics2026 .profile-layout,
body.theme-DigiForensics2026 .auth-layout {
    gap: clamp(18px, 2.4vw, 30px);
    align-items: start;
}

body.theme-DigiForensics2026 .aside-stack {
    display: grid;
    gap: 16px;
}

@media (min-width: 1025px) {
    body.theme-DigiForensics2026 :is(.doc-rail, .aside-stack, .profile-side) {
        position: sticky;
        top: 92px;
    }
}

@media (max-width: 768px) {
    body.theme-DigiForensics2026 .dfb-page {
        padding-bottom: 42px;
    }

    body.theme-DigiForensics2026 .breadcrumbs {
        margin-bottom: 10px;
        font-size: 11px;
    }

    body.theme-DigiForensics2026 .page-head,
    body.theme-DigiForensics2026 header.page-head,
    body.theme-DigiForensics2026 .page-head-compact,
    body.theme-DigiForensics2026 header.page-head-compact {
        margin-bottom: 16px;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    body.theme-DigiForensics2026 .page-title {
        font-size: clamp(23px, 7.4vw, 30px);
        line-height: 1.2;
    }

    body.theme-DigiForensics2026 .page-lead {
        font-size: 13px;
        line-height: 1.7;
    }

    body.theme-DigiForensics2026 .section-head,
    body.theme-DigiForensics2026 .panel-head,
    body.theme-DigiForensics2026 .catalog-head {
        flex-direction: column;
        align-items: stretch;
    }

    body.theme-DigiForensics2026 :is(.surface-pad-lg, .surface-pad, .auth-panel, .workspace-panel .panel-body) {
        padding: 16px;
    }

    body.theme-DigiForensics2026 .catalog-line {
        padding: 14px;
    }

    body.theme-DigiForensics2026 .content-shell,
    body.theme-DigiForensics2026 .doc-index,
    body.theme-DigiForensics2026 .profile-layout,
    body.theme-DigiForensics2026 .auth-layout {
        gap: 16px;
    }
}
