/*
Theme Name: mp3xa — Modern Edition
Theme URI: https://mp3xa.org/
Author: mp3xa
Author URI: https://mp3xa.org/
Description: Современная быстрая тема WordPress для музыкального портала. Слушайте онлайн, находите песни, альбомы и исполнителей, скачивайте MP3. Полный редизайн с тёмным интерфейсом.
Tags: музыка, песни, скачивание песен, MP3, музыкальный сайт, dark, modern
Version: 2.0.0
Requires at least: 5.0
Tested up to: 6.6
Requires PHP: 8.0
License: MIT License
License URI: https://mp3xa.org/
Text Domain: mp3xa
*/

/* ========================================================= */
/* --- Design Tokens & Reset                                 */
/* ========================================================= */
:root {
    --bg: #0b0b10;
    --bg-elevated: #16161f;
    --bg-card: #1c1c28;
    --bg-hover: #252533;
    --text: #f4f4f8;
    --text-muted: #9b9bb0;
    --accent: #7c5cff;
    --accent-hover: #9b7fff;
    --accent-soft: rgba(124, 92, 255, 0.15);
    --success: #22c55e;
    --border: rgba(255, 255, 255, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

html.wp-toolbar { padding-top: 32px !important; }
@media screen and (max-width: 782px) {
    html.wp-toolbar { padding-top: 46px !important; }
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, textarea {
    font-family: inherit;
}

/* ========================================================= */
/* --- Layout                                                */
/* ========================================================= */
.pw-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

.pw-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    margin-top: 24px;
}

@media (max-width: 1024px) {
    .pw-layout {
        grid-template-columns: 1fr;
    }
    .pw-sidebar {
        order: 2;
    }
}

.pw-main {
    min-width: 0;
}

/* ========================================================= */
/* --- Header                                                */
/* ========================================================= */
.site-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(11, 11, 16, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    padding: 12px 0;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-logo a {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.5px;
    color: var(--text);
}

.logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.header-search {
    flex: 1;
    max-width: 520px;
}

.search-form {
    display: flex;
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: 999px;
    overflow: hidden;
    transition: var(--transition);
}

.search-form:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-field {
    flex: 1;
    background: transparent;
    border: none;
    padding: 12px 20px;
    color: var(--text);
    font-size: 15px;
    outline: none;
}

.search-field::placeholder {
    color: var(--text-muted);
}

.search-submit {
    background: var(--accent);
    border: none;
    color: white;
    padding: 0 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.search-submit:hover {
    background: var(--accent-hover);
}

.main-navigation .nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.nav-menu a {
    display: block;
    padding: 8px 14px;
    border-radius: 999px;
    font-weight: 500;
    font-size: 14px;
    color: var(--text-muted);
    transition: var(--transition);
}

.nav-menu a:hover,
.nav-menu .current-menu-item a {
    color: var(--text);
    background: var(--bg-hover);
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}

.mobile-menu-toggle .hamburger {
    width: 24px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: var(--transition);
}

/* ========================================================= */
/* --- Mobile Sidebar                                        */
/* ========================================================= */
.mobile-sidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--bg-elevated);
    z-index: 10000;
    transition: left 0.3s ease;
    overflow-y: auto;
    padding: 20px;
    border-right: 1px solid var(--border);
}

.mobile-sidebar.open {
    left: 0;
}

.sidebar-header {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.close-sidebar {
    background: var(--bg-hover);
    border: none;
    color: var(--text);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
}

.mobile-nav-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-nav-menu a {
    display: block;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
    font-size: 16px;
    font-weight: 500;
}

#sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s;
}

#sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ========================================================= */
/* --- Hero / Intro                                          */
/* ========================================================= */
.hero-section {
    margin: 32px 0 40px;
    background: linear-gradient(135deg, #1a1030 0%, #0f172a 50%, #0b0b10 100%);
    border-radius: 24px;
    padding: 48px 40px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.hero-section::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -20%;
    width: 60%;
    height: 200%;
    background: radial-gradient(circle, rgba(124, 92, 255, 0.25) 0%, transparent 70%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 640px;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    line-height: 1.1;
    margin: 0 0 16px;
    letter-spacing: -1px;
    background: linear-gradient(90deg, #fff 0%, #c4b5fd 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin: 0 0 20px;
    max-width: 520px;
}

.hero-note {
    font-size: 13px;
    color: var(--text-muted);
    opacity: 0.8;
}

/* ========================================================= */
/* --- Sections & Cards                                      */
/* ========================================================= */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 32px 0 16px;
}

.section-heading,
.song-box-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: -0.3px;
}

.view-all-btn {
    color: var(--accent);
    font-weight: 600;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: 999px;
    transition: var(--transition);
}

.view-all-btn:hover {
    background: var(--accent-soft);
}

/* Horizontal scroll carousels for modern feel */
.songs_cards,
.album-grid,
.artist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

@media (min-width: 768px) {
    .songs_cards.horizontal {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        gap: 16px;
        padding-bottom: 12px;
        scrollbar-width: thin;
        scrollbar-color: var(--accent) transparent;
    }
    .songs_cards.horizontal .card {
        flex: 0 0 200px;
        scroll-snap-align: start;
    }
}

.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
    position: relative;
    border: 1px solid transparent;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: var(--border);
}

.card .img {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    background: var(--bg-elevated);
}

.card .img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.card:hover .img img {
    transform: scale(1.06);
}

.card .img::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.card:hover .img::after {
    opacity: 1;
}

.card .play-overlay {
    position: absolute;
    bottom: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    background: var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    opacity: 0;
    transform: translateY(8px);
    transition: var(--transition);
    z-index: 2;
    box-shadow: 0 4px 12px rgba(124, 92, 255, 0.4);
}

.card:hover .play-overlay {
    opacity: 1;
    transform: translateY(0);
}

.card .title {
    padding: 12px 14px 16px;
}

.card .title p,
.card .title .song-name {
    margin: 0;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card .title .artist-name {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
}

/* ========================================================= */
/* --- Single Song Page                                      */
/* ========================================================= */
.song-article {
    background: var(--bg-elevated);
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.song-details-box {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    padding: 32px;
}

@media (max-width: 768px) {
    .song-details-box {
        grid-template-columns: 1fr;
        padding: 20px;
    }
}

.song-image {
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.song-image img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
}

.song-info h3 {
    margin: 0 0 20px;
    font-size: 1.8rem;
    font-weight: 700;
}

.song-meta-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 24px;
}

.song-meta-table td {
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.song-meta-table td:first-child {
    width: 140px;
    color: var(--text-muted);
    font-weight: 500;
    font-size: 14px;
}

.audio-player-wrapper {
    margin: 20px 0;
}

.audio-player-wrapper audio {
    width: 100%;
    height: 48px;
    border-radius: 12px;
    background: var(--bg-card);
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
}

.dl-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--accent);
    color: white;
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
}

.dl-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.song-description-box {
    padding: 0 32px 32px;
    color: var(--text-muted);
    line-height: 1.7;
}

.related-songs-section {
    margin-top: 40px;
}

/* ========================================================= */
/* --- Breadcrumbs                                           */
/* ========================================================= */
.pw-breadcrumb {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.pw-breadcrumb a {
    color: var(--text-muted);
}

.pw-breadcrumb a:hover {
    color: var(--accent);
}

/* ========================================================= */
/* --- Sidebar                                               */
/* ========================================================= */
.pw-sidebar .sidebar-widget {
    background: var(--bg-elevated);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border);
}

.widget-heading {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 16px;
}

.widget-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.widget-list li {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}

.widget-list li:last-child {
    border-bottom: none;
}

.play-btn {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    background: var(--bg-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
    color: var(--text);
}

.play-btn:hover {
    background: var(--accent);
    color: white;
}

.widget-list .song-info a {
    font-weight: 500;
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}

.widget-list .meta {
    font-size: 12px;
    color: var(--text-muted);
}

/* ========================================================= */
/* --- Pagination                                            */
/* ========================================================= */
.pw-pagination {
    margin: 32px 0;
    text-align: center;
}

.pw-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0 4px;
    border-radius: 10px;
    background: var(--bg-elevated);
    color: var(--text);
    font-weight: 500;
    transition: var(--transition);
}

.pw-pagination .page-numbers:hover,
.pw-pagination .page-numbers.current {
    background: var(--accent);
    color: white;
}

/* ========================================================= */
/* --- Footer                                                */
/* ========================================================= */
.site-footer {
    margin-top: 60px;
    padding: 40px 0 30px;
    background: var(--bg-elevated);
    border-top: 1px solid var(--border);
}

.footer-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.footer-copy {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-menu-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 20px;
    flex-wrap: wrap;
}

.footer-menu-list a {
    color: var(--text-muted);
    font-size: 14px;
}

.footer-menu-list a:hover {
    color: var(--text);
}

/* ========================================================= */
/* --- Responsive                                            */
/* ========================================================= */
@media (max-width: 900px) {
    .main-navigation {
        display: none;
    }
    .mobile-menu-toggle {
        display: flex;
    }
    .header-search {
        max-width: none;
    }
    .hero-section {
        padding: 32px 24px;
    }
}

@media (max-width: 640px) {
    .songs_cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    .card .title {
        padding: 10px;
    }
    .card .title p {
        font-size: 13px;
    }
    .pw-container {
        padding: 0 16px;
    }
}

/* Utility */
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }

/* Lazy loading hint */
img[loading="lazy"] {
    background: var(--bg-elevated);
}
