/* Qannas header - mockup direction */
#header.qn-header {
    position: sticky;
    top: 0;
    z-index: 120;
    --qn-primary: #7F0D1D;
    --qn-primary-dark: #650916;
    --qn-accent: #DC2626;
    --qn-bg: #FAFAF9;
    --qn-text: #1F2937;
    --qn-border: #E5E7EB;
}

body.admin-bar #header.qn-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar #header.qn-header {
        top: 46px;
    }
}

.qn-topbar {
    color: #fff;
    background:
        radial-gradient(circle at 50% 0%, rgba(220,38,38,.20), transparent 42%),
        linear-gradient(180deg, #5a0712 0%, var(--qn-primary) 100%);
    border-bottom: 1px solid rgba(255,255,255,.12);
}

.qn-topbar-inner {
    min-height: 46px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    font-size: .82rem;
}

.qn-topbar-links,
.qn-topbar-tagline,
.qn-topbar-utilities {
    display: flex;
    align-items: center;
    gap: 12px;
}

.qn-topbar-links {
    justify-content: flex-start;
}

.qn-topbar-tagline {
    justify-content: center;
}

.qn-topbar-utilities {
    justify-content: flex-end;
}

.qn-topbar-links a {
    color: rgba(255,255,255,.90) !important;
    text-decoration: none;
    transition: color .2s ease, opacity .2s ease;
}

.qn-topbar-links a:hover {
    color: #fff !important;
}

.qn-topbar-links > span {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,.28);
}

.qn-topbar-tagline {
    color: rgba(255,255,255,.88);
}

.qn-topbar-tagline i {
    display: block;
    width: 30px;
    height: 3px;
    border-radius: 99px;
    background: var(--qn-accent);
}

.qn-topbar-latest {
    min-height: 32px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 12px;
    border-radius: 999px;
    color: #fff !important;
    background: rgba(255,255,255,.10);
    border: 1px solid rgba(255,255,255,.18);
    font-size: .78rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease, border-color .2s ease;
}

.qn-topbar-latest:hover {
    background: rgba(255,255,255,.16);
    border-color: rgba(255,255,255,.28);
}

.qn-topbar-latest svg,
.qn-topbar-btn svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qn-topbar-btn {
    position: relative;
    width: 32px;
    height: 32px;
    flex: 0 0 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: #fff !important;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.18);
    transition: background .2s ease, transform .2s ease;
}

.qn-topbar-btn:hover {
    color: #fff !important;
    background: rgba(255,255,255,.16);
    transform: translateY(-1px);
}

.qn-mainbar {
    background:
        linear-gradient(180deg, rgba(255,255,255,.96), rgba(250,250,249,.98)),
        var(--qn-bg);
    border-bottom: 1px solid var(--qn-border);
    box-shadow: 0 12px 36px rgba(31,41,55,.08);
}

.qn-mainbar-inner {
    min-height: 112px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(24px, 3vw, 48px);
}

.qn-brand {
    min-width: 250px;
}

.qn-brand .site-logo,
.qn-brand .site-logo a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.qn-brand .site-logo {
    padding: 0;
}

.qn-brand .site-logo img {
    width: 250px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
}

/* Rocket outputs light + dark logo images; this draft uses one universal transparent logo. */
.qn-brand .logo-img[data-display="dark"] {
    display: none !important;
}

.qn-brand .logo-img[data-display="light"] {
    display: block !important;
}

.qn-brand .site-logo .title {
    display: none !important;
}

.qn-mainnav {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    gap: 0;
}

.qn-mainnav a {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 72px;
    padding: 0 24px;
    color: var(--qn-text) !important;
    font-weight: 700;
    font-size: .97rem;
    white-space: nowrap;
    text-decoration: none;
    border-inline-start: 1px solid var(--qn-border);
    transition: color .2s ease, background .2s ease;
}

.qn-mainnav a:first-child {
    border-inline-start: 0;
}

.qn-mainnav a::after {
    content: "";
    position: absolute;
    inset-inline: 30%;
    bottom: 8px;
    height: 3px;
    border-radius: 99px;
    background: var(--qn-primary);
    transform: scaleX(0);
    transition: transform .2s ease;
}

.qn-mainnav a:hover {
    color: var(--qn-primary) !important;
    background: rgba(127,13,29,.025);
}

.qn-mainnav a:hover::after,
.qn-mainnav-home::after {
    transform: scaleX(1);
}

.qn-mainnav-home {
    color: var(--qn-primary) !important;
    font-weight: 800 !important;
}

.qn-header-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
}

