/* ============================================================
   Prompt Gallery — App Shell Layout
   Top Bar + Side Nav (desktop) / Off-canvas (mobile) + Bottom Tab Bar
   + Footer. Mobile-first, production layout.
   ============================================================ */

:root {
    --top-bar-height: 64px;
    --bottom-bar-height: 62px;
    --side-nav-width: 264px;
    --z-topbar: 100;
    --z-sidenav: 110;
    --z-backdrop: 105;
    --z-bottombar: 100;
}

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

.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---------------- Top Bar ---------------- */
.top-bar {
    position: sticky;
    top: 0;
    z-index: var(--z-topbar);
    height: var(--top-bar-height);
    background: rgba(247, 246, 243, 0.92);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    transition: box-shadow 0.25s ease;
}



.top-bar.is-scrolled {
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

.top-bar-inner {
    height: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    flex-shrink: 0;
    padding: 0;
}

.icon-btn:hover {
    background: var(--primary-soft);
    color: var(--primary);
    border-color: transparent;
}

.top-bar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.15rem;
    color: var(--text-primary);
    white-space: nowrap;
    flex-shrink: 0;
}

.top-bar-logo img {
    max-height: 36px;
    width: auto;
    display: block;
}

.logo-mark {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: var(--primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1rem;
    flex-shrink: 0;
}

.top-bar-search {
    flex: 1;
    display: none;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 9999px;
    padding: 0 16px;
    height: 42px;
    max-width: 480px;
    color: var(--text-muted);
    margin: 0 auto;
}

.top-bar-search input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-family: var(--font-body);
    font-size: 0.88rem;
    color: var(--text-primary);
    min-width: 0;
}

.top-bar-search:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-soft);
}

.top-bar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
    flex-shrink: 0;
}

.top-bar-cta {
    color: #25D366;
}

@media (min-width: 900px) {
    .top-bar-search { display: flex; }
    .top-bar-search-toggle { display: none; }
}

/* Slide-down mobile search bar */
.top-bar-mobile-search {
    display: none;
    padding: 10px 16px 14px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-primary);
}

.top-bar-mobile-search.is-open {
    display: block;
}

/* ---------------- Side Navigation ---------------- */
.side-nav {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--side-nav-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    z-index: var(--z-sidenav);
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
}

.side-nav.is-open {
    transform: translateX(0);
    box-shadow: 8px 0 30px rgba(0, 0, 0, 0.08);
}

.side-nav-scroll {
    padding: calc(var(--top-bar-height) + 20px) 16px 40px;
}

.side-nav-section {
    margin-bottom: 28px;
}

.side-nav-heading {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--text-muted);
    padding: 0 12px;
    margin-bottom: 10px;
}

.side-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: var(--radius-md);
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--transition);
}

.side-nav-link:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
}

.side-nav-link.is-active {
    background: var(--primary-soft);
    color: var(--primary);
}

.side-nav-link svg { flex-shrink: 0; }

.side-nav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.55;
    flex-shrink: 0;
}

.side-nav-count {
    margin-left: auto;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: var(--text-muted);
}

.side-nav-social .social-links-row {
    padding: 0 12px;
}

.sidebar-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(17, 17, 17, 0.35);
    z-index: var(--z-backdrop);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

.sidebar-backdrop.is-visible {
    opacity: 1;
    visibility: visible;
}

@media (min-width: 1100px) {
    .side-nav {
        transform: translateX(0);
        box-shadow: none;
    }
    .sidebar-backdrop { display: none; }
    .sidebar-toggle { display: none; }
    .top-bar,
    .app-content,
    .site-footer { margin-left: var(--side-nav-width); }
}

/* ---------------- App Content ---------------- */
.app-content {
    flex: 1;
    min-width: 0;
    padding-bottom: 20px;
}

@media (max-width: 899px) {
    .app-content { padding-bottom: var(--bottom-bar-height); }
}

/* ---------------- Social Links (shared) ---------------- */
.social-links-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.social-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: var(--transition);
}

.social-link-btn:hover {
    color: #fff;
    border-color: transparent;
}

.social-link-instagram:hover { background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888); }
.social-link-whatsapp:hover { background: #25D366; }
.social-link-facebook:hover { background: #1877F2; }
.social-link-youtube:hover { background: #FF0000; }
.social-link-tiktok:hover { background: #000000; }
.social-link-twitter:hover { background: #000000; }
.social-link-email:hover { background: var(--primary); }

/* ---------------- Footer ---------------- */
.site-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    margin-top: 60px;
}

.site-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px 30px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 36px;
}

@media (min-width: 700px) {
    .site-footer-inner {
        grid-template-columns: 1.4fr 1fr 1fr 1fr;
        gap: 24px;
    }
}

.footer-logo {
    display: block;
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 1.3rem;
    color: var(--text-primary);
    margin-bottom: 12px;
}

.footer-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 16px;
    max-width: 340px;
}

.footer-heading {
    font-family: var(--font-body);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.footer-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.footer-links a:hover { color: var(--text-primary); }

.site-footer-bottom {
    border-top: 1px solid var(--border-color);
    padding: 18px 20px;
    text-align: center;
}

.site-footer-bottom p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted);
}

@media (max-width: 899px) {
    .site-footer { margin-bottom: var(--bottom-bar-height); }
}

/* ---------------- Back To Top ---------------- */
.back-to-top {
    position: fixed;
    right: 20px;
    bottom: calc(var(--bottom-bar-height) + 20px);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: var(--transition);
    z-index: 90;
}

.back-to-top.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

@media (min-width: 900px) {
    .back-to-top { bottom: 24px; }
}

/* ---------------- Mobile Bottom Tab Bar ---------------- */
.bottom-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--bottom-bar-height);
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-color);
    z-index: var(--z-bottombar);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (min-width: 900px) {
    .bottom-bar { display: none; }
}

.bottom-bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    background: none;
    border: none;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 0.65rem;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 2px;
    transition: var(--transition);
}

.bottom-bar-item.is-active,
.bottom-bar-item:active {
    color: var(--primary);
}

.logo-mark {
    background: linear-gradient(135deg, var(--primary), var(--accent-2)) !important;
}

.bottom-bar-item svg { flex-shrink: 0; }

/* ---------------- Utility ---------------- */
body.nav-open { overflow: hidden; }



/* ---------------- Mobile typography & overflow guards ---------------- */
html, body { overflow-x: hidden; max-width: 100%; }

@media (max-width: 640px) {
    .gallery-hero { padding: 40px 16px 30px; }
    .gallery-hero h1 { font-size: 2.1rem; }
    .gallery-hero p { font-size: 1rem; }
    .landing-title { font-size: 1.8rem; }
    .landing-subtitle { font-size: 0.95rem; padding: 0 8px; }
    .prompt-single-title { font-size: 1.7rem; }
    .related-prompts-title { font-size: 1.4rem; }
    .ad-slot,
    .ad-slot-placeholder-inner { width: 100%; box-sizing: border-box; }
}
