/* assets/css/style.css - MP3Juice Modernized Responsive Stylesheet */

:root {
    --bg-primary: #1676c2;
    --bg-gradient: linear-gradient(180deg, #187bcd 0%, #146cb3 100%);
    --card-bg: #156aae;
    --card-border: rgba(255, 255, 255, 0.15);
    --card-hover: #13609e;
    --white: #ffffff;
    --text-dark: #222222;
    --text-muted: #666666;
    --text-light: rgba(255, 255, 255, 0.9);
    --btn-gray: #f4f6f8;
    --btn-gray-hover: #e5e9ec;
    --accent-green: #28a745;
    --accent-red: #e53935;
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.12);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.16);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.22);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
}

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

html, body {
    width: 100%;
    overflow-x: hidden; /* Prevent horizontal scrolling/overflow on mobile */
}

body {
    background: var(--bg-primary);
    background: var(--bg-gradient);
    min-height: 100vh;
    color: var(--white);
    font-family: 'Open Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

a {
    color: var(--white);
    text-decoration: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

a:hover {
    opacity: 0.85;
}

/* ===============================
   Header & Navigation
================================== */
#header {
    width: 100%;
    padding: 15px 16px 0;
}

#nav {
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding-bottom: 12px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.nav-links a {
    font-size: 13.5px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.nav-links a:hover {
    text-decoration: underline;
}

/* Language Dropdown */
.lang-selector {
    position: relative;
    flex-shrink: 0;
}

.lang-btn {
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: var(--white);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: rgba(255, 255, 255, 0.22);
}

.lang-btn .arrow-icon {
    font-size: 10px;
    transition: transform 0.2s ease;
}

.lang-selector.open .arrow-icon {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: var(--white);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    width: 175px;
    max-height: 340px;
    overflow-y: auto;
    display: none;
    flex-direction: column;
    z-index: 1000;
    animation: fadeIn 0.15s ease-out;
}

.lang-selector.open .lang-menu {
    display: flex;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    color: var(--text-dark);
    font-size: 13px;
    font-weight: 500;
    border-bottom: 1px solid #f1f3f5;
    transition: background 0.15s ease;
}

.lang-option:last-child {
    border-bottom: none;
}

.lang-option:hover {
    background: #eef5fc;
    opacity: 1;
}

.lang-option.active {
    background: #e3effa;
    font-weight: 700;
    color: #1062a4;
}

/* ===============================
   Main Content Container
================================== */
#main {
    flex: 1;
    max-width: 680px;
    width: 100%;
    margin: 0 auto;
    padding: 25px 16px 40px;
}

/* Logo Section */
.logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.logo-container a {
    display: inline-block;
}

.site-logo {
    max-width: 340px;
    width: 85%;
    height: auto;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.18));
    transition: transform 0.25s ease;
}

.site-logo:hover {
    transform: scale(1.02);
}

/* Search Box Container */
.search-wrapper {
    position: relative;
    width: 100%;
    margin: 0 auto 10px;
}

.search-form {
    display: flex;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    height: 48px;
    align-items: center;
}

.search-input {
    flex: 1;
    height: 100%;
    border: none;
    outline: none;
    padding: 0 16px;
    font-family: inherit;
    font-size: 16px; /* 16px prevents iOS Safari from automatically zooming in */
    color: var(--text-dark);
    background: transparent;
    min-width: 0;
}

.search-input::placeholder {
    color: #8c9ba5;
    font-size: 14px;
}

.search-submit {
    width: 52px;
    height: 100%;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-dark);
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.search-submit:hover {
    background: #f0f3f6;
    color: var(--bg-primary);
}

/* Autocomplete Dropdown */
.autocomplete-box {
    position: absolute;
    top: 50px;
    left: 0;
    right: 0;
    background: var(--white);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    z-index: 999;
    border-top: 1px solid #edf0f2;
}

.autocomplete-box.active {
    display: flex;
}

.autocomplete-item {
    padding: 10px 16px;
    color: var(--text-dark);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background 0.15s ease;
    border-bottom: 1px solid #f8f9fa;
}

.autocomplete-item i {
    color: #a0aec0;
    font-size: 12px;
}

.autocomplete-item:hover,
.autocomplete-item.selected {
    background: #eef5fc;
    color: var(--bg-primary);
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: #f0f6fc;
    color: #1062a4;
}

