/* =======================================================
   AppZone Directory — style.css
   Mobile-first stylesheet
   ======================================================= */

:root {
    --navy: #1a233a;
    --navy-light: #232f4d;
    --white: #ffffff;
    --card-bg: #f8f9fa;
    --gold: #ffc107;
    --green: #28a745;
    --text-dark: #1f1f1f;
    --text-muted: #6c757d;
    --border-light: #e9ecef;
    --radius: 14px;
    --shadow: 0 2px 10px rgba(26, 35, 58, 0.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--white);
    color: var(--text-dark);
    -webkit-font-smoothing: antialiased;
    padding-bottom: 40px;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; margin: 0; padding: 0; }
img { max-width: 100%; display: block; }

/* ---------------- HEADER ---------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.header-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--white);
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo i { color: var(--gold); }

.back-btn {
    color: var(--white);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
}

.hamburger-btn {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.4rem;
    cursor: pointer;
    padding: 4px 8px;
}

/* ---------------- SIDEBAR ---------------- */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 199;
}

.sidebar-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.sidebar {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: 78%;
    max-width: 300px;
    background: var(--navy);
    color: var(--white);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 200;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 20px rgba(0,0,0,0.25);
}

.sidebar.active {
    transform: translateX(0);
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    font-weight: 700;
    font-size: 1.05rem;
}

.sidebar-close {
    background: transparent;
    border: none;
    color: var(--white);
    font-size: 1.2rem;
    cursor: pointer;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: rgba(255,255,255,0.9);
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-nav a i { width: 18px; color: var(--gold); }

.sidebar-nav .telegram-link {
    margin-top: 8px;
    color: #29a9eb;
    font-weight: 600;
}

.sidebar-nav .telegram-link i { color: #29a9eb; }

/* ---------------- MAIN CONTAINER ---------------- */
.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 16px;
}

/* ---------------- INTRO SECTION ---------------- */
.intro-section {
    padding: 4px 4px 16px;
}

.intro-section h1 {
    font-size: 1.25rem;
    margin: 0 0 8px;
    color: var(--navy);
}

.intro-section p {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin: 0 0 14px;
}

.telegram-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: #29a9eb;
    color: var(--white);
    font-weight: 700;
    font-size: 1rem;
    padding: 13px 16px;
    border-radius: var(--radius);
    box-shadow: 0 4px 14px rgba(41,169,235,0.35);
}

.telegram-btn i { font-size: 1.2rem; }

/* ---------------- TABS ---------------- */
.tabs {
    position: sticky;
    top: 62px;
    z-index: 90;
    display: flex;
    background: var(--white);
    border-bottom: 2px solid var(--border-light);
    margin: 0 -16px 12px;
    padding: 0 16px;
}

.tab-btn {
    flex: 1;
    text-align: center;
    padding: 12px 8px;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.3px;
    color: var(--text-muted);
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
}

.tab-btn.active {
    color: var(--navy);
    border-bottom-color: var(--gold);
}

/* ---------------- APP LIST / CARDS ---------------- */
.app-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.app-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px;
    box-shadow: var(--shadow);
    position: relative;
}

.app-icon-wrap {
    position: relative;
    flex-shrink: 0;
}

.app-icon {
    width: 58px;
    height: 58px;
    border-radius: 16px;
    object-fit: cover;
    background: var(--white);
    border: 1px solid var(--border-light);
}

.rank-badge {
    position: absolute;
    top: -8px;
    left: -8px;
    background: var(--navy);
    color: var(--gold);
    font-size: 0.7rem;
    font-weight: 800;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--white);
}

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

.app-name {
    margin: 0 0 4px;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--text-dark);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-detail {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 2px;
}

.app-detail i { color: var(--gold); font-size: 0.78rem; }
.app-detail.green i { color: var(--green); }
.app-detail.green span { color: var(--green); font-weight: 600; }

.download-btn {
    flex-shrink: 0;
    background: var(--navy);
    color: var(--white);
    font-size: 0.78rem;
    font-weight: 700;
    padding: 9px 14px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
}

/* ---------------- FOOTER ---------------- */
.site-footer {
    background: var(--navy);
    color: rgba(255,255,255,0.85);
    margin-top: 30px;
    padding: 28px 16px 20px;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-bottom: 16px;
    font-size: 0.82rem;
}

.footer-links a { color: rgba(255,255,255,0.85); }
.footer-links a:hover { color: var(--gold); }

.footer-disclaimer {
    font-size: 0.72rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.6);
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 14px;
    margin-bottom: 14px;
}

.footer-copy {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.5);
    text-align: center;
}

/* =======================================================
   PREVIEW PAGE
   ======================================================= */
.preview-top {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 6px 4px 18px;
}

.preview-icon {
    width: 84px;
    height: 84px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow);
    flex-shrink: 0;
}

.preview-title h1 {
    font-size: 1.15rem;
    margin: 0 0 2px;
    color: var(--text-dark);
}

.preview-title .subtitle {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin: 0 0 6px;
}

.trusted-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--green);
}

.stats-row {
    display: flex;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px 8px;
    margin-bottom: 14px;
}

.stat-col {
    flex: 1;
    text-align: center;
    border-right: 1px solid var(--border-light);
}

.stat-col:last-child { border-right: none; }

.stat-col .stat-value {
    display: block;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--navy);
}

.stat-col .stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.rating-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 4px 18px;
}

.rating-stars {
    color: var(--gold);
    font-size: 1rem;
}

.rating-value {
    font-weight: 700;
    color: var(--text-dark);
    margin-left: 8px;
    font-size: 0.9rem;
}

