/* ================================================================
   gallery.css — FluentKit Gallery layout & design system
   ================================================================ */

/* ── Reset / base ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

/* ── Full-viewport root chain ──────────────────────────────────── */
/* The NavView lives in a wrapper div with height:100dvh (see MainLayout.razor).
   block-size:100% on .fluent-nav-view resolves against that explicit height.
   html/body/app just need to fill the viewport with no scrollbars. */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

#app {
    height: 100%;
    overflow: hidden;
}

/* ── Gallery shell layout ──────────────────────────────────────── */
.gallery-body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI Variable', 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: transparent;
}

/* Page content wrapper — adds consistent padding and max-width */
.gallery-page {
    padding: var(--spacing-l) var(--spacing-xl) var(--spacing-xxl);
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-l);
}

/* ── Page Header ───────────────────────────────────────────────── */
.page-header {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding-bottom: var(--spacing-l);
    border-bottom: 1px solid var(--card-stroke-default);
}

.page-header__eyebrow {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.6;
}

.page-header__title {
    font-size: 36px;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-fill-color-primary);
    margin: 0;
}

.page-header__description {
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-fill-color-secondary);
    max-width: 720px;
    margin: var(--spacing-xxs) 0 0;
}

.page-header__links {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    flex-wrap: wrap;
}

/* ── Control Example block ─────────────────────────────────────── */
.control-example {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--card-stroke-default);
    border-radius: var(--overlay-corner-radius);
    /* Deliberately NOT overflow:hidden here — popouts/flyouts opened inside .control-example__demo
       (TimePicker, Calendar, ComboBox, Flyout, ...) are absolutely positioned and need to be able to
       visually escape this box rather than get clipped at its edge. Corner-rounding for the header
       and code panel is instead handled by giving those two children their own matching radii. */
    background: var(--card-background-default);
}

.control-example__header {
    border-radius: var(--overlay-corner-radius) var(--overlay-corner-radius) 0 0;
}

.control-example__header {
    padding: var(--spacing-m) var(--spacing-m) var(--spacing-s);
    border-bottom: 1px solid var(--card-stroke-default);
}

.control-example__header-text {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-fill-color-primary);
    margin: 0;
}

.control-example__header-desc {
    font-size: 12px;
    color: var(--text-fill-color-secondary);
    margin: var(--spacing-xxs) 0 0;
    line-height: 1.5;
}

.control-example__body {
    display: flex;
    flex-direction: column;
}

/* Live demo area */
.control-example__demo {
    position: relative;
    z-index: 1;
    overflow: visible;
    padding: var(--spacing-l) var(--spacing-l);
    background: var(--card-background-default);
    border-bottom: 1px solid var(--card-stroke-default);
}

/* Options row (optional interactive tweaks panel) */
.control-example__options {
    padding: var(--spacing-m) var(--spacing-m);
    background: var(--layer-background-default, var(--subtle-fill-color-secondary));
    border-bottom: 1px solid var(--card-stroke-default);
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-m);
    align-items: center;
}

.control-example__options-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-fill-color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-right: var(--spacing-xxs);
}

/* Code panel — uses the same generic surface token everywhere so the chrome
   (pivot header/tabs) and the code itself always agree with each other and
   with the active app theme, instead of a static dark hex. */
.control-example__code-panel {
    border-radius: 0 0 var(--overlay-corner-radius) var(--overlay-corner-radius);
    overflow: hidden;
}

/* Pivot inside code panel — blend header into the panel background, remove content padding */
.control-example__code-panel .fluent-pivot-header {
    padding: 0 var(--spacing-xs);
}

.control-example__code-panel .fluent-pivot-tab {
    font-size: 12px;
    padding: var(--spacing-xs) var(--spacing-s);
}

.control-example__code-panel .fluent-pivot-content {
    padding: 0;
    max-height: 400px;
    overflow: auto;
    position: relative;
}


