/* YTMP3 Main Styles — v4.0 */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:      #1565C0;
    --primary-dark: #0D47A1;
    --accent:       #FFFFFF;
    --btn-color:    #111827;
    --header-bg:    #1565C0;
    --body-bg:      #f6f6f6;
    --text:         #333333;
    --white:        #ffffff;
    --border:       #e0e4eb;
    --card-bg:      #ffffff;
    --shadow:       0 4px 24px rgba(0,0,0,0.08);
    --bg-subtle:    #f3f4f6;
    --bg-input:     #ffffff;
    --text-soft:    #555;
    --text-faint:   #888;
    --border-input: #d0d7de;
    --result-bg:    #f0f7ff;
    --result-border:#bbdefb;
    --error-bg:     #fff0f0;
    --error-border: #fca5a5;
    --error-text:   #991b1b;
    --faq-hover:    #f8f9fa;
    --ad-bg:        #ffffff;
    --direct-bg:    #f6f8fa;
}



html { scroll-behavior: smooth; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--body-bg);
    color: var(--text);
    line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* Top ad zone */
.ad-zone-top { background: var(--white); padding: 8px 0; text-align: center; border-bottom: 1px solid var(--border); }

/* ── Header ─────────────────────────────────────────────────── */
.site-header {
    background: var(--header-bg);
    background-image: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    padding-bottom: 60px;
}
.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 20px;
}
.navbar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    text-decoration: none;
}
.navbar-brand:hover { text-decoration: none; }
.brand-icon {
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.2);
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 900;
}
.navbar-nav {
    display: flex;
    align-items: center;
    gap: 28px;
    list-style: none;
}
.navbar-nav li a {
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.15s;
}
.navbar-nav li a:hover { color: #fff; text-decoration: none; }

/* ── Platform tabs ──────────────────────────────────────────── */
.platform-tabs {
    display: flex;
    gap: 4px;
    background: #000;
    padding: 5px;
    border-radius: 14px;
    margin-bottom: 18px;
    width: 100%;
    box-sizing: border-box;
}
.ptab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 4px;
    background: transparent;
    border: none;
    border-radius: 10px;
    color: rgba(255,255,255,.75);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .18s ease;
    white-space: nowrap;
}
.ptab svg { width: 15px; height: 15px; flex-shrink: 0; }
.ptab.active { color: #fff; box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.ptab[data-platform="youtube"].active {
    background: linear-gradient(135deg, #e52d27, #b31217);
}
.ptab[data-platform="audiomack"].active {
    background: linear-gradient(135deg, #FF6900, #cc5500);
}
.ptab[data-platform="tiktok"].active {
    background: linear-gradient(135deg, #00F2EA 0%, #FE2C55 100%);
    text-shadow: 0 0 12px rgba(254,44,85,.4);
}
.ptab:hover:not(.active) { background: rgba(255,255,255,.15); color: #fff; }
.format-btn.hidden { display: none !important; }

/* ── Hero / converter area ─────────────────────────────────── */
.hero {
    text-align: center;
    padding: 20px 20px 0;
    max-width: 1100px;
    margin: 0 auto;
}
.hero h1 {
    color: #fff;
    font-size: clamp(24px, 5vw, 40px);
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}
.hero p {
    color: rgba(255,255,255,0.88);
    font-size: 16px;
    margin-bottom: 28px;
}

/* Converter card */
.converter-card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.18);
    padding: 28px 28px 24px;
    max-width: 760px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
    text-align: left;
}
.converter-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 10px;
    display: block;
}
.url-input-row {
    display: flex;
    margin-bottom: 14px;
    width: 100%;
}
.url-input {
    flex: 1;
    padding: 14px 18px;
    font-size: 15px;
    border: 1.5px solid var(--border-input);
    border-right: none;
    border-radius: 10px 0 0 10px;
    outline: none;
    color: var(--text);
    background: var(--bg-input);
    transition: border-color 0.15s;
    min-width: 0;
    width: auto;
}
.url-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,0.1); }
.url-input::placeholder { color: var(--text-faint); }
.convert-btn {
    padding: 14px 28px;
    background: var(--btn-color);
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 0 10px 10px 0;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
}
.convert-btn:hover { background: #1f2937; }
.convert-btn:active { transform: scale(0.98); }
.convert-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.format-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.format-btn {
    padding: 8px 20px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
    letter-spacing: 0.3px;
    background: var(--bg-subtle);
    color: var(--text-soft);
    border-color: var(--border);
    -webkit-appearance: none;
    appearance: none;
}
.format-btn.active {
    background: var(--btn-color);
    color: #fff;
    border-color: var(--btn-color);
}
.format-btn:hover:not(.active) { border-color: #aaa; }

/* Result / Progress */
.converter-result { margin-top: 18px; display: none; }

.progress-wrap { text-align: center; padding: 20px 0; }
.spinner {
    width: 40px; height: 40px;
    border: 4px solid #e0e4eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.progress-text { color: var(--text-soft); font-size: 14px; font-weight: 500; }
.progress-bar-wrap { background: var(--border); border-radius: 100px; height: 6px; margin: 10px auto; max-width: 300px; overflow: hidden; }
.progress-bar { height: 100%; background: var(--primary); border-radius: 100px; width: 0; animation: progressAnim 3s ease-in-out infinite; }
@keyframes progressAnim { 0%{width:5%} 60%{width:75%} 100%{width:88%} }

/* Download result box */
.result-box {
    background: var(--result-bg);
    border: 1.5px solid var(--result-border);
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 16px;
    align-items: flex-start;
}
.result-thumb {
    width: 110px;
    min-width: 110px;
    height: 66px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #e0e4eb;
}
.result-info { flex: 1; min-width: 0; width: 100%; }
.result-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-meta  { font-size: 12px; color: var(--text-soft); margin-bottom: 12px; }
.result-meta span { margin-right: 12px; }
.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: var(--dlbtn-color);
    color: #fff;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: filter 0.15s, transform 0.1s;
    -webkit-appearance: none;
    appearance: none;
}
.download-btn:hover { filter: brightness(0.85); color: #fff; text-decoration: none; }
.download-btn:active { transform: scale(0.97); }
.download-btn:disabled { opacity: 0.6; cursor: not-allowed; }
#converter-result .download-btn { margin-top: 12px; }

.direct-url-row { margin-top:10px; font-size:12px; }
.direct-url-row summary { cursor:pointer; color:#9ca3af; padding:4px 0; user-select:none; }
.direct-url-row[open] .direct-url-inner { display:flex; gap:8px; margin-top:6px; align-items:center; justify-content:center; }
.direct-url-input { flex:1; max-width:400px; padding:8px 12px; border:1px solid var(--border-input); border-radius:6px; font-size:12px; color:var(--text); background:var(--direct-bg); cursor:text; }
.direct-url-input:focus { outline:none; border-color:#1565C0; }
.copy-url-btn { padding:8px 16px; background:#1565C0; color:#fff; border:none; border-radius:6px; font-size:12px; cursor:pointer; white-space:nowrap; }
.copy-url-btn:hover { background:#0D47A1; }

/* Error */
.error-box {
    background: var(--error-bg);
    border: 1.5px solid var(--error-border);
    border-radius: 10px;
    padding: 16px 18px;
    color: var(--error-text);
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    line-height: 1.5;
}
.error-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }

/* Coming Soon */
.coming-soon {
    text-align: center;
    padding: 40px 20px;
    background: #fff7ed;
    border: 2px dashed #fbbf24;
    border-radius: 14px;
    margin-top: 18px;
}
.coming-soon-icon { font-size: 48px; margin-bottom: 12px; }
.coming-soon h3 {
    font-size: 22px;
    font-weight: 800;
    color: #92400e;
    margin: 0 0 8px;
}
.coming-soon p {
    font-size: 15px;
    color: #92400e;
    margin: 0 0 6px;
    line-height: 1.6;
}
.coming-soon .coming-soon-sub {
    font-size: 13px;
    color: #a16207;
    margin-top: 12px;
}

/* Ad zones before/after converter */
.ad-zone-widget {
    margin: 16px auto;
    padding: 16px;
    background: var(--ad-bg);
    border: 2px solid var(--border);
    border-radius: 12px;
    text-align: center;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.ad-zone-widget:empty { display: none; }

.widget-info-line {
    text-align: center;
    font-size: 12px;
    color: var(--text-faint);
    padding: 10px 0 4px;
}
.widget-disclaimer {
    text-align: center;
    font-size: 11px;
    color: var(--text-faint);
    padding: 8px 0 2px;
    border-top: 1px solid var(--border);
    margin-top: 12px;
}

.coming-soon-msg {
    text-align: center;
    width: 100%;
    padding: 30px 20px;
}
.coming-soon-msg .coming-soon-icon { font-size: 52px; margin-bottom: 10px; }
.coming-soon-msg h3 {
    font-size: 22px;
    font-weight: 800;
    color: #92400e;
    margin: 0 0 8px;
}
.coming-soon-msg p {
    font-size: 15px;
    color: #666;
    margin: 0 0 6px;
    line-height: 1.6;
}
.coming-soon-msg .coming-soon-sub {
    font-size: 13px;
    color: #999;
    margin-top: 12px;
}

/* Main wrap */
.main-wrap { max-width: 900px; margin: 0 auto; padding: 0 20px; }

/* Banner Ad */
.ad-banner-zone { text-align: center; padding: 20px 0; }
.ad-banner-zone a img { max-height: 120px; border-radius: 8px; border: 1px solid var(--border); }

/* Content sections */
.content-section {
    background: var(--card-bg);
    border-radius: 14px;
    box-shadow: var(--shadow);
    padding: 32px;
    margin: 30px 0;
}
.content-section p  { font-size: 15px; color: var(--text-soft); margin-bottom: 14px; line-height: 1.7; }
.content-section h2 { font-size: 20px; font-weight: 800; color: var(--text); margin: 20px 0 10px; }
.content-section h3 { font-size: 16px; font-weight: 700; color: var(--text); margin: 16px 0 8px; }
.content-section ul { padding-left: 22px; margin-bottom: 12px; }
.content-section ul li { font-size: 14px; color: var(--text-soft); margin-bottom: 6px; line-height: 1.6; }
.content-section a  { color: var(--primary); }

/* Steps */
.steps-list { list-style: none; }
.steps-list li { padding: 6px 0 6px 28px; position: relative; font-size: 15px; color: #444; }
.steps-list li::before { content: attr(data-num); position: absolute; left: 0; color: var(--primary); font-weight: 800; }
.steps-list .sub { list-style: disc; padding-left: 24px; margin: 4px 0; }
.steps-list .sub li { padding-left: 0; font-size: 14px; }
.steps-list .sub li::before { display: none; }

/* FAQ */
.faq-section { margin: 30px 0; }
.faq-section h2 { font-size: 22px; font-weight: 800; margin-bottom: 16px; color: var(--text); }
.faq-item { background: var(--card-bg); border: 1px solid var(--border); border-radius: 10px; margin-bottom: 10px; overflow: hidden; }
.faq-question { padding: 16px 20px; font-size: 15px; font-weight: 600; cursor: pointer; display: flex; justify-content: space-between; align-items: center; user-select: none; }
.faq-question:hover { background: var(--faq-hover); }
.faq-toggle { font-size: 18px; transition: transform 0.25s; color: var(--primary); flex-shrink: 0; margin-left: 12px; }
.faq-answer { padding: 0 20px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.2s; font-size: 14px; color: var(--text-soft); line-height: 1.7; }
.faq-item.open .faq-answer { padding: 0 20px 16px; max-height: 500px; }
.faq-item.open .faq-toggle { transform: rotate(45deg); }

/* Page layout for inner pages */
.page-wrap {
    max-width: 800px;
    margin: 40px auto;
    padding: 0 20px 60px;
}

/* Contact form */
.contact-form .form-group { margin-bottom: 18px; }
.contact-form label { display: block; font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.contact-form input,
.contact-form textarea,
.contact-form select {
    width: 100%;
    padding: 11px 14px;
    border: 1.5px solid var(--border-input);
    background: var(--bg-input);
    color: var(--text);
    border-radius: 9px;
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color 0.15s;
    font-family: inherit;
}
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(21,101,192,0.1); }
.contact-form textarea { resize: vertical; min-height: 130px; }
.contact-form .submit-btn {
    padding: 12px 32px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 9px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.contact-form .submit-btn:hover { background: var(--primary-dark); }
.form-alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.form-alert.success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.form-alert.error   { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }

/* ── Footer ─────────────────────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 30px 20px 24px;
    font-size: 13px;
    color: var(--text-faint);
    border-top: 1px solid var(--border);
    margin-top: 20px;
}
.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.footer-links a { color: var(--text-faint); transition: color 0.15s; }
.footer-links a:hover { color: var(--primary); text-decoration: none; }
.footer-copy  { margin-bottom: 4px; }
.footer-credit { font-size: 12px; color: #aaa; }
.footer-credit a { color: #aaa; text-decoration: underline; }
.footer-credit a:hover { color: var(--primary); }

/* Floating sidebar ad */
.sidebar-ad-float {
    position: fixed;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    max-width: 160px;
}

/* Redirect overlay */
.redirect-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
.redirect-overlay.active { display: flex; }
.redirect-box {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 40px 32px;
    text-align: center;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.redirect-box h3 { font-size: 20px; font-weight: 800; margin-bottom: 10px; color: var(--text); }
.redirect-box p  { color: var(--text-soft); font-size: 14px; margin-bottom: 16px; }
.redirect-timer  { font-size: 56px; font-weight: 900; color: var(--primary); line-height: 1; margin-bottom: 8px; }
.redirect-skip   { font-size: 12px; color: var(--text-faint); cursor: pointer; display: inline-block; margin-top: 8px; }
.redirect-skip:hover { color: var(--text-soft); text-decoration: underline; }

/* M4A→MP3 conversion progress */
.progress-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 100px;
    width: 0;
    transition: width 0.3s ease;
}
.conversion-progress-text {
    font-size: 12px;
    color: var(--text-soft);
    text-align: center;
    margin-top: 6px;
}

/* Mobile hamburger */
.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 6px; }
.hamburger span { display: block; width: 22px; height: 2.5px; background: #fff; margin: 5px 0; border-radius: 2px; transition: all 0.2s; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 700px) {
    .hamburger { display: block; }
    .navbar { position: relative; }
    .navbar-nav {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 66px; left: 0; right: 0;
        background: var(--primary-dark);
        padding: 10px 0;
        z-index: 100;
        gap: 0;
    }
    .navbar-nav.open { display: flex; }
    .navbar-nav li a { padding: 12px 20px; display: block; }
    .converter-card { padding: 18px 16px; border-radius: 12px; }
    .url-input-row { flex-direction: column; }
    .url-input { border-radius: 10px; border-right: 1.5px solid #d0d7de; margin-bottom: 8px; width: 100%; }
    .convert-btn { border-radius: 10px; width: 100%; min-width: 0; }
    .result-box { flex-direction: column; }
    .result-thumb { width: 100%; min-width: 0; height: 150px; }
    .result-info { width: 100%; }
    .sidebar-ad-float { display: none; }
    .content-section { padding: 20px 16px; border-radius: 10px; }
    .page-wrap { margin: 20px auto; }
    .ptab { font-size: 11px; padding: 8px 2px; }
    .hero h1 { font-size: 22px; }
    .hero p { font-size: 14px; }
}
