/* MP3Juice - Blue Theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue: #1565C0;
    --blue-dark: #0D47A1;
    --blue-light: #1976D2;
    --blue-bg: #E3F2FD;
    --white: #ffffff;
    --text: #212121;
    --text-light: #757575;
    --border: #e0e0e0;
    --green: #2E7D32;
    --red: #C62828;
    --radius: 8px;
    --shadow: 0 2px 12px rgba(0,0,0,0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--blue);
    color: var(--text);
    min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* NAV */
.nav {
    background: rgba(0,0,0,0.15);
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 900px;
    margin: 0 auto;
}
.nav-logo { color: #fff; font-size: 20px; font-weight: 700; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.nav-links a { color: rgba(255,255,255,0.85); font-size: 14px; margin-left: 16px; text-decoration: none; }
.nav-links a:hover { color: #fff; }

/* HERO */
.hero {
    text-align: center;
    padding: 40px 20px 20px;
    color: #fff;
}
.hero h1 { font-size: 36px; font-weight: 700; letter-spacing: -0.5px; }
.hero p { margin-top: 8px; font-size: 15px; opacity: 0.9; }

/* SEARCH BOX */
.search-wrap {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 16px 30px;
    position: relative;
}
.search-box {
    display: flex;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.2);
}
.search-box input {
    flex: 1;
    padding: 16px 20px;
    font-size: 16px;
    border: none;
    outline: none;
    color: var(--text);
}
.search-box button {
    padding: 16px 28px;
    background: var(--blue-dark);
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background .2s;
}
.search-box button:hover { background: #1a237e; }

/* AUTOCOMPLETE */
.autocomplete {
    position: absolute;
    top: 58px;
    left: 16px;
    right: 16px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 100;
    overflow: hidden;
    display: none;
}
.autocomplete.show { display: block; }
.autocomplete-item {
    padding: 12px 20px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background .15s;
}
.autocomplete-item:hover { background: var(--blue-bg); }
.autocomplete-item svg { opacity: 0.4; flex-shrink: 0; }

/* MAIN CONTENT */
.main {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* RESULTS */
.result-card {
    background: #fff;
    border-radius: var(--radius);
    margin-bottom: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow .2s;
}
.result-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.15); }

.result-header {
    padding: 16px 16px 0;
}
.result-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--blue-dark);
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.result-meta {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 12px;
}

/* PLAYER */
.player-wrap {
    padding: 0 16px 12px;
    display: none;
}
.player-wrap.show { display: block; }
audio {
    width: 100%;
    height: 36px;
    border-radius: 4px;
}

/* ACTIONS */
.result-actions {
    padding: 0 16px 16px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 6px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all .2s; text-decoration: none; }