/* ── Sample Code Block ─────────────────────────────────────────── */
.sample-code-block {
    margin: 0;
    padding: 0;
}

.sample-code-block pre[class*="language-"] {
    margin: 0;
    padding: var(--spacing-m) var(--spacing-m);
    border-radius: 0;
    background: var(--solid-background-fill-color-base) !important;
    font-size: 13px;
    line-height: 1.6;
    tab-size: 2;
}

.sample-code-block code[class*="language-"] {
    font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
    font-size: 13px;
}

/* Prism.js only ships the "tomorrow" (dark) theme (see index.html), so its
   token colors are tuned for a dark background. Once the panel background
   above follows the light-mode token it turns light, and the dark theme's
   pale token colors become unreadable ("cursed"). Re-map just the token
   colors — not layout — to a legible light-mode palette, scoped to the
   light theme so dark mode is untouched. */
html[data-theme="light"] .sample-code-block pre[class*="language-"],
html[data-theme="light"] .sample-code-block code[class*="language-"] {
    color: var(--text-fill-color-primary);
    text-shadow: none;
}

html[data-theme="light"] .sample-code-block .token.comment,
html[data-theme="light"] .sample-code-block .token.prolog,
html[data-theme="light"] .sample-code-block .token.doctype,
html[data-theme="light"] .sample-code-block .token.cdata {
    color: var(--text-fill-color-tertiary);
}

html[data-theme="light"] .sample-code-block .token.punctuation {
    color: var(--text-fill-color-secondary);
}

html[data-theme="light"] .sample-code-block .token.tag,
html[data-theme="light"] .sample-code-block .token.keyword,
html[data-theme="light"] .sample-code-block .token.selector,
html[data-theme="light"] .sample-code-block .token.deleted {
    color: #a626a4;
}

html[data-theme="light"] .sample-code-block .token.attr-name,
html[data-theme="light"] .sample-code-block .token.function-variable,
html[data-theme="light"] .sample-code-block .token.function,
html[data-theme="light"] .sample-code-block .token.class-name {
    color: #4078f2;
}

html[data-theme="light"] .sample-code-block .token.attr-value,
html[data-theme="light"] .sample-code-block .token.string,
html[data-theme="light"] .sample-code-block .token.char,
html[data-theme="light"] .sample-code-block .token.regex,
html[data-theme="light"] .sample-code-block .token.inserted,
html[data-theme="light"] .sample-code-block .token.builtin {
    color: #50a14f;
}

html[data-theme="light"] .sample-code-block .token.number,
html[data-theme="light"] .sample-code-block .token.boolean,
html[data-theme="light"] .sample-code-block .token.constant,
html[data-theme="light"] .sample-code-block .token.symbol,
html[data-theme="light"] .sample-code-block .token.property {
    color: #986801;
}

html[data-theme="light"] .sample-code-block .token.operator,
html[data-theme="light"] .sample-code-block .token.entity,
html[data-theme="light"] .sample-code-block .token.url,
html[data-theme="light"] .sample-code-block .token.variable {
    color: #383a42;
}

/* Copy button inside code block */
.code-copy-btn {
    position: absolute;
    top: 8px;
    right: 10px;
    padding: var(--spacing-xxs) var(--spacing-s);
    font-size: 11px;
    font-weight: 500;
    
    /* Acrylic Material */
    background: rgba(30, 30, 30, 0.45) !important;
    backdrop-filter: blur(12px) saturate(1.25);
    -webkit-backdrop-filter: blur(12px) saturate(1.25);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--control-corner-radius);
    color: #e2e2e2;
    cursor: pointer;
    transition: 
        background-color var(--duration-fast) var(--easing-standard), 
        border-color var(--duration-fast) var(--easing-standard),
        transform var(--duration-fast) var(--easing-standard);
    font-family: inherit;
    z-index: 10;
}

