/**
 * media-style.css — Shared CSS for all How2.me media downloader tools
 * Loaded via functions.php on all media downloader pages
 * Last updated: March 2026
 */

/* ── Reset & Base ─────────────────────────────────────────── */
* {
    box-sizing: border-box
}

.md-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: #f8fafc;
    min-height: 100vh
}

/* ── Hero Section ─────────────────────────────────────────── */
.md-hero {
    background: linear-gradient(135deg, #0f0f0fee, #0a0a1a, #0f0f0fcc);
    padding: 3rem 1.5rem 2.5rem;
    text-align: center;
    position: relative;
    overflow: hidden
}

.md-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 50% 0%, rgba(99, 102, 241, .18) 0%, transparent 70%);
    pointer-events: none
}

.md-hero-inner {
    max-width: 720px;
    margin: 0 auto;
    position: relative;
    z-index: 1
}

.md-hero h1 {
    font-size: clamp(1.6rem, 5vw, 2.6rem);
    font-weight: 900;
    color: #fff;
    letter-spacing: -.04em;
    margin: 0 0 .75rem
}

.md-hero p {
    font-size: clamp(.9rem, 2.5vw, 1.05rem);
    color: rgba(255, 255, 255, .72);
    margin: 0 0 1.75rem;
    line-height: 1.6
}

/* ── Search/URL Input ─────────────────────────────────────── */
.md-search-wrap,
.yt-search-wrap {
    display: flex;
    gap: .5rem;
    background: rgba(255, 255, 255, .06);
    border: 1.5px solid rgba(255, 255, 255, .12);
    border-radius: 14px;
    padding: .5rem .5rem .5rem .9rem;
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px)
}

.md-search-wrap input,
.yt-search-wrap input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    min-width: 0
}

.md-search-wrap input::placeholder,
.yt-search-wrap input::placeholder {
    color: #64748b
}

.md-search-wrap button,
.yt-search-wrap button {
    flex-shrink: 0;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: .7rem 1.4rem;
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: opacity .18s, transform .18s;
    font-family: inherit
}

.md-search-wrap button:hover,
.yt-search-wrap button:hover {
    opacity: .9;
    transform: translateY(-1px)
}

.md-search-wrap button:active,
.yt-search-wrap button:active {
    transform: translateY(0)
}

/* ── Main Content Wrapper ─────────────────────────────────── */
.md-wrap,
.yt-wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 1.5rem 1rem 3rem
}

/* ── Loading State ────────────────────────────────────────── */
.md-loading,
.yt-loading {
    background: #fff;
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    display: none;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .06)
}

.md-loading-spinner,
.yt-loading-spinner {
    width: 44px;
    height: 44px;
    border: 4px solid #f1f5f9;
    border-top-color: #6366f1;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 1rem
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.md-loading-msg,
.yt-loading-msg {
    font-size: .95rem;
    color: #64748b;
    font-weight: 500
}

/* ── Error State ──────────────────────────────────────────── */
.md-error,
.yt-error {
    background: #fff5f5;
    border: 1.5px solid #fecaca;
    border-radius: 12px;
    padding: 1rem 1.25rem;
    display: none;
    color: #dc2626;
    font-size: .9rem;
    font-weight: 500
}

/* ── Result Card ──────────────────────────────────────────── */
.md-result,
.yt-result {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 1.5rem;
    margin-top: 1.25rem;
    display: none;
    box-shadow: 0 2px 16px rgba(0, 0, 0, .06)
}

.md-result-top,
.yt-result-top {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    margin-bottom: 1.25rem
}

.md-thumb,
.yt-thumb {
    width: 140px;
    height: 90px;
    object-fit: cover;
    border-radius: 10px;
    flex-shrink: 0;
    background: #f1f5f9
}

.md-meta,
.yt-meta {
    flex: 1;
    min-width: 0
}

.md-title,
.yt-title {
    font-size: 1rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 .35rem;
    line-height: 1.35
}

.md-channel,
.yt-channel {
    font-size: .82rem;
    color: #64748b;
    margin: 0 0 .2rem
}

.md-duration,
.yt-duration {
    font-size: .8rem;
    color: #94a3b8;
    font-weight: 600
}

/* ── Format Groups ────────────────────────────────────────── */
.md-formats-label,
.yt-formats-label {
    font-size: .75rem;
    font-weight: 800;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .06em;
    margin: 0 0 1rem
}

.md-format-group,
.yt-format-group {
    margin-bottom: 1.1rem
}

.md-format-group-label,
.yt-format-group-label {
    font-size: .75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
    margin-bottom: .5rem
}

.md-format-list,
.yt-format-list {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem
}

/* ── Format/Download Buttons ──────────────────────────────── */
.md-format-btn,
.yt-format-btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: .55rem 1rem;
    font-size: .85rem;
    font-weight: 700;
    color: #1e293b;
    text-decoration: none;
    cursor: pointer;
    transition: all .18s;
    white-space: nowrap;
    font-family: inherit
}