.terms-notice {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.85);
    text-align: center;
    margin-top: 8px;
    letter-spacing: 0.1px;
}

/* Trending Searches (SEO Internal Links) */
.trending-container {
    margin: 14px auto 6px;
    text-align: center;
    max-width: 720px;
}

.trending-label {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #ffeb3b;
    margin-right: 8px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.trending-tags {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.trending-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: var(--white);
    text-decoration: none;
    font-size: 11.5px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.trending-tag:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    color: var(--white);
}

/* ===============================
   Loader State
================================== */
#loader {
    display: none;
    text-align: center;
    margin: 35px auto;
}

.spinner {
    width: 42px;
    height: 42px;
    border: 3.5px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--white);
    border-radius: 50%;
    margin: 0 auto 12px;
    animation: spin 0.8s linear infinite;
}

#loader p {
    font-size: 14px;
    font-weight: 600;
    color: var(--white);
}

/* ===============================
   Search Results Area
================================== */
#results-area {
    margin-top: 30px;
    display: none;
    width: 100%;
}

.results-header-text {
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid rgba(255, 255, 255, 0.6);
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 18px;
    color: rgba(255, 255, 255, 0.95);
    word-break: break-word;
}

.results-header-text strong {
    color: var(--white);
}

.results-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    width: 100%;
}

/* Result Item Card */
.result-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 12px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.15s ease, background 0.15s ease;
    width: 100%;
}

.result-card:hover {
    background: var(--card-hover);
}

.result-card-main {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
}

/* Thumbnail */
.result-thumb-wrap {
    position: relative;
    flex-shrink: 0;
    width: 110px;
    height: 72px;
    border-radius: 4px;
    overflow: hidden;
    background: #000;
}

.result-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.result-duration-badge {
    position: absolute;
    bottom: 3px;
    right: 3px;
    background: rgba(0, 0, 0, 0.8);
    color: var(--white);
    font-size: 10.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 2px;
}

/* Info Details */
.result-info {
    flex: 1;
    min-width: 0;
    text-align: left;
}

.result-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.result-meta {
    font-size: 11.5px;
    color: rgba(255, 255, 255, 0.78);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.result-meta span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

/* Actions Button Row */
.result-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-action {
    background: var(--white);
    color: var(--text-dark);
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    padding: 6px 16px;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.1s ease;
}

.btn-action:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

.btn-action.btn-download-trigger {
    background: var(--white);
    color: #12558d;
}

.btn-action.btn-play-trigger {
    background: rgba(255, 255, 255, 0.9);
}

.btn-action.btn-stop-trigger {
    background: var(--accent-red);
    color: var(--white);
}

/* Expandable Option Panels (Download & Player) */
.result-expandable {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    animation: fadeIn 0.2s ease-out;
    width: 100%;
}

/* Download Panel Box */
.download-panel {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 14px;
    color: var(--text-dark);
    text-align: center;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.download-panel-title {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 6px;
    color: #12558d;
    word-break: break-word;
}

.download-panel-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 12px;
}

/* Multi-Server Download Grid */
.download-servers-wrapper {
    margin-top: 10px;
    width: 100%;
}

.servers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 8px;
    margin-bottom: 12px;
}

/* Info notice above servers */
.server-notice-box {
    background: #f0f7ff;
    border: 1px solid #cce3f8;
    color: #1a649f;
    font-size: 12px;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-align: center;
}

.server-notice-box i {
    font-size: 14px;
    color: #0284c7;
    flex-shrink: 0;
}

.btn-server {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
    font-family: inherit;
    width: 100%;
    min-width: 0;
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
    color: #ffffff !important;
}