.code-copy-btn:hover {
    background: rgba(45, 45, 45, 0.65) !important;
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

.code-copy-btn:active {
    background: rgba(25, 25, 25, 0.8) !important;
    transform: scale(0.96);
}

.code-copy-btn--copied {
    color: #4cd964 !important;
    border-color: rgba(76, 217, 100, 0.4) !important;
    background: rgba(76, 217, 100, 0.15) !important;
}


/* ── Home Page ─────────────────────────────────────────────────── */
.home-hero {
    position: relative;
    padding: var(--spacing-xxl) var(--spacing-xxl);
    overflow: hidden;
    border-radius: var(--overlay-corner-radius);
    background: linear-gradient(135deg, #0e162d 0%, #1c0e2a 45%, #2a0b27 75%, #18193f 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    z-index: 1;
}

/* Glowing radial mesh background overlay */
.home-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: 
        radial-gradient(circle at 15% 25%, rgba(98, 0, 234, 0.3) 0%, transparent 55%),
        radial-gradient(circle at 85% 20%, rgba(0, 229, 255, 0.2) 0%, transparent 45%),
        radial-gradient(circle at 50% 85%, rgba(245, 0, 87, 0.18) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

html[data-theme="light"] .home-hero {
    background: linear-gradient(135deg, #ced8e4 0%, #d8e1eb 50%, #e3e9f2 100%);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: #000000;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
}

html[data-theme="light"] .home-hero::before {
    background: 
        radial-gradient(circle at 10% 20%, rgba(200, 220, 245, 0.6) 0%, transparent 60%),
        radial-gradient(circle at 90% 80%, rgba(225, 210, 240, 0.5) 0%, transparent 55%);
}

.home-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xxs);
    padding: var(--spacing-xxs) var(--spacing-s);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: var(--pill-corner-radius);
    font-size: 12px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: var(--spacing-m);
}

html[data-theme="light"] .home-hero__badge {
    background: rgba(0, 95, 184, 0.08);
    border: 1px solid rgba(0, 95, 184, 0.2);
    color: var(--accent-fill-color-default);
}

.home-hero__title {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.1;
    color: inherit;
    margin: 0 0 var(--spacing-s);
    letter-spacing: -0.5px;
}

.home-hero__title span {
    background: linear-gradient(90deg, #60a5fa, #c084fc, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

html[data-theme="light"] .home-hero__title span {
    background: linear-gradient(90deg, #005fb8, #8664b8, #b93b8f);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.home-hero__subtitle {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
    max-width: 620px;
    margin: 0 0 var(--spacing-xl);
}

html[data-theme="light"] .home-hero__subtitle {
    color: var(--text-fill-color-secondary);
}

.home-hero__stats {
    display: flex;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.home-stat {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xxs);
}

.home-stat__number {
    font-size: 30px;
    font-weight: 700;
    color: #60a5fa;
    line-height: 1;
}

html[data-theme="light"] .home-stat__number {
    color: var(--accent-fill-color-default);
}

.home-stat__label {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.7);
}

html[data-theme="light"] .home-stat__label {
    color: var(--text-fill-color-secondary);
}

/* Control card grid */
.home-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-s);
}

.home-section__title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-fill-color-primary);
    padding: 0 var(--spacing-xxs);
}

.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: var(--spacing-m);
}

.control-card {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    padding: var(--spacing-m);
    border-radius: var(--overlay-corner-radius);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    
    /* Acrylic Style */
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px) saturate(1.25);
    -webkit-backdrop-filter: blur(20px) saturate(1.25);
    border: 1px solid rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
    
    /* Background-only transition — transform/shadow now live on the reveal wrapper */
    transition: 
        background-color var(--duration-normal) var(--easing-standard),
        border-color var(--duration-normal) var(--easing-standard);
}

.control-card:hover {
    background: rgba(255, 255, 255, 0.7);
}

html[data-theme="dark"] .control-card {
    background: rgba(45, 45, 45, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.07);
}

