/* ============================================
   Apps Manager — Frontend Styles
   ============================================ */

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

body.apm-site {
    font-family: 'Inter', sans-serif;
    background: #f5f7fa;
    color: #1a1a1a;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: #000; }
img { max-width: 100%; }

.apm-container {
    max-width: 680px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ── HEADER ─────────────────────────────────── */
.apm-header {
    background: linear-gradient(315deg, #ff9a00 0.000%, #ff6600 20.000%, #e83000 40.000%, #ae0800 60.000%, #590000 80.000%, #000b00 100.000%);
    padding: 14px 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
}
.apm-header-inner {
    max-width: 680px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.apm-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
}
.apm-logo-img {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    object-fit: cover;
    border: 2px solid rgba(255,255,255,0.3);
}
.apm-site-name {
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
}
.apm-hamburger {
    background: rgba(255,255,255,0.15);
    border: none;
    border-radius: 8px;
    padding: 8px 10px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.apm-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: 0.2s;
}

/* ── DRAWER ─────────────────────────────────── */
.apm-drawer {
    position: fixed;
    top: 0; right: -280px;
    width: 270px;
    height: 100%;
    background: #fff;
    z-index: 9999;
    transition: right 0.3s cubic-bezier(0.4,0,0.2,1);
    box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    padding: 20px;
}
.apm-drawer.open { right: 0; }
.apm-drawer-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    float: right;
    color: #000;
    padding: 4px 8px;
}
.apm-drawer-nav {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.apm-drawer-nav a {
    display: block;
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    color: #000;
    transition: background 0.15s;
}
.apm-drawer-nav a:hover { background: #f0f7ff; color: #39c15b; }

.apm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 9998;
    backdrop-filter: blur(2px);
}
.apm-overlay.open { display: block; }

/* ── NAV BAR ─────────────────────────────────── */
.apm-navbar {
    background: #fff;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: center;
    gap: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.apm-navbar::-webkit-scrollbar { display: none; }
.apm-navbar a {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: row;
    gap: 5px;
    padding: 5px 8px;
    font-size: 11px;
    font-weight: 600;
    color: #000;
    white-space: nowrap;
    transition: color 0.15s;
    border-bottom: 2px solid transparent;
}
.apm-navbar a span { font-size: 16px; }
.apm-navbar a:hover { color: #39c15b; border-bottom-color: #39c15b; }

/* ── HOMEPAGE SPECIFIC ───────────────────────── */
.apm-hero-desc {
    background: #fff;
    padding: 12px 0px 0px 0px;
    border-bottom: 1px solid #eee;
    color: #666;
    text-align: center;
    max-width: 680px;
    margin: 0;
    font-size: 13px;
}
.apm-hero-desc p {
    text-align: justify;
    padding: 5px;
}
.apm-tabs {
    display: flex;
    gap: 10px;
    padding: 16px 0 8px;
}
.apm-tab-btn {
    flex: 1;
    padding: 11px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid #ddd;
    background: #fff;
    color: #666;
    transition: all 0.2s;
}

.apm-tab-content { display: none; }
.apm-tab-content.active { display: block; }

/* ── APP CARDS ───────────────────────────────── */
#apm-tab-all {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 5px;
    margin-top: 10px;
}
.apm-card {
    background: #fff;
    border-radius: 18px;
    padding: 7px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    position: relative;
    border: 1px solid #e9ecef;
    box-shadow:
        0 1px 2px rgba(0,0,0,0.04),
        0 6px 18px rgba(0,0,0,0.06);
    opacity: 0;
    animation: apmFadeIn 0.4s ease forwards;
    transition: box-shadow 0.2s ease;
}
.apm-card:hover {
    transform: translateY(-2px);
}
.apm-card-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;
}
@keyframes apmFadeIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.apm-card-num {
    position: absolute;
    left: 0px;
    top: 15px;
    transform: translateY(-50%);
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: linear-gradient(315deg, #ff9a00 0.000%, #ff6600 20.000%, #e83000 40.000%, #ae0800 60.000%, #590000 80.000%, #000b00 100.000%);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: none;
    align-items: center;
    justify-content: center;
}

.apm-card-logo {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid #eee;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.apm-card-info {
    flex: 1;
    min-width: 0;
}

.apm-card-name {
    font-size: 16px;
    font-weight: 700;
    color: #111;
    margin-bottom: 5px;
    white-space: wrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.apm-card-meta {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 6px;
}

.apm-bonus {
    background: #fff0f3;
    color: #e0184e;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid #ffe0e9;
}

.apm-withdraw {
    background: #f0fff4;
    color: #00875a;
    font-size: 9px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 20px;
    border: 1px solid #d1fae5;
}

.apm-dl-btn {
    background: linear-gradient(315deg, #ff9a00 0.000%, #ff6600 20.000%, #e83000 40.000%, #ae0800 60.000%, #590000 80.000%, #000b00 100.000%);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    width: 100%;
    padding: 9px 14px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 3px 10px rgba(0,149,242,0.3);
    transition: transform 0.15s, box-shadow 0.15s;
    text-align: center;
}
.apm-dl-btn:hover {
    transform: scale(1.04);
}
/* ── NOTICE BOX ──────────────────────────────── */
.apm-notice {
    background: #fff8f0;
    border: 2px dashed #e65c00;
    border-radius: 12px;
    padding: 14px 16px;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 13px;
    color: #7a3600;
    line-height: 1.6;
}
.apm-notice strong { color: #e65c00; font-size: 16px; }

/* ── APP DETAIL PAGE ─────────────────────────── */
.apm-page-bar {
    background: linear-gradient(315deg, #ff9a00 0.000%, #ff6600 20.000%, #e83000 40.000%, #ae0800 60.000%, #590000 80.000%, #000b00 100.000%);
    padding: 12px 16px;
}
.apm-page-bar-title {
    max-width: 680px;
    margin: 0 auto;
    font-size: 14px;
    color: #fff;
    font-weight: 500;
    opacity: 0.9;
}

.apm-app-card-detail {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin: 16px 0;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.apm-app-header {
    display: flex;
    align-items: flex-start;
    gap: 60px;
    margin-bottom: 18px;
}

.apm-app-logo-lg {
    width: 110px;
    height: 110px;
    border-radius: 22px;
    object-fit: cover;
    flex-shrink: 0;
    border: 2px solid #eee;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
}

.apm-app-title {
    font-size: 22px;
    font-weight: 800;
    color: #0d1117;
    margin-bottom: 6px;
    line-height: 1.2;
}

.apm-apk-link {
    color: #00a0a0;
    font-size: 13px;
    font-weight: 500;
    text-decoration: underline;
}

.apm-stats-row {
    display: flex;
    align-items: center;
    background: #f8f9fc;
    border-radius: 12px;
    padding: 12px 6px;
    margin-bottom: 16px;
    gap: 0;
}

.apm-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.apm-stat-icon { font-size: 18px; }
.apm-stat-val { font-size: 14px; font-weight: 700; color: #111; }
.apm-stat-lbl { font-size: 10px; color: #888; font-weight: 500; }

.apm-stat-divider {
    width: 1px;
    height: 36px;
    background: #e0e0e0;
}

.apm-dl-btn-full {
    display: block;
    width: 100%;
    background: linear-gradient(315deg, #ff9a00 0.000%, #ff6600 20.000%, #e83000 40.000%, #ae0800 60.000%, #590000 80.000%, #000b00 100.000%);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    border-radius: 50px;
    padding: 15px;
    margin-bottom: 10px;
    box-shadow: 0 5px 18px rgba(0,149,242,0.35);
    transition: transform 0.15s, box-shadow 0.15s;
    letter-spacing: 0.3px;
}
.apm-dl-btn-full:hover {
    transform: translateY(-2px);
}

.apm-tg-btn-full {
    display: block;
    width: 100%;
    padding: 13px;
    background: #fff;
    color: #0088cc;
    font-size: 15px;
    font-weight: 600;
    text-align: center;
    border-radius: 50px;
    border: 2px solid #0088cc;
    transition: all 0.15s;
}
.apm-tg-btn-full:hover {
    background: #e8f4fd;
}

/* ── ARTICLE ─────────────────────────────────── */
.apm-article-img-wrap {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
}
.apm-article-img { width: 100%; display: block; }

.apm-article-body {
    background: #fff;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
    font-size: 14px;
    line-height: 1.8;
    color: #333;
}
.apm-article-body h2, .apm-article-body h3 { margin: 16px 0 8px; color: #0d1117; }
.apm-article-body p { margin-bottom: 12px; }
.apm-article-body ul, .apm-article-body ol { padding-left: 20px; margin-bottom: 12px; }

.apm-blog-code { margin-bottom: 16px; margin-left: 16px; margin-right: 16px; }

/* ── RELATED APPS ─────────────────────────────── */
.apm-related { margin-top: 8px; }
.apm-related-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    color: #000;
}

/* ── HERO BAR (about/disclaimer) ─────────────── */
.apm-hero-bar {
    background: linear-gradient(315deg, #ff9a00 0.000%, #ff6600 20.000%, #e83000 40.000%, #ae0800 60.000%, #590000 80.000%, #000b00 100.000%);
    padding: 32px 16px;
    text-align: center;
}
.apm-hero-bar h1 {
    color: #fff;
    font-size: 26px;
    font-weight: 800;
}

/* ── STATIC CONTENT ──────────────────────────── */
.apm-static-content {
    background: #fff;
    border-radius: 16px;
    padding: 24px 20px;
    margin: 16px auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.07);
    font-size: 14px;
    line-height: 1.8;
    color: #333;
}
.apm-static-content h1, .apm-static-content h2 { color: #0d1117; margin-bottom: 10px; }
.apm-static-content p { margin-bottom: 12px; }

/* ── CONTACT FORM ─────────────────────────────── */
.apm-contact-title { font-size: 22px; font-weight: 700; margin-bottom: 16px; }
.apm-contact-form-wrap { margin-top: 20px; }
.apm-contact-form { display: flex; flex-direction: column; gap: 14px; }
.apm-cf-field { display: flex; flex-direction: column; gap: 5px; }
.apm-cf-field label { font-weight: 600; font-size: 13px; }
.apm-cf-field input, .apm-cf-field textarea {
    border: 1.5px solid #ddd;
    border-radius: 10px;
    padding: 11px 14px;
    font-size: 14px;
    font-family: inherit;
    transition: border 0.2s;
}
.apm-cf-field input:focus, .apm-cf-field textarea:focus {
    border-color: #39c15b;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0,149,242,0.1);
}
.apm-cf-submit {
    background: linear-gradient(315deg, #ff9a00 0.000%, #ff6600 20.000%, #e83000 40.000%, #ae0800 60.000%, #590000 80.000%, #000b00 100.000%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s;
}
.apm-cf-submit:hover { transform: translateY(-2px); }
.apm-cf-success {
    background: #f0fff4;
    color: #00875a;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    padding: 12px 16px;
    margin-top: 12px;
    font-weight: 500;
}

/* ── FOOTER ──────────────────────────────────── */
.apm-footer { margin-top: 24px; }
.apm-footer-thanks {
    text-align: center;
    color: #00875a;
    font-size: 13px;
    padding: 12px 16px;
    background: #f0fff4;
    font-weight: 500;
}
.apm-footer-copy {
    background: linear-gradient(315deg, #ff9a00 0.000%, #ff6600 20.000%, #e83000 40.000%, #ae0800 60.000%, #590000 80.000%, #000b00 100.000%);
    color: rgba(255,255,255,0.85);
    text-align: center;
    padding: 14px 16px;
    font-size: 12px;
}