.btn-server:hover {
    background: linear-gradient(135deg, #0369a1 0%, #075985 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.35);
}

.server-icon-wrap {
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
    color: #ffffff;
}

.server-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.server-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.server-sub {
    font-size: 10.5px;
    opacity: 0.9;
    color: #e0f2fe;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
}

.server-close-wrap {
    display: flex;
    justify-content: center;
    margin-top: 6px;
}

.btn-close-panel {
    background: #f1f5f9;
    color: #475569;
    border: none;
    font-size: 12px;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-close-panel:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.converter-loader-text {
    padding: 20px;
    text-align: center;
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

/* Iframe Converter Container - Responsive Height */
.converter-frame-wrap {
    margin-top: 12px;
    width: 100%;
    min-height: 120px;
    background: #f8fafc;
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.converter-frame {
    width: 100%;
    min-height: 480px;
    height: 520px;
    border: none;
    display: block;
    background: #fff;
}

/* Video Player Preview Container */
.player-container {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.player-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Single Result View */
.single-result-view {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: center;
    box-shadow: var(--shadow-md);
    width: 100%;
}

.single-result-view .player-container {
    margin-bottom: 16px;
}

.single-result-view h3 {
    font-size: 16px;
    margin-bottom: 12px;
}

/* ===============================
   SEO Text & FAQ Section
================================== */
.seo-section {
    margin-top: 40px;
    text-align: justify;
    line-height: 1.7;
    width: 100%;
}

.seo-section h1 {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: var(--white);
}

.seo-section h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 26px 0 12px;
    color: var(--white);
}

.seo-section p {
    margin-bottom: 14px;
    font-size: 13.5px;
    color: rgba(255, 255, 255, 0.92);
}

/* FAQ Accordion */
.faq-box {
    margin-top: 20px;
    width: 100%;
}

.faq-item {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    overflow: hidden;
    width: 100%;
}

.faq-header {
    width: 100%;
    padding: 13px 16px;
    background: transparent;
    border: none;
    color: var(--white);
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background 0.15s ease;
}

.faq-header:hover {
    background: rgba(255, 255, 255, 0.06);
}

.faq-header i {
    font-size: 11px;
    transition: transform 0.25s ease;
}

.faq-item.active .faq-header i {
    transform: rotate(180deg);
}

.faq-body {
    display: none;
    padding: 0 16px 14px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    line-height: 1.6;
}

.faq-item.active .faq-body {
    display: block;
}

/* ===============================
   Footer
================================== */
#footer {
    width: 100%;
    max-width: 680px;
    margin: 20px auto 0;
    padding: 25px 16px 30px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.footer-links a {
    font-size: 13px;
    font-weight: 600;
}

.footer-copy {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 8px;
}

.footer-disclaimer {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
    max-width: 580px;
    margin: 0 auto;
}

/* ===============================
   Animations
================================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===============================
   Responsive Adjustments (Mobile Phones)
================================== */
@media (max-width: 640px) {
    #header {
        padding: 12px 12px 0;
    }

    #nav {
        flex-direction: row; /* Keep nav on one row or compact */
        justify-content: space-between;
        align-items: center;
    }

    .nav-links {
        gap: 12px;
    }

    .nav-links a {
        font-size: 12.5px;
    }

    #main {
        padding: 16px 12px 30px;
        width: 100%;
    }

    .site-logo {
        max-width: 270px;
        width: 80%;
    }

    .search-form {
        height: 48px;
    }

    .search-input {
        font-size: 16px; /* Exactly 16px is required so iOS Safari doesn't zoom in */
        padding: 0 14px;
    }

    .search-submit {
        width: 44px;
        font-size: 16px;
    }

    /* Keep Card Horizontally Compact & Clean */
    .result-card-main {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .result-thumb-wrap {
        width: 88px;
        height: 58px;
        border-radius: 4px;
        flex-shrink: 0;
    }

    .result-title {
        font-size: 13px;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        line-height: 1.35;
        margin-bottom: 2px;
    }

    .result-meta {
        font-size: 10.5px;
        margin-bottom: 5px;
        gap: 6px;
    }

    /* 3 Action Buttons Perfectly Proportioned: Download Now (Lebar) | Download (Sedang) | Play (Kecil) */
    .result-actions {
        display: grid;
        grid-template-columns: 1.28fr 1.05fr 0.75fr;
        width: 100%;
        gap: 4px;
    }

    .btn-action {
        font-size: 10.5px;
        padding: 6px 2px;
        width: 100%;
        justify-content: center;
        text-align: center;
        gap: 3px;
        white-space: nowrap;
        min-width: 0;
        box-sizing: border-box;
    }

    .btn-action span {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        letter-spacing: -0.2px;
    }

    .btn-action i {
        font-size: 10px;
        flex-shrink: 0;
    }

    .download-panel {
        padding: 12px 10px;
    }

    .servers-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .btn-server {
        padding: 11px 14px;
    }

    .converter-frame {
        height: 450px;
    }

    .seo-section h1 {
        font-size: 18px;
    }
}