html[data-theme="dark"] .control-card:hover {
    background: rgba(55, 55, 55, 0.60);
}

.control-card__icon {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(128, 128, 128, 0.08);
    border-radius: var(--overlay-corner-radius);
    color: var(--accent-text-fill-color-primary);
}


.control-card__name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-fill-color-primary);
    line-height: 1.3;
}

.control-card__category {
    font-size: 11px;
    color: var(--text-fill-color-secondary);
}

/* Reveal wrapper — fills the grid cell and owns the lift animation so the
   reveal spotlight pseudo-elements rise together with the card on hover */
.fluent-reveal:has(.control-card) {
    display: flex;
    flex-direction: column;

    /* Override FluentRevealBackground's own transform baseline so we can
       add our lift on top without fighting its perspective() default */
    transform: perspective(600px) translateY(0) scale(1);
    transition:
        transform var(--duration-normal) var(--easing-decelerate),
        box-shadow var(--duration-normal) var(--easing-standard);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
    border-radius: var(--overlay-corner-radius);
}

.fluent-reveal:has(.control-card):hover {
    transform: perspective(600px) translateY(-4px) scale(1);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.08);
}

/* Active press — inherit reveal's own slight squish */
.fluent-reveal:has(.control-card):active {
    transform: perspective(600px) translateY(-1px) scale(0.98);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}

html[data-theme="dark"] .fluent-reveal:has(.control-card) {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

html[data-theme="dark"] .fluent-reveal:has(.control-card):hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.fluent-reveal .control-card {
    flex: 1;
}


/* ── Settings Page ─────────────────────────────────────────────── */
.settings-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.settings-group__title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-fill-color-primary);
    margin: 0 0 var(--spacing-xs);
}

.fluent-file-upload-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xxs) var(--spacing-s);
    background: var(--control-fill-color-default);
    border: 1px solid var(--control-stroke-color-default);
    border-radius: var(--control-corner-radius);
    color: var(--text-fill-color-primary);
    font-size: var(--font-size-body);
    font-weight: 400;
    cursor: pointer;
    transition: background var(--duration-fast), border-color var(--duration-fast);
}

.fluent-file-upload-btn:hover {
    background: var(--control-fill-color-secondary);
}

.fluent-file-upload-btn:active {
    background: var(--control-fill-color-tertiary);
}


/* ── Demo layout helpers ───────────────────────────────────────── */
.demo-row {
    display: flex;
    gap: var(--spacing-m);
    align-items: center;
    flex-wrap: wrap;
}

.demo-col {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.demo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-m);
}

.demo-output {
    margin-top: var(--spacing-s);
    padding: var(--spacing-xs) var(--spacing-s);
    background: var(--subtle-fill-color-secondary);
    border-radius: var(--control-corner-radius);
    font-size: 12px;
    color: var(--text-fill-color-secondary);
    font-family: monospace;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 640px) {
    .gallery-page { padding: var(--spacing-m) var(--spacing-m) var(--spacing-xl); }
    .home-hero { padding: var(--spacing-l) var(--spacing-l); }
    .home-hero__title { font-size: 28px; }
    .control-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
    .page-header__title { font-size: 26px; }
}

/* ── Mica Transparency Overrides ───────────────────────────────── */
/* In order for the background MicaPanel to shine through beautifully, 
   we override the NavigationView's solid pane and content backgrounds 
   with premium, WinUI-spec translucent alternatives. */
.fluent-nav-view {
    background-color: transparent !important;
}

.fluent-nav-view-pane {
    background: rgba(243, 243, 243, 0.45) !important;
}

.fluent-nav-view-content {
    background: rgba(249, 249, 249, 0.3) !important;
}

/* Dark theme translucent layers */
html[data-theme="dark"] .fluent-nav-view-pane {
    background: rgba(32, 32, 32, 0.45) !important;
}

html[data-theme="dark"] .fluent-nav-view-content {
    background: rgba(26, 26, 26, 0.3) !important;
}

