/* ============================================================
   CHEAT STORE — Sleek Neumorphism Components (High Contrast Cards)
   ============================================================ */

/* ── App Card (Grid/Scroll) ──────────────────────────────── */
.app-card {
    background: var(--bg-surface);
    border-radius: var(--r);
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-hover);
    padding: 10px;
    cursor: pointer;
    transition: var(--t-spring);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: var(--card-w);
    flex-shrink: 0;
}

.app-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--accent-glow) 0%, transparent 65%);
    opacity: 0;
    transition: opacity var(--t);
    pointer-events: none;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-raised-lg);
    border-color: var(--border-accent);
}
.app-card:hover::after { opacity: 1; }
.app-card:active {
    transform: translateY(0);
    box-shadow: var(--shadow-inset);
}

/* App card icon container */
.app-card-icon-wrap {
    position: relative;
    border-radius: var(--r-sm);
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-deep);
    box-shadow: var(--shadow-inset-sm);
}

.app-card-icon {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--t);
}
.app-card:hover .app-card-icon { transform: scale(1.06); }

/* Category badge */
.app-card-cat-badge {
    position: absolute;
    top: 5px; right: 5px;
    background: rgba(11, 13, 20, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 8.5px;
    font-weight: 700;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border: 1px solid var(--accent-glow);
}

/* Editor's choice star badge */
.editor-choice-badge {
    position: absolute;
    top: 5px; left: 5px;
    width: 20px; height: 20px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    box-shadow: 0 0 8px var(--accent-glow);
    display: flex; align-items: center; justify-content: center;
    font-size: 11px;
    color: var(--text-inverse);
}

.app-card-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.app-card-name {
    font-size: 12.5px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-card-dev {
    font-size: 10.5px;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: flex; align-items: center; gap: 3px;
}
.app-card-dev .material-symbols-outlined { font-size: 11px; color: var(--accent); }

.app-card-size {
    font-size: 10px;
    color: var(--text-muted);
}

.app-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 4px;
    margin-top: 2px;
}

/* ── Line-by-Line List Card (Editor's Choice Vertical Style) ── */
.app-list-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-surface);
    border-radius: var(--r);
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-hover);
    margin-bottom: 10px;
    cursor: pointer;
    transition: var(--t-spring);
}
.app-list-rank {
    font-size: 14px;
    font-weight: 800;
    color: var(--text-muted);
    min-width: 18px;
    text-align: center;
    flex-shrink: 0;
}
.app-list-item:nth-child(1) .app-list-rank { color: var(--amber); }
.app-list-item:nth-child(2) .app-list-rank { color: var(--accent); }
.app-list-item:nth-child(3) .app-list-rank { color: var(--teal); }
.app-list-item:hover {
    transform: translateX(4px);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-raised-lg);
}
.app-list-item:active {
    transform: translateX(0);
    box-shadow: var(--shadow-inset);
}

