/* ============================================================
   TempoMail USA — App Directory (FIX-5 A1)
   /apps index + /apps/{slug} show
   Design System: pastel-glass, indigo #4f46e5 family, Jakarta.
   Replaces the iOS-clone styling (iOS blue, fake store chrome).
   ============================================================ */

.dsa-wrap { max-width: 1200px; margin: 0 auto; padding: 44px 20px 76px; }
.dsa-h1 { font-size: clamp(32px, 5vw, 46px); font-weight: 800; letter-spacing: -.03em; color: var(--ink); margin: 16px 0 12px; line-height: 1.1; }

.dsa-hero { text-align: center; max-width: 720px; margin: 0 auto 30px; }
.dsa-lead { color: var(--muted); font-size: 15.5px; line-height: 1.65; margin: 0 auto; }

.dsa-search { position: relative; max-width: 520px; margin: 24px auto 0; }
.dsa-search > i {
    position: absolute; right: 20px; top: 50%; transform: translateY(-50%);
    color: var(--muted); font-size: 14px; pointer-events: none;
}
.dsa-search input {
    width: 100%; min-height: 52px; border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .78);
    -webkit-backdrop-filter: blur(14px) saturate(1.5);
    backdrop-filter: blur(14px) saturate(1.5);
    box-shadow: 0 14px 30px -16px rgba(76, 64, 180, .3);
    padding: 13px 48px 13px 22px;
    font-family: inherit; font-size: 15px; font-weight: 600;
    color: var(--ink); -webkit-text-fill-color: var(--ink); caret-color: #4f46e5;
    outline: none; transition: border-color .15s ease, box-shadow .15s ease;
}
html[data-theme="dark"] .dsa-search input {
    background: rgba(23, 30, 48, .8); border-color: rgba(255, 255, 255, .14);
}
.dsa-search input:focus { border-color: #4f46e5; box-shadow: 0 0 0 4px rgba(79, 70, 229, .18); }
.dsa-search input::placeholder { color: var(--muted); -webkit-text-fill-color: var(--muted); }

/* Category filter pills */
.dsa-pills {
    display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 16px;
    scrollbar-width: none; -ms-overflow-style: none;
}
.dsa-pills::-webkit-scrollbar { display: none; }
@media (min-width: 768px) { .dsa-pills { justify-content: center; } }
.dsa-pill {
    flex: none; min-height: 44px; padding: 10px 20px; border-radius: 999px;
    border: 1px solid var(--ds-line); cursor: pointer;
    background: rgba(255, 255, 255, .65);
    font-family: inherit; font-weight: 700; font-size: 13.5px; color: var(--muted);
    transition: all .2s ease;
}
html[data-theme="dark"] .dsa-pill { background: rgba(255, 255, 255, .06); }
.dsa-pill:hover { border-color: rgba(79, 70, 229, .45); color: #4338ca; }
.dsa-pill.active {
    background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; border-color: transparent;
    box-shadow: 0 8px 18px -8px rgba(79, 70, 229, .65);
}

/* Featured card */
.dsa-feature {
    position: relative; display: block; text-decoration: none;
    border-radius: 28px; overflow: hidden; color: #fff;
    padding: clamp(26px, 5vw, 46px);
    background: linear-gradient(120deg, #0b0f19, #1b2450 55%, #312e81);
    box-shadow: 0 30px 60px -24px rgba(27, 36, 80, .55);
    margin-bottom: 34px;
    transition: transform .25s ease, box-shadow .25s ease;
}
.dsa-feature:hover { transform: translateY(-3px); color: #fff; box-shadow: 0 36px 70px -24px rgba(27, 36, 80, .6); }
.dsa-feature-badge {
    display: inline-block; padding: 7px 15px; border-radius: 999px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .25);
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
}
.dsa-feature h2 { font-size: clamp(28px, 4.5vw, 44px); font-weight: 800; letter-spacing: -.02em; margin: 52px 0 8px; line-height: 1.08; }
.dsa-feature p { color: rgba(255, 255, 255, .72); font-size: 16px; max-width: 500px; margin: 0 0 26px; line-height: 1.55; }
.dsa-feature-app {
    display: flex; align-items: center; gap: 14px; width: fit-content; max-width: 100%;
    background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    border-radius: 18px; padding: 10px 12px;
}
.dsa-feature-app img { width: 54px; height: 54px; border-radius: 14px; object-fit: cover; flex: none; background: rgba(255, 255, 255, .15); }
.dsa-feature-app .dsa-fa-main { min-width: 0; }
.dsa-feature-app .dsa-fa-name { font-weight: 800; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dsa-feature-app .dsa-fa-sub { font-size: 11.5px; color: rgba(255, 255, 255, .65); }
.dsa-view-pill {
    flex: none; margin-left: 8px; background: #fff; color: #4338ca;
    font-weight: 800; font-size: 13px; border-radius: 999px; padding: 10px 20px;
}

/* Grid + item rows */
.dsa-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.dsa-item {
    display: flex; align-items: center; gap: 14px; height: 100%;
    padding: 14px 16px; border-radius: 20px; text-decoration: none;
    background: rgba(255, 255, 255, .72);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    backdrop-filter: blur(16px) saturate(1.5);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 12px 26px -16px rgba(76, 64, 180, .25);
    transition: transform .25s ease, box-shadow .25s ease;
}
html[data-theme="dark"] .dsa-item {
    background: linear-gradient(150deg, rgba(23, 30, 48, .88), rgba(15, 20, 34, .84));
    border-color: rgba(255, 255, 255, .14);
}
.dsa-item:hover { transform: translateY(-3px); box-shadow: 0 20px 36px -16px rgba(76, 64, 180, .35); }
.dsa-item img {
    width: 64px; height: 64px; border-radius: 16px; object-fit: cover; flex: none;
    background: #eef0f6; border: 1px solid var(--ds-line);
}
.dsa-item-main { flex: 1; min-width: 0; }
.dsa-item-main h6 {
    font-size: 16.5px; font-weight: 800; color: var(--ink); margin: 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dsa-item-main p {
    color: var(--muted); font-size: 12.5px; margin: 3px 0 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dsa-get {
    flex: none; font-size: 12.5px; font-weight: 800; color: #4338ca;
    background: #e6e2ff; border-radius: 999px; padding: 9px 17px;
}
html[data-theme="dark"] .dsa-get { background: rgba(99, 102, 241, .22); color: #c7d2fe; }

.dsa-empty { text-align: center; padding: 56px 20px; color: var(--muted); font-weight: 700; font-size: 17px; }

/* Pagination (bootstrap-4 view, DS skin) */
.dsa-pagination { margin-top: 36px; display: flex; justify-content: center; }
.dsa-pagination .pagination { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; }
.dsa-pagination .page-link {
    min-width: 44px; min-height: 44px; padding: 10px 14px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; border: 1px solid var(--ds-line);
    background: rgba(255, 255, 255, .65); color: var(--ink);
    font-weight: 700; font-size: 14px; text-decoration: none;
}
html[data-theme="dark"] .dsa-pagination .page-link { background: rgba(255, 255, 255, .06); }
.dsa-pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #6366f1, #4338ca); color: #fff; border-color: transparent;
}
.dsa-pagination .page-item.disabled .page-link { opacity: .45; pointer-events: none; }

/* ---------- Show page ---------- */
.dsa-back {
    display: inline-flex; align-items: center; gap: 8px;
    min-height: 44px; padding: 10px 18px; border-radius: 999px;
    background: rgba(255, 255, 255, .65); border: 1px solid var(--ds-line);
    color: var(--ink); font-weight: 700; font-size: 13.5px; text-decoration: none;
}
html[data-theme="dark"] .dsa-back { background: rgba(255, 255, 255, .06); }
.dsa-back:hover { border-color: rgba(79, 70, 229, .45); color: #4338ca; }
.dsa-backrow { margin-bottom: 24px; }

.dsa-head { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 40px; }
.dsa-icon-xl {
    width: 120px; height: 120px; border-radius: 26px; object-fit: cover; flex: none;
    background: #fff; border: 1px solid var(--ds-line);
    box-shadow: 0 16px 32px -16px rgba(20, 24, 60, .3);
}
.dsa-title { font-size: clamp(26px, 4vw, 38px); font-weight: 800; letter-spacing: -.02em; color: var(--ink); margin: 4px 0 6px; line-height: 1.12; }
.dsa-cat { color: var(--muted); font-size: 13.5px; font-weight: 600; margin: 0 0 18px; }
.dsa-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.dsa-actions .btn { min-height: 48px; text-decoration: none; }
.dsa-share {
    width: 48px; height: 48px; border-radius: 50%; flex: none;
    display: grid; place-items: center; cursor: pointer;
    background: rgba(255, 255, 255, .65); border: 1px solid var(--ds-line); color: #4338ca;
    transition: border-color .15s ease;
}
html[data-theme="dark"] .dsa-share { background: rgba(255, 255, 255, .06); color: #a5b4fc; }
.dsa-share:hover { border-color: rgba(79, 70, 229, .5); }
.dsa-copied { display: none; margin-top: 12px; color: #067647; font-weight: 700; font-size: 13px; }
.dsa-copied.show { display: block; animation: dsaUp .3s ease both; }
@keyframes dsaUp { from { transform: translateY(6px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .dsa-copied.show { animation: none; } .dsa-item:hover, .dsa-feature:hover { transform: none; } }

.dsa-sec-h { font-size: 19px; font-weight: 800; color: var(--ink); margin: 0 0 14px; }
.dsa-gallery { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 12px; scrollbar-width: none; }
.dsa-gallery::-webkit-scrollbar { display: none; }
.dsa-g-item {
    flex: 0 0 210px; min-height: 240px; text-align: center;
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px;
    padding: 26px 20px; border-radius: 20px;
    background: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    backdrop-filter: blur(16px) saturate(1.5);
    box-shadow: 0 12px 26px -16px rgba(76, 64, 180, .25);
}
html[data-theme="dark"] .dsa-g-item {
    background: linear-gradient(150deg, rgba(23, 30, 48, .88), rgba(15, 20, 34, .84));
    border-color: rgba(255, 255, 255, .14);
}
.dsa-g-tile {
    width: 62px; height: 62px; border-radius: 18px; margin-bottom: 8px;
    display: grid; place-items: center; font-size: 25px; color: #4338ca; background: #e6e2ff;
}
html[data-theme="dark"] .dsa-g-tile { background: rgba(99, 102, 241, .22); color: #c7d2fe; }
.dsa-g-item h6 { font-size: 15.5px; font-weight: 800; color: var(--ink); margin: 0; }
.dsa-g-item p { font-size: 12.5px; color: var(--muted); margin: 0; line-height: 1.55; }

/* Ad containers (ad code inside is untouched) */
.dsa-adbox {
    margin: 34px 0; padding: 14px; text-align: center; overflow: hidden;
    border-radius: 20px; border: 1px solid var(--ds-line);
    background: rgba(255, 255, 255, .45);
}
html[data-theme="dark"] .dsa-adbox { background: rgba(23, 30, 48, .45); }
.dsa-adbox-flush { margin-top: 0; }
.dsa-adlabel {
    font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); font-weight: 800; margin-bottom: 8px;
}

/* Article body */
.dsa-prose { font-size: 1.05rem; line-height: 1.75; color: #3c4358; }
html[data-theme="dark"] .dsa-prose { color: #c3cad9; }
.dsa-prose h2 { font-size: 1.5rem; font-weight: 800; color: var(--ink); margin: 2rem 0 1rem; letter-spacing: -.01em; }
.dsa-prose h3 { font-size: 1.25rem; font-weight: 800; color: var(--ink); margin: 1.7rem 0 .8rem; }
.dsa-prose p { margin: 0 0 1.2rem; }
.dsa-prose ul, .dsa-prose ol { padding-left: 22px; margin: 0 0 1.4rem; }
.dsa-prose li { margin-bottom: .45rem; }
.dsa-prose a { color: #4f46e5; font-weight: 600; }
html[data-theme="dark"] .dsa-prose a { color: #a5b4fc; }
.dsa-prose img { max-width: 100%; height: auto; border-radius: 18px; }
.dsa-prose table { display: block; width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.4em 0; }
.dsa-prose pre { overflow-x: auto; background: #0b0f19; color: #e6ebf5; border-radius: 16px; padding: 1.1rem 1.2rem; }

/* Sidebar */
.dsa-side { position: sticky; top: 96px; }
.dsa-side-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dsa-side-h h5 { font-size: 17px; font-weight: 800; color: var(--ink); margin: 0; }
.dsa-side-h a { color: #4f46e5; font-weight: 700; font-size: 13px; text-decoration: none; }
.dsa-side-item {
    display: flex; align-items: center; gap: 12px; padding: 10px;
    border-radius: 16px; text-decoration: none; margin-bottom: 10px;
    background: rgba(255, 255, 255, .72); border: 1px solid rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    backdrop-filter: blur(16px) saturate(1.5);
    transition: transform .2s ease;
}
html[data-theme="dark"] .dsa-side-item {
    background: linear-gradient(150deg, rgba(23, 30, 48, .88), rgba(15, 20, 34, .84));
    border-color: rgba(255, 255, 255, .14);
}
.dsa-side-item:hover { transform: translateY(-2px); }
.dsa-side-item img { width: 52px; height: 52px; border-radius: 13px; object-fit: cover; flex: none; background: #eef0f6; }
.dsa-side-item .dsa-item-main h6 { font-size: 14px; }
.dsa-side-item .dsa-get { padding: 7px 14px; font-size: 11.5px; }

@media (max-width: 991px) { .dsa-side { position: static; } }
@media (max-width: 768px) {
    .dsa-icon-xl { width: 88px; height: 88px; border-radius: 20px; }
    .dsa-g-item { flex-basis: 180px; min-height: 210px; }
    .dsa-wrap { padding: 34px 16px 60px; }
    .dsa-feature h2 { margin-top: 38px; }
}
