/* ===================================
   monsharesite — App Store Style
   =================================== */

:root {
    --bg:        #0f0f11;
    --bg2:       #18181c;
    --bg3:       #1f1f25;
    --border:    rgba(255,255,255,0.07);
    --border-hover: rgba(255,255,255,0.14);
    --text:      #f0f0f2;
    --text-muted: #888896;
    --text-dim:  #ffffff;
    --accent:    #7c6af7;
    --accent2:   #a78bfa;
    --accent-glow: rgba(124, 106, 247, 0.25);
    --tag-bg:    rgba(124, 106, 247, 0.12);
    --tag-text:  #a78bfa;
    --radius-card: 14px;
    --radius-tag:  6px;
    --thumb-h:   160px;
    --font-head: 'Syne', sans-serif;
    --font-body: 'DM Sans', sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

/* ===== HEADER ===== */
.site-header {
    background: linear-gradient(180deg, #16131f 0%, var(--bg) 100%);
    border-bottom: 1px solid var(--border);
    padding: 48px 24px 36px;
    text-align: center;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    font-size: 28px;
    color: var(--accent2);
    line-height: 1;
}

.brand-name {
    font-family: var(--font-head);
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: #fff;
}

.brand-tagline {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    background: var(--bg3);
    border: 1px solid var(--border);
    padding: 2px 10px;
    border-radius: 20px;
    letter-spacing: 0.02em;
}

.header-desc {
    max-width: 560px;
    margin: 16px auto 0;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* ===== FILTER NAV ===== */
.filter-nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(15, 15, 17, 0.88);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
}

.filter-inner {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    gap: 4px;
    overflow-x: auto;
    padding: 12px 0;
    scrollbar-width: none;
}
.filter-inner::-webkit-scrollbar { display: none; }

.filter-btn {
    flex-shrink: 0;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-muted);
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 16px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--text);
    background: var(--bg3);
    border-color: var(--border);
}

.filter-btn.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    font-weight: 600;
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ===== MAIN ===== */
.main-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

.section-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 20px;
}

.section-title {
    font-family: var(--font-head);
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}

.section-count {
    font-size: 13px;
    color: var(--text-dim);
}

/* ===== CARD GRID ===== */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

/* ===== APP CARD ===== */
.app-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    opacity: 0;
    transform: translateY(16px);
}

.app-card.visible {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.34, 1.2, 0.64, 1),
                border-color 0.25s ease, box-shadow 0.25s ease;
}

.app-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 8px 28px rgba(0,0,0,0.4), 0 0 0 1px rgba(124,106,247,0.15);
    transform: translateY(-3px);
}

.card-link {
    display: flex;
    align-items: center;
    gap: 0;
    text-decoration: none;
    color: inherit;
    flex-direction: column;
}

/* Thumbnail */
.card-thumb {
    width: 100%;
    height: var(--thumb-h);
    overflow: hidden;
    position: relative;
    background: var(--bg3);
    flex-shrink: 0;
}

.card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
    filter: brightness(0.9);
}

.app-card:hover .card-img {
    transform: scale(1.04);
    filter: brightness(1);
}

/* Drive badge */
.card-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    letter-spacing: 0.02em;
}

/* Card body */
.card-body {
    padding: 14px 16px 10px;
    width: 100%;
    flex: 1;
}

.card-meta-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.card-tag {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--tag-text);
    background: var(--tag-bg);
    padding: 2px 8px;
    border-radius: var(--radius-tag);
}

.card-date {
    font-size: 11px;
    color: var(--text-dim);
    font-variant-numeric: tabular-nums;
}

.card-title {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.35;
    margin-bottom: 5px;
    letter-spacing: -0.1px;
}

.card-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Arrow */
.card-arrow {
    width: 100%;
    padding: 8px 16px 12px;
    font-size: 13px;
    color: var(--text-dim);
    text-align: right;
    transition: color 0.2s, transform 0.2s;
}

.app-card:hover .card-arrow {
    color: var(--accent2);
    transform: translateX(2px);
}

/* Hidden card */
.app-card.hidden {
    display: none;
}

/* ===== FOOTER ===== */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 32px 24px;
    text-align: center;
}

.footer-inner {
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.brand-name-sm {
    font-family: var(--font-head);
    font-size: 15px;
    font-weight: 700;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.site-footer p {
    font-size: 13px;
    color: var(--text-dim);
}

.footer-sub {
    font-size: 12px !important;
    color: var(--text-dim);
    opacity: 0.6;
}

/* ===== LOADING / ERROR STATE ===== */
.load-status,
.load-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 14px;
}

.load-error p:first-child {
    color: var(--text);
    font-weight: 600;
    margin-bottom: 6px;
}

.load-error-detail {
    font-size: 12px;
    color: var(--text-dim);
    font-family: monospace;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
    .header-inner { flex-direction: column; gap: 6px; }
    .brand-name { font-size: 24px; }
    .card-grid { grid-template-columns: 1fr; }
    :root { --thumb-h: 140px; }
}

@media (min-width: 1024px) {
    .card-grid { grid-template-columns: repeat(3, 1fr); }
}