.app-list-icon {
    width: 48px; height: 48px;
    border-radius: var(--r-sm);
    object-fit: cover;
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.app-list-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.app-list-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-list-meta {
    font-size: 11px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ── Horizontal Scroll Row ───────────────────────────────── */
.h-scroll-row {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: visible;
    padding: 4px 2px 10px 2px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.h-scroll-row::-webkit-scrollbar { display: none; }
.h-scroll-row .app-card { scroll-snap-align: start; }

/* ── Apps Grid (2-column compact grid on mobile) ────────── */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.apps-grid .app-card { width: auto; }

@media (min-width: 480px) {
    .apps-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
}
@media (min-width: 768px) {
    .apps-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
}

/* ── Badges & Chips ──────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 7px;
    border-radius: var(--r-full);
    font-size: 10px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: var(--shadow-raised);
}

.badge-accent {
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--border-accent);
}
.badge-muted {
    background: var(--bg-raised);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.dl-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    padding: 2px 7px;
    background: var(--accent-bg);
    color: var(--accent);
    border: 1px solid var(--border-accent);
    border-radius: var(--r-full);
    font-size: 10px;
    font-weight: 700;
    box-shadow: var(--shadow-raised);
}

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--sp-sm);
    padding: 10px 20px;
    border-radius: var(--r);
    font-size: var(--fs-sm);
    font-weight: 700;
    cursor: pointer;
    transition: var(--t-spring);
    border: none;
    outline: none;
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

.btn-primary, .btn-teal {
    background: linear-gradient(135deg, var(--accent), var(--accent-dark));
    color: var(--text-inverse);
    box-shadow: var(--shadow-raised), 0 0 16px var(--accent-glow);
    border: 1px solid rgba(0, 230, 118, 0.4);
}
.btn-primary:hover, .btn-teal:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-raised-lg), 0 0 24px var(--accent-glow);
}
.btn-primary:active, .btn-teal:active {
    transform: translateY(0);
    box-shadow: var(--shadow-inset);
}

.btn-ghost {
    background: var(--bg-raised);
    color: var(--text-secondary);
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-hover);
}
.btn-ghost:hover {
    color: var(--accent);
    border-color: var(--border-accent);
    box-shadow: var(--shadow-raised-lg);
}
.btn-ghost:active { box-shadow: var(--shadow-inset); }

.btn-sm { padding: 6px 12px; font-size: 11.5px; border-radius: var(--r-sm); }
.btn-lg { padding: 12px 24px; font-size: var(--fs); border-radius: var(--r-lg); }
.btn-full { width: 100%; }

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none !important;
}

/* ── Premium Download Button ─────────────────────────────── */
.btn-download {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 28px;
    border-radius: var(--r-full);
    font-size: 15px;
    font-weight: 900;
    letter-spacing: 0.02em;
    color: #000;
    background: linear-gradient(130deg, #00e676 0%, #00c853 55%, #00e676 100%);
    background-size: 200% 100%;
    border: none;
    box-shadow:
        0 0 0 3px rgba(0,230,118,0.15),
        0 4px 24px rgba(0,230,118,0.35),
        -3px -3px 8px rgba(255,255,255,0.04),
         3px  3px 10px rgba(0,0,0,0.6);
    cursor: pointer;
    overflow: hidden;
    transition: var(--t-spring);
    animation: dlBtnPulse 2.4s ease-in-out infinite;
}

/* Shimmer sweep */
.btn-download::before {
    content: '';
    position: absolute;
    top: 0; left: -75%;
    width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.28), transparent);
    transform: skewX(-18deg);
    animation: dlShimmer 2.8s ease-in-out infinite;
    pointer-events: none;
}
@keyframes dlShimmer {
    0%   { left: -75%; opacity: 0; }
    30%  { opacity: 1; }
    100% { left: 130%; opacity: 0; }
}
@keyframes dlBtnPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(0,230,118,0.15), 0 4px 24px rgba(0,230,118,0.35), -3px -3px 8px rgba(255,255,255,0.04), 3px 3px 10px rgba(0,0,0,0.6); }
    50%       { box-shadow: 0 0 0 6px rgba(0,230,118,0.08), 0 6px 32px rgba(0,230,118,0.50), -3px -3px 8px rgba(255,255,255,0.04), 3px 3px 10px rgba(0,0,0,0.6); }
}

.btn-download .dl-icon-ring {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px; height: 32px;
    border-radius: 50%;
    background: rgba(0,0,0,0.18);
    flex-shrink: 0;
    transition: var(--t);
}
.btn-download .dl-icon-ring .material-symbols-outlined {
    font-size: 18px;
    color: #000;
}
.btn-download .dl-text-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1px;
}
.btn-download .dl-label {
    font-size: 14px;
    font-weight: 900;
    line-height: 1.2;
    color: #000;
}
.btn-download .dl-sub {
    font-size: 11px;
    font-weight: 600;
    opacity: 0.65;
    color: #000;
    line-height: 1;
}
.btn-download:hover {
    transform: translateY(-3px) scale(1.01);
    background-position: 100% 0;
}
.btn-download:active {
    transform: translateY(1px) scale(0.99);
    animation: none;
    box-shadow: 0 0 0 2px rgba(0,230,118,0.2), inset 0 2px 6px rgba(0,0,0,0.35);
}
.btn-download:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    animation: none;
    transform: none;
}

/* ── Form Inputs ─────────────────────────────────────────── */
.input-wrap {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-bottom: var(--sp);
}

.input-label {
    font-size: var(--fs-sm);
    font-weight: 600;
    color: var(--text-secondary);
}

.input-field {
    width: 100%;
    background: var(--bg-deep);
    box-shadow: var(--shadow-inset);
    border: 1px solid var(--border);
    border-radius: var(--r);
    padding: 10px 14px;
    color: var(--text-primary);
    font-size: var(--fs-sm);
    transition: var(--t);
    appearance: none;
}
.input-field::placeholder { color: var(--text-muted); }
.input-field:focus {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-inset), 0 0 0 2.5px var(--accent-glow);
    outline: none;
}

textarea.input-field {
    resize: vertical;
    min-height: 90px;
    line-height: 1.6;
}

