/*
 * Meetdownload v2 stylesheet (file page). Mockup: design/md-v2-mockup.
 * Mobile first: base styles are for phones; 900px switches to the two-column desktop layout.
 * No Bulma, no icon font: icons are an inline SVG sprite in the page.
 */

/* ---------- Tokens ---------- */
:root {
    /* Brand blue from the MD logo */
    --brand: #2187ee;
    --brand-soft: #5aa8f5;
    --brand-tint: rgba(33, 135, 238, .14);

    /* Download green: the one loud colour on the page */
    --go: #18c964;
    --go-hi: #34e07f;
    --go-deep: #0e9a4b;
    --go-glow: rgba(24, 201, 100, .38);

    --warn: #f5b400;
    --warn-tint: rgba(245, 180, 0, .10);
    --danger: #ff6b5e;

    --bg: #0a0d12;
    --surface: #12161e;
    --surface-2: #1a1f2a;
    --surface-3: #242b38;
    --line: rgba(255, 255, 255, .07);
    --line-strong: rgba(255, 255, 255, .14);

    --text: #eef2f7;
    --text-2: #b9c3cf;
    --muted: #7f8b9a;

    --whatsapp: #25d366;
    --telegram: #2aa1da;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;
    --r-pill: 999px;
    --gutter: 14px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 15px/1.5 var(--font);
    -webkit-font-smoothing: antialiased;
    /* part of the "no copying" deterrent; inputs opt back in below */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
input, textarea { -webkit-user-select: text; user-select: text; }
img { display: block; max-width: 100%; -webkit-user-drag: none; }
a { color: var(--brand-soft); text-decoration: none; }
button { font: inherit; color: inherit; }
.md-i { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-hide, .aab-hide { display: none !important; }

.md-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Header ---------- */
.md-top {
    position: sticky; top: 0; z-index: 20;
    background: rgba(10, 13, 18, .86);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--line);
}
.md-top .md-wrap { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.md-logo { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 800; letter-spacing: -.01em; }
.md-logo svg { width: 26px; height: 20px; }
.md-logo b { font-size: 17px; }
.md-logo span { color: var(--muted); font-weight: 600; font-size: 13px; }
.md-top-link {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 10px; border-radius: var(--r-pill);
    color: var(--text-2); font-size: 13px; font-weight: 600;
    border: 1px solid var(--line-strong);
}
.md-top-link .md-i { width: 15px; height: 15px; }

/* ---------- DMCA strip (one line, closable) ---------- */
.md-note {
    display: flex; align-items: center; gap: 8px;
    margin: 10px 0 0; padding: 7px 8px 7px 11px;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
    color: var(--muted); font-size: 12.5px; line-height: 1.35;
}
.md-note .md-i { width: 15px; height: 15px; color: var(--brand-soft); }
.md-note p { margin: 0; flex: 1; }
.md-note a { font-weight: 700; white-space: nowrap; }
.md-note-x {
    flex: 0 0 26px; width: 26px; height: 26px; padding: 0;
    display: grid; place-items: center;
    background: none; border: 0; border-radius: 50%; color: var(--muted); cursor: pointer;
}
.md-note-x .md-i { width: 15px; height: 15px; color: inherit; }
.md-note-x:hover { background: var(--surface-3); color: var(--text); }

/* ---------- Page grid ---------- */
.md-main {
    display: grid; gap: 12px;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: "file" "actions" "media" "help";
    padding-top: 12px;
}
.md-area-file { grid-area: file; }
.md-area-actions { grid-area: actions; }
.md-area-media { grid-area: media; }
.md-area-help { grid-area: help; }

/* ---------- File card ---------- */
.md-file {
    display: flex; gap: 12px; align-items: center;
    padding: 10px; border-radius: var(--r-lg);
    background: linear-gradient(180deg, var(--surface-2), var(--surface));
    border: 1px solid var(--line);
}
.md-thumb {
    flex: 0 0 auto; width: 58px; height: 82px;
    border-radius: 10px; overflow: hidden; background: var(--surface-3);
}
.md-thumb--square { height: 58px; }
.md-thumb img { width: 100%; height: 100%; object-fit: cover; }
.md-thumb--icon { display: grid; place-items: center; color: var(--brand-soft); background: var(--brand-tint); }
.md-thumb--icon .md-i { width: 26px; height: 26px; }
.md-file-body { min-width: 0; flex: 1; }
.md-kicker { margin: 0 0 2px; color: var(--muted); font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.md-title {
    margin: 0; font-size: 17px; line-height: 1.25; font-weight: 800; letter-spacing: -.01em;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    overflow-wrap: anywhere;
}
.md-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.md-chip {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px; border-radius: var(--r-pill);
    background: var(--surface-3); color: var(--text-2);
    font-size: 12px; font-weight: 600; line-height: 18px; white-space: nowrap;
}
.md-chip .md-i { width: 12px; height: 12px; }
.md-chip--ext { background: var(--brand-tint); color: var(--brand-soft); letter-spacing: .03em; }

/* ---------- Download buttons ---------- */
.md-actions { display: grid; gap: 8px; }
.md-btn {
    position: relative; overflow: hidden;
    display: flex; align-items: center; gap: 12px;
    width: 100%; min-height: 50px; padding: 0 14px;
    border-radius: 14px; border: 0; cursor: pointer;
    font-size: 16px; font-weight: 800; text-align: left;
    color: var(--text); background: var(--surface-2);
    -webkit-tap-highlight-color: transparent;
    transition: transform .12s ease, box-shadow .2s ease, background .2s ease;
}
.md-btn:active { transform: scale(.985); }
.md-btn .md-i { width: 22px; height: 22px; }
.md-btn-label { flex: 1; min-width: 0; }
.md-btn-label small { display: block; font-size: 12px; font-weight: 600; opacity: .8; }
.md-btn-tag {
    flex: 0 0 auto; padding: 3px 9px; border-radius: var(--r-pill);
    font-size: 12.5px; font-weight: 800; white-space: nowrap;
}

.md-btn--go {
    min-height: 60px; color: #05210f;
    background: linear-gradient(180deg, var(--go-hi), var(--go) 55%, var(--go-deep));
    box-shadow: 0 10px 26px -10px var(--go-glow), inset 0 1px 0 rgba(255, 255, 255, .35);
    font-size: 17.5px;
}
.md-btn--go .md-btn-tag { background: rgba(4, 40, 18, .22); color: #032a12; }
.md-btn--go .md-btn-icon {
    display: grid; place-items: center; width: 36px; height: 36px;
    border-radius: 10px; background: rgba(4, 40, 18, .16);
}
/* a slow sheen so the eye lands on it, off for reduced motion */
.md-btn--go::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .35), transparent);
    transform: skewX(-18deg);
    animation: md-sheen 3.6s ease-in-out 1.2s infinite;
}
@keyframes md-sheen { 0% { left: -60%; } 30%, 100% { left: 130%; } }
@media (hover: hover) { .md-btn--go:hover { box-shadow: 0 14px 30px -10px var(--go-glow), inset 0 1px 0 rgba(255, 255, 255, .4); } }

/* while md-v2.js fetches the link */
.md-btn.is-busy { opacity: .8; cursor: progress; }
.md-btn.is-busy .md-btn-icon .md-i, .md-btn--sub.is-busy > .md-i { animation: md-bob .7s ease-in-out infinite alternate; }
@keyframes md-bob { to { transform: translateY(3px); } }
.md-dl-msg { margin: 0; color: #ff9a90; font-size: 13px; font-weight: 600; text-align: center; }

.md-btn--sub { border: 1px solid var(--line-strong); }
.md-btn--sub .md-i { color: var(--brand-soft); }
.md-btn--sub .md-btn-tag { background: var(--brand-tint); color: var(--brand-soft); }
@media (hover: hover) { .md-btn--sub:hover { background: var(--surface-3); } }

.md-under {
    display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px;
    font-size: 12.5px; color: var(--muted);
}
.md-under a { color: var(--text-2); display: inline-flex; align-items: center; gap: 5px; }
.md-under a .md-i { width: 14px; height: 14px; }
.md-under .md-report { color: #ff8e84; }

.md-tip {
    display: flex; gap: 8px; align-items: flex-start;
    padding: 8px 10px; border-radius: var(--r-md);
    background: var(--warn-tint); border: 1px solid rgba(245, 180, 0, .22);
    color: #f3d991; font-size: 12.5px; line-height: 1.4;
}
.md-tip .md-i { width: 16px; height: 16px; color: var(--warn); margin-top: 1px; }
.md-tip b { color: #ffe08a; }

/* shown by the ad-blocker check when the download buttons are hidden */
.md-aab {
    padding: 12px; border-radius: var(--r-md);
    background: rgba(255, 107, 94, .1); border: 1px solid rgba(255, 107, 94, .35);
    color: #ffd2cd; font-size: 13.5px; line-height: 1.45;
}
.md-aab b { color: #fff; }
.md-aab-fixes { display: flex; gap: 8px; margin-top: 8px; }
.md-aab-fixes button {
    padding: 5px 10px; border-radius: var(--r-pill); border: 1px solid var(--line-strong);
    background: var(--surface-2); font-size: 12.5px; font-weight: 700; cursor: pointer;
}
.md-aab img { margin-top: 8px; border-radius: var(--r-sm); }

/* ---------- Media ---------- */
.md-player {
    position: relative; overflow: hidden;
    border-radius: var(--r-lg); background: #000; border: 1px solid var(--line);
    aspect-ratio: 16 / 9;
}
.md-player iframe, .md-player > img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.md-player-play {
    position: absolute; inset: 0; margin: auto; width: 62px; height: 62px;
    display: grid; place-items: center; border-radius: 50%;
    background: rgba(33, 135, 238, .92); color: #fff; border: 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .45);
}
.md-player-play .md-i { width: 26px; height: 26px; fill: currentColor; stroke: none; margin-left: 4px; }
.md-player-bar {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 22px 12px 10px;
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(transparent, rgba(0, 0, 0, .75));
    font-size: 12px; color: #dfe6ee;
}
.md-player-bar i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .25); }
.md-media-label { margin: 0 0 6px; color: var(--muted); font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }

/* compact audio player (the real one is the /embed iframe in theme=v2) */
.md-audio {
    display: flex; align-items: center; gap: 12px;
    padding: 10px; border-radius: var(--r-lg);
    background: var(--surface); border: 1px solid var(--line);
}
.md-audio-play {
    flex: 0 0 44px; width: 44px; height: 44px; border-radius: 50%; border: 0;
    display: grid; place-items: center; background: var(--brand); color: #fff;
}
.md-audio-play .md-i { width: 18px; height: 18px; fill: currentColor; stroke: none; margin-left: 3px; }
.md-audio-body { flex: 1; min-width: 0; }
.md-audio-body b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.md-audio-track { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 11.5px; color: var(--muted); }
.md-audio-track i { flex: 1; height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .12); position: relative; }
.md-audio-track i::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 28%; border-radius: 4px; background: var(--brand); }

/* the /embed audio player (aplayer, theme=v2) */
.md-audio-frame { display: block; width: 100%; height: 96px; border: 0; margin-top: 0; }

/* desktop-only poster panel for files with no player */
.md-poster { display: none; }

/* ---------- Help accordion ---------- */
.md-help {
    border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
}
.md-help > summary, .md-foot-sec > summary {
    list-style: none; cursor: pointer;
    display: flex; align-items: center; gap: 10px;
    -webkit-tap-highlight-color: transparent;
}
.md-help > summary::-webkit-details-marker, .md-foot-sec > summary::-webkit-details-marker { display: none; }
.md-help > summary { padding: 12px 14px; font-weight: 800; font-size: 15px; }
.md-help > summary .md-i { color: var(--brand-soft); }
.md-help > summary span { flex: 1; }
.md-chev { transition: transform .2s ease; color: var(--muted); }
details[open] > summary .md-chev { transform: rotate(180deg); }

.md-steps { margin: 0; padding: 0 14px 14px; list-style: none; counter-reset: s; display: grid; gap: 10px; }
.md-steps li {
    counter-increment: s; position: relative;
    padding-left: 34px; color: var(--text-2); font-size: 14px; line-height: 1.45;
}
.md-steps li::before {
    content: counter(s); position: absolute; left: 0; top: 0;
    width: 24px; height: 24px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--brand-tint); color: var(--brand-soft); font-size: 12.5px; font-weight: 800;
}
.md-steps b { color: var(--text); }
.md-steps .md-vlc::before { background: rgba(255, 136, 0, .16); color: #ff9c33; }

/* ---------- Ads + socials ---------- */
.md-ads { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin: 16px 0 0; }
.md-social { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 16px; }
.md-social a {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    height: 44px; border-radius: var(--r-md); font-weight: 800; font-size: 14px; color: #fff;
}
.md-social .md-i { width: 18px; height: 18px; }
.md-social .is-wa { background: rgba(37, 211, 102, .14); border: 1px solid rgba(37, 211, 102, .35); color: #7ff0ae; }
.md-social .is-tg { background: rgba(42, 161, 218, .14); border: 1px solid rgba(42, 161, 218, .35); color: #8fd3f5; }

/* ---------- Footer ---------- */
.md-foot { margin-top: 20px; border-top: 1px solid var(--line); background: var(--surface); }
.md-foot-grid { display: grid; }
.md-foot-sec { border-bottom: 1px solid var(--line); }
.md-foot-sec > summary { padding: 13px 0; font-weight: 700; font-size: 14px; color: var(--text); }
.md-foot-sec > summary span { flex: 1; }
.md-foot-body { padding: 0 0 14px; color: var(--muted); font-size: 13.5px; line-height: 1.55; }
.md-foot-body p { margin: 0 0 6px; }
.md-foot-body a { font-weight: 700; }
.md-foot-links { display: flex; gap: 14px; }
.md-foot-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); }
.md-foot-links .md-i { width: 16px; height: 16px; }
.md-copy { margin: 0; padding: 14px 0 22px; text-align: center; color: var(--muted); font-size: 12px; }

/* ---------- Desktop ---------- */
@media (min-width: 900px) {
    :root { --gutter: 24px; }
    .md-top .md-wrap { height: 60px; }
    .md-note { margin-top: 14px; font-size: 13px; }
    .md-main {
        padding-top: 18px; gap: 14px 28px; align-items: start;
        grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
        grid-template-areas: "media file" "media actions" "media help";
        grid-template-rows: auto auto 1fr;
    }
    .md-file { padding: 0; background: none; border: 0; }
    .md-file .md-thumb { display: none; }
    .md-main--solo {
        grid-template-columns: minmax(0, 620px); justify-content: center;
        grid-template-areas: "file" "actions" "help"; grid-template-rows: none;
    }
    .md-main--solo .md-area-media { display: none; }
    .md-main--solo .md-file .md-thumb { display: grid; }
    .md-title { font-size: 26px; -webkit-line-clamp: 3; }
    .md-kicker { font-size: 12px; }
    .md-btn--go { min-height: 64px; }
    .md-poster {
        display: block; position: relative; overflow: hidden;
        aspect-ratio: 16 / 10; border-radius: var(--r-lg); border: 1px solid var(--line);
        background: var(--surface);
    }
    .md-poster-bg { position: absolute; inset: -20px; width: calc(100% + 40px); height: calc(100% + 40px); object-fit: cover; filter: blur(22px) brightness(.45) saturate(1.2); }
    .md-poster-img { position: relative; height: 86%; width: auto; margin: 3.5% auto 0; border-radius: 12px; box-shadow: 0 20px 40px rgba(0, 0, 0, .55); }
    .md-poster--square .md-poster-img { height: 80%; margin-top: 5%; }
    .md-audio { margin-top: 12px; }
    .md-foot { margin-top: 32px; }
    .md-foot-grid { grid-template-columns: 1.3fr 1fr 1.3fr; gap: 40px; padding-top: 22px; }
    .md-foot-sec { border: 0; }
    .md-foot-sec > summary { pointer-events: none; padding: 0 0 8px; color: var(--warn); }
    .md-foot-sec > summary .md-chev { display: none; }
    .md-copy { border-top: 1px solid var(--line); margin-top: 18px; padding: 16px 0 26px; }
}

@media (prefers-reduced-motion: reduce) {
    .md-btn--go::after { animation: none; display: none; }
    .md-chev { transition: none; }
}