.md-format-btn:hover,
.yt-format-btn:hover {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, .25)
}

.md-format-btn.audio,
.yt-format-btn.audio {
    border-color: #8b5cf6;
    color: #7c3aed
}

.md-format-btn.audio:hover,
.yt-format-btn.audio:hover {
    background: #8b5cf6;
    border-color: #8b5cf6;
    color: #fff
}

.md-format-size,
.yt-format-size {
    font-size: .72rem;
    font-weight: 400;
    opacity: .7
}

/* ── Download Tip ─────────────────────────────────────────── */
.md-tip,
.yt-tip {
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: 10px;
    padding: .75rem 1rem;
    font-size: .8rem;
    color: #166534;
    margin-top: 1rem;
    line-height: 1.5
}

/* ── Info Steps Section ───────────────────────────────────── */
.md-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0
}

.md-step {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center
}

.md-step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin: 0 auto .75rem;
    color: #fff
}

.md-step h3 {
    font-size: .88rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 .25rem
}

.md-step p {
    font-size: .78rem;
    color: #64748b;
    margin: 0
}

/* ── Supported Sites Grid ─────────────────────────────────── */
.md-sites {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 1rem 0
}

.md-site-tag {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    padding: .35rem .85rem;
    font-size: .8rem;
    font-weight: 600;
    color: #475569
}

/* ── FAQ Section ──────────────────────────────────────────── */
.md-faq,
.yt-faq {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    margin-top: 1.5rem
}

.md-faq h2,
.yt-faq h2 {
    font-size: 1.2rem;
    font-weight: 800;
    color: #1e293b;
    margin: 0 0 1.25rem
}

.md-faq-item,
.yt-faq-item {
    border-bottom: 1px solid #f1f5f9;
    padding: .85rem 0
}

.md-faq-item:last-child,
.yt-faq-item:last-child {
    border-bottom: none;
    padding-bottom: 0
}

.md-faq-q,
.yt-faq-q {
    font-size: .9rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: .3rem
}

.md-faq-a,
.yt-faq-a {
    font-size: .85rem;
    color: #64748b;
    line-height: 1.7
}

/* ── Responsive ───────────────────────────────────────────── */
@media(max-width:600px) {

    .md-result-top,
    .yt-result-top {
        flex-direction: column
    }

    .md-thumb,
    .yt-thumb {
        width: 100%;
        height: 180px
    }

    .md-search-wrap,
    .yt-search-wrap {
        flex-direction: column
    }

    .md-search-wrap button,
    .yt-search-wrap button {
        width: 100%;
        padding: .8rem;
        text-align: center;
        justify-content: center
    }

    .md-steps {
        grid-template-columns: 1fr 1fr
    }
}

@media(max-width:400px) {
    .md-steps {
        grid-template-columns: 1fr
    }
}