.qn-mobile-tool {
    display: none !important;
}

.qn-latest-apps {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0 20px;
    border-radius: 13px;
    color: #fff !important;
    background: linear-gradient(135deg, var(--qn-accent), var(--qn-primary));
    box-shadow: 0 10px 24px rgba(127,13,29,.20);
    font-size: .90rem;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
    transition: transform .2s ease, box-shadow .2s ease;
}

.qn-latest-apps:hover {
    color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(127,13,29,.27);
}

.qn-latest-apps svg {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qn-round-btn {
    position: relative;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--qn-text) !important;
    background: #fff;
    border: 1px solid var(--qn-border);
    box-shadow: 0 7px 18px rgba(31,41,55,.07);
    transition: transform .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.qn-round-btn:hover {
    color: var(--qn-primary) !important;
    border-color: rgba(127,13,29,.32);
    transform: translateY(-2px);
    box-shadow: 0 11px 24px rgba(31,41,55,.12);
}

.qn-round-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.qn-theme-icon {
    position: absolute;
}

[data-theme="light"] .qn-theme-moon,
[data-theme="dark"] .qn-theme-sun {
    display: block;
}

[data-theme="light"] .qn-theme-sun,
[data-theme="dark"] .qn-theme-moon {
    display: none;
}

/* Dark mode */
[data-theme="dark"] #header.qn-header {
    --qn-bg: #1f2023;
    --qn-text: #F3F4F6;
    --qn-border: #34373d;
}

[data-theme="dark"] .qn-mainbar {
    background: #1f2023;
    border-bottom-color: #34373d;
    box-shadow: 0 12px 34px rgba(0,0,0,.22);
}

[data-theme="dark"] .qn-mainnav a {
    color: #F3F4F6 !important;
    border-color: #34373d;
}

[data-theme="dark"] .qn-mainnav a:hover,
[data-theme="dark"] .qn-mainnav-home {
    color: #fff !important;
}

[data-theme="dark"] .qn-round-btn {
    color: #F3F4F6 !important;
    background: #292c31;
    border-color: #3a3e45;
}

[data-theme="dark"] .qn-round-btn:hover {
    color: #fff !important;
    border-color: rgba(220,38,38,.50);
}

/* Footer polish */
#footer {
    border-top: 1px solid var(--bg-color-3);
}

#footer a {
    transition: opacity .2s ease, color .2s ease;
}

#footer a:hover {
    color: var(--site-color);
}

@media (max-width: 1350px) {
    .qn-mainbar-inner {
        grid-template-columns: auto minmax(0, 1fr) auto;
        gap: 16px;
    }

    .qn-brand {
        min-width: 188px;
    }

    .qn-brand .site-logo img {
        width: 188px;
    }

    .qn-mainnav a {
        padding-inline: 13px;
        font-size: .89rem;
    }

    .qn-header-tools {
        gap: 7px;
    }

    .qn-latest-apps {
        width: auto;
        min-width: 142px;
        min-height: 46px;
        padding: 0 15px;
        border-radius: 13px;
        font-size: .84rem;
    }

    .qn-latest-apps span {
        display: inline;
    }
}

@media (max-width: 1120px) {
    .qn-mainnav a {
        padding-inline: 10px;
        font-size: .86rem;
    }

    .qn-brand {
        min-width: 172px;
    }

    .qn-brand .site-logo img {
        width: 172px;
    }

    .qn-round-btn {
        width: 42px;
        min-width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .qn-latest-apps {
        min-width: 132px;
        min-height: 42px;
        padding-inline: 13px;
        font-size: .80rem;
    }
}

@media (max-width: 991px) {
    .qn-topbar {
        display: none;
    }

    .qn-mainbar-inner {
        min-height: 76px;
        grid-template-columns: auto 1fr auto;
        gap: 10px;
    }

    .qn-brand {
        min-width: 0;
    }

    .qn-brand .site-logo img {
        width: 148px;
        max-height: 54px;
    }

    .qn-mainnav {
        display: none;
    }

    .qn-header-tools {
        gap: 6px;
    }

    .qn-mobile-tool {
        display: inline-flex !important;
    }

    .qn-latest-apps {
        display: none;
    }

    .qn-round-btn {
        width: 39px;
        height: 39px;
        flex-basis: 39px;
    }
}

@media (max-width: 575px) {
    .qn-mainbar-inner {
        min-height: 70px;
    }

    .qn-brand .site-logo img {
        width: 132px;
    }

    .qn-round-btn {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
    }

    .qn-round-btn svg {
        width: 18px;
        height: 18px;
    }
}