/* Search input */
.search-input-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-deep);
    box-shadow: var(--shadow-inset);
    border: 1px solid var(--border);
    border-radius: var(--r-full);
    padding: 8px 14px;
    transition: var(--t);
}
.search-input-wrap:focus-within {
    border-color: var(--border-accent);
    box-shadow: var(--shadow-inset), 0 0 0 2.5px var(--accent-glow);
}
.search-input-wrap input {
    flex: 1; background: none; border: none;
    color: var(--text-primary); font-size: var(--fs-sm);
    outline: none; min-width: 0;
}
.search-input-wrap input::placeholder { color: var(--text-muted); }
.search-input-wrap .material-symbols-outlined { color: var(--text-muted); font-size: 18px; }

/* ── Modal / Overlay ─────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    z-index: 200;
    display: flex;
    align-items: flex-end;
    padding: var(--sp);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t), visibility var(--t);
}
.modal-overlay.active { opacity: 1; visibility: visible; }

@media (min-width: 600px) { .modal-overlay { align-items: center; } }

.modal-content {
    background: var(--bg-surface);
    border-radius: var(--r-xl) var(--r-xl) var(--r) var(--r);
    box-shadow: var(--shadow-raised-lg);
    border: 1px solid var(--border-hover);
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    transform: translateY(30px);
    transition: transform var(--t-slow);
}
.modal-overlay.active .modal-content { transform: translateY(0); }

@media (min-width: 600px) {
    .modal-content {
        border-radius: var(--r-xl);
        max-width: 460px;
        max-height: 80vh;
        transform: scale(0.96);
    }
    .modal-overlay.active .modal-content { transform: scale(1); }
}

/* ── Full-screen Pages ───────────────────────────────────── */
.full-page {
    position: fixed;
    inset: 0;
    background: var(--bg-base);
    z-index: 150;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform var(--t-slow) var(--ease-out);
    overflow: hidden;
}
.full-page.open { transform: translateX(0); }

.full-page-header {
    display: flex;
    align-items: center;
    gap: var(--sp-sm);
    padding: var(--sp-sm) var(--sp);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-hover);
    box-shadow: var(--shadow-raised);
    flex-shrink: 0;
    min-height: var(--header-h);
}

.full-page-title {
    flex: 1;
    font-size: var(--fs-md);
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.full-page-body {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: var(--sp-lg) var(--sp);
    -webkit-overflow-scrolling: touch;
}

/* Back button */
.back-btn {
    width: 36px; height: 36px;
    border-radius: var(--r-sm);
    background: var(--bg-raised);
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border-hover);
    display: flex; align-items: center; justify-content: center;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--t);
    flex-shrink: 0;
}
.back-btn:hover { color: var(--accent); border-color: var(--border-accent); }
.back-btn:active { box-shadow: var(--shadow-inset); }

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: calc(var(--header-h) + 8px);
    right: var(--sp);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--r);
    font-size: var(--fs-sm);
    font-weight: 600;
    box-shadow: var(--shadow-float);
    border: 1px solid var(--border);
    background: var(--bg-surface);
    backdrop-filter: blur(10px);
    pointer-events: all;
    transform: translateX(120%);
    transition: transform var(--t-spring);
    max-width: 300px;
}
.toast.show { transform: translateX(0); }
.toast-success { border-color: var(--border-accent); color: var(--accent); }
.toast-error   { border-color: var(--rose-glow); color: var(--rose); }
.toast-info    { border-color: var(--border-accent); color: var(--accent-light); }
.toast-warning { border-color: var(--amber-glow); color: var(--amber); }

/* Rating Stars */
.stars {
    display: inline-flex;
    gap: 2px;
    color: var(--amber);
    font-size: 15px;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.92);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--t), visibility var(--t);
    padding: var(--sp-lg);
}
.lightbox-overlay.active { opacity: 1; visibility: visible; }
.lightbox-overlay img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: var(--r);
    box-shadow: var(--shadow-raised-lg);
    object-fit: contain;
}
.lightbox-close {
    position: absolute;
    top: var(--sp); right: var(--sp);
    background: var(--bg-surface);
    box-shadow: var(--shadow-raised);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-primary);
    transition: var(--t);
}
.lightbox-close:hover { color: var(--rose); border-color: var(--rose-glow); }

/* Empty State */
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 50px var(--sp);
    text-align: center;
    color: var(--text-muted);
}
.empty-state .material-symbols-outlined {
    font-size: 48px;
    color: var(--border-hover);
    display: block;
}
.empty-state p { font-size: var(--fs-sm); }