.review-count {
    color: var(--text-muted);
    font-size: 0.82rem;
    margin-left: 4px;
}

.age-badge {
    background: var(--navy);
    color: var(--white);
    font-weight: 800;
    font-size: 0.8rem;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-download-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    background: var(--green);
    color: var(--white);
    font-weight: 800;
    font-size: 1.05rem;
    letter-spacing: 0.5px;
    padding: 16px;
    border-radius: var(--radius);
    box-shadow: 0 6px 16px rgba(40,167,69,0.35);
    margin-bottom: 20px;
    border: none;
    cursor: pointer;
}

.main-download-btn i { font-size: 1.2rem; }

.features-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 22px;
}

.feature-box {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow);
}

.feature-box i {
    font-size: 1.3rem;
    color: var(--gold);
    margin-bottom: 8px;
}

.feature-box.safety i,
.feature-box.speed i {
    color: var(--green);
}

.feature-box .feature-value {
    display: block;
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--navy);
}

.feature-box .feature-label {
    font-size: 0.72rem;
    color: var(--text-muted);
}

.preview-description {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.preview-description h2 {
    font-size: 0.95rem;
    color: var(--navy);
    margin: 0 0 8px;
}

/* ---------------- RESPONSIVE (tablet/desktop preview) ---------------- */
@media (min-width: 700px) {
    .container, .header-inner, .footer-inner {
        max-width: 600px;
    }
}

/* =======================================================
   AZ INTRO BOX  (index.php)
   ======================================================= */
.az-intro-box {
    background: #ffffff;
    padding: 12px 14px;
}

.az-intro-title {
    margin: 0 0 8px;
    color: #1a233a;
    font-size: 19px;
    font-weight: 700;
}

.az-intro-text {
    margin: 0 0 14px;
    color: #718096;
    font-size: 13px;
    line-height: 1.5;
}

.az-tg-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    background: #0088cc;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    padding: 10px;
    border-radius: 20px;
    text-decoration: none;
}

.az-tg-btn i {
    font-size: 16px;
}

/* =======================================================
   MORE YONO GAMES / OTHER APPS  (preview.php)
   ======================================================= */
.other-apps-section {
    margin-top: 22px;
}

.other-apps-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a233a;
    margin: 0 0 12px;
}

.other-apps-list {
    display: flex;
    flex-direction: column;
}

/* The card itself: forced horizontal row, icon | text | button */
.related-app-card {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 12px;
    background: #f8f9fa;
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
    text-decoration: none;
}

/* LEFT: icon + rank badge, fixed width so it never grows or shrinks */
.related-app-card-left {
    position: relative;
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
}

.related-app-card-icon {
    display: block;
    width: 60px;
    height: 60px;
    max-width: 60px;
    max-height: 60px;
    border-radius: 14px;
    object-fit: cover;
    background: #ffffff;
    border: 1px solid #e9ecef;
}

.related-app-card-rank {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #1a233a;
    color: #ffc107;
    font-size: 11px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    z-index: 2;
}

/* MIDDLE: name + bonus rows, grows to fill remaining space */
.related-app-card-middle {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
}

.related-app-card-name {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.related-app-card-detail {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #718096;
    margin-bottom: 2px;
}

.related-app-card-detail i { color: #ffc107; font-size: 11px; }
.related-app-card-detail.related-app-card-green i { color: #28a745; }
.related-app-card-detail.related-app-card-green span { color: #28a745; font-weight: 600; }

/* RIGHT: download button, fixed to the far right */
.related-app-card-right {
    flex-shrink: 0;
}

.related-app-card-download {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #1a233a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 10px;
    white-space: nowrap;
}

/* small screens: tighten spacing further */
@media (max-width: 360px) {
    .related-app-card { padding: 8px 10px; gap: 10px; }
    .related-app-card-left, .related-app-card-icon { width: 48px; height: 48px; flex-basis: 48px; }
    .related-app-card-download { padding: 7px 10px; font-size: 12px; }
}

/* =======================================================
   HORIZONTAL APP CARD (new markup used in preview.php)
   ======================================================= */
.horizontal-app-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: #f8f9fa;
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 12px;
    text-decoration: none;
}

.card-left {
    position: relative;
    flex: 0 0 60px;
    width: 60px;
    height: 60px;
}

.card-icon {
    display: block;
    width: 60px;
    height: 60px;
    border-radius: 14px;
    object-fit: cover;
    background: #ffffff;
    border: 1px solid #e9ecef;
}

.card-rank {
    position: absolute;
    top: -6px;
    left: -6px;
    background: #1a233a;
    color: #ffc107;
    font-size: 11px;
    font-weight: 800;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #ffffff;
    z-index: 2;
}

.card-middle {
    flex-grow: 1;
    flex-shrink: 1;
    min-width: 0;
}

.card-name {
    margin: 0 0 4px;
    font-size: 14px;
    font-weight: 700;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-detail {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #718096;
    margin-bottom: 2px;
}

.card-detail i { color: #ffc107; font-size: 11px; }
.card-detail.card-detail-green i { color: #28a745; }
.card-detail.card-detail-green span { color: #28a745; font-weight: 600; }

.card-right {
    flex-shrink: 0;
}

.card-download {
    display: flex;
    align-items: center;
    gap: 5px;
    background: #1a233a;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    padding: 8px 14px;
    border-radius: 10px;
    white-space: nowrap;
}

@media (max-width: 360px) {
    .horizontal-app-card { padding: 8px 10px; gap: 10px; }
    .card-left, .card-icon { width: 48px; height: 48px; flex-basis: 48px; }
    .card-download { padding: 7px 10px; font-size: 12px; }
}