.btn-mp3 { background: var(--blue-dark); color: #fff; }
.btn-mp3:hover { background: #1a237e; color: #fff; }
.btn-mp4 { background: var(--blue-light); color: #fff; }
.btn-mp4:hover { background: var(--blue); color: #fff; }
.btn-play { background: #fff; color: var(--blue); border: 1.5px solid var(--blue); }
.btn-play:hover { background: var(--blue-bg); }
.btn-loading { opacity: 0.7; cursor: not-allowed; }

/* LOADING */
.loading {
    text-align: center;
    padding: 40px;
    color: #fff;
    font-size: 15px;
}
.spinner {
    width: 36px; height: 36px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* EMPTY / ERROR */
.empty { text-align: center; padding: 40px; color: rgba(255,255,255,0.85); }
.empty h3 { font-size: 18px; margin-bottom: 8px; }

/* INFO BOX */
.info-box {
    background: rgba(255,255,255,0.12);
    border-radius: var(--radius);
    padding: 20px;
    color: rgba(255,255,255,0.9);
    font-size: 14px;
    margin-bottom: 20px;
}
.info-box h3 { margin-bottom: 10px; font-size: 15px; }
.info-box ol { padding-left: 18px; }
.info-box li { margin-bottom: 6px; line-height: 1.5; }

/* DOWNLOAD PAGE */
.download-page { background: #f5f5f5; min-height: 100vh; }
.download-page .nav { max-width: 900px; }
.download-hero {
    background: var(--blue);
    padding: 30px 20px;
    color: #fff;
    text-align: center;
}
.download-hero h1 { font-size: 22px; font-weight: 700; max-width: 700px; margin: 0 auto 8px; }
.download-hero p { font-size: 14px; opacity: 0.85; }

.download-card {
    max-width: 700px;
    margin: 20px auto;
    padding: 0 16px;
}
.download-box {
    background: #fff;
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
}
.download-thumb {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 16px;
}
.download-title { font-size: 18px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.download-meta { font-size: 13px; color: var(--text-light); margin-bottom: 20px; }
.download-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.download-btns .btn { flex: 1; justify-content: center; padding: 14px; font-size: 14px; }

.faq-section { max-width: 700px; margin: 0 auto; padding: 20px 16px 60px; }
.faq-section h2 { font-size: 20px; margin-bottom: 16px; }
.faq-item { background: #fff; border-radius: var(--radius); padding: 16px; margin-bottom: 10px; }
.faq-item h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.faq-item p { font-size: 13px; color: var(--text-light); line-height: 1.6; }

/* FOOTER */
.footer {
    background: rgba(0,0,0,0.2);
    color: rgba(255,255,255,0.7);
    text-align: center;
    padding: 20px;
    font-size: 13px;
}
.footer a { color: rgba(255,255,255,0.7); }

/* ADMIN */
.admin-body { background: #f5f5f5; }
.admin-nav { background: var(--blue-dark); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; }
.admin-nav .logo { color: #fff; font-weight: 700; font-size: 18px; }
.admin-nav a { color: rgba(255,255,255,0.8); font-size: 13px; margin-left: 16px; text-decoration: none; }
.admin-nav a:hover { color: #fff; }
.admin-main { max-width: 900px; margin: 30px auto; padding: 0 20px 60px; }
.admin-grid { display: grid; grid-template-columns: 200px 1fr; gap: 20px; }
.admin-sidebar { background: #fff; border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); height: fit-content; }
.admin-sidebar a { display: block; padding: 10px 12px; border-radius: 6px; font-size: 14px; color: var(--text); margin-bottom: 2px; }
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--blue-bg); color: var(--blue); text-decoration: none; }
.admin-content { background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.admin-content h2 { font-size: 18px; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; color: #555; margin-bottom: 6px; }
.form-group input[type=text],
.form-group input[type=url],
.form-group input[type=password],
.form-group textarea,
.form-group select { width: 100%; padding: 9px 12px; border: 1.5px solid var(--border); border-radius: 6px; font-size: 14px; }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { outline: none; border-color: var(--blue); }
.form-group .hint { font-size: 12px; color: #999; margin-top: 4px; }
.btn-save { background: var(--blue); color: #fff; padding: 10px 24px; border: none; border-radius: 6px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-save:hover { background: var(--blue-dark); }
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: #E8F5E9; color: #2E7D32; }
.alert-error { background: #FFEBEE; color: #C62828; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: var(--blue-bg); border-radius: var(--radius); padding: 16px; text-align: center; }
.stat-card .num { font-size: 28px; font-weight: 700; color: var(--blue); }
.stat-card .label { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { background: #f5f5f5; padding: 10px 12px; text-align: left; font-weight: 600; }
.table td { padding: 10px 12px; border-bottom: 1px solid var(--border); }

@media (max-width: 600px) {
    .hero h1 { font-size: 26px; }
    .admin-grid { grid-template-columns: 1fr; }
    .stat-grid { grid-template-columns: repeat(2, 1fr); }
    .result-actions { gap: 6px; }
    .btn { padding: 8px 12px; font-size: 12px; }
}
