/*
Theme Name: MusicPlay - Google Discover Optimized Playlist Theme
Theme URI: https://github.com/mmnoody2006/musicplay-wp-theme
Author: Google AI Studio
Description: قالب وردپرس فوق‌العاده سریع، بهینه‌سازی شده برای گوگل دیسکاور، مخصوص سایت‌های موزیک و پلی‌لیست‌های برچسب‌محور. این قالب تک‌پست‌ها را بر اساس تگ‌ها به صورت پلی‌لیست‌های هوشمند و پیشرفته سازماندهی می‌کند.
Version: 1.1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: musicplay
Tags: music, playlist, audio-player, seo-optimized, google-discover, responsive-layout, dark-mode

This theme is built specifically for lightning-fast speeds, absolute SEO compliance, and complete Google Discover integration.
*/

/* 1. Core Variables & Reset */
:root {
    --primary: #ff2a5f;
    --primary-hover: #e01f4f;
    --background: #f8fafc;
    --surface: #ffffff;
    --surface-hover: #f1f5f9;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --radius-lg: 16px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    background-color: var(--background);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 90px; /* Spacer for sticky audio player */
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, opacity 0.2s ease;
}

a:hover {
    color: var(--primary);
}

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

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 20px;
    padding-left: 20px;
}

/* 2. Header and Navigation */
.site-header {
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 16px 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo a {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    color: var(--primary);
}

.site-navigation ul {
    list-style: none;
    display: flex;
    gap: 24px;
}

.site-navigation a {
    font-weight: 600;
    font-size: 14px;
}

/* 3. Hero Section (Google Discover Bait) */
.hero-section {
    padding: 60px 0;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 42, 95, 0.15) 0%, transparent 60%);
    pointer-events: none;
}

.hero-title {
    font-size: 40px;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -1px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 32px auto;
}

/* 4. Playlists Grid (Home Page) */
.playlists-section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.playlists-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.playlist-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s;
    position: relative;
}

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

.playlist-thumbnail-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 16/9; /* Google Discover Standard Aspect Ratio */
    overflow: hidden;
    background-color: #0b0f19;
}

.playlist-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.playlist-card:hover .playlist-thumbnail {
    transform: scale(1.08);
}

.playlist-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(4px);
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
    border: 1px solid rgba(255, 42, 95, 0.2);
}

.playlist-content {
    padding: 20px;
}

.playlist-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.4;
}

.playlist-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.playlist-tracks-count {
    display: flex;
    align-items: center;
    gap: 4px;
}

.playlist-play-btn {
    background-color: var(--primary);
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    transition: background-color 0.2s, transform 0.2s;
}

.playlist-card:hover .playlist-play-btn {
    background-color: var(--primary-hover);
    transform: scale(1.1);
}

/* 5. Single Post Page (Song Player page) */
.song-layout {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 40px 0;
}

.download-buttons-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    width: 100%;
}

@media (min-width: 768px) {
    .download-buttons-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.song-cover-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    text-align: center;
    height: fit-content;
}

.song-cover-wrapper {
    aspect-ratio: 16/9; /* Perfect for Google Discover and responsive fits */
    border-radius: var(--radius-md);
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
}

.song-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.song-artist {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 12px;
    font-weight: 500;
}

.song-title-main {
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 16px;
    line-height: 1.3;
}

.song-actions-row {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: var(--surface-hover);
    color: var(--text);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background-color: var(--border);
}

/* Web Native Player for Single and Playlist page */
.audio-player-container {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 30px;
}

.custom-player-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.play-toggle-btn {
    background-color: var(--primary);
    color: white;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    font-size: 20px;
    box-shadow: 0 4px 12px rgba(255, 42, 95, 0.3);
    transition: transform 0.2s, background-color 0.2s;
}

.play-toggle-btn:hover {
    transform: scale(1.05);
    background-color: var(--primary-hover);
}

.progress-bar-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.progress-bar {
    flex-grow: 1;
    height: 6px;
    background-color: var(--border);
    border-radius: 3px;
    position: relative;
    cursor: pointer;
}

.progress-filled {
    height: 100%;
    background-color: var(--primary);
    border-radius: 3px;
    width: 0%;
    position: relative;
}

.progress-handle {
    position: absolute;
    top: 50%;
    right: 0%;
    transform: translate(50%, -50%);
    width: 12px;
    height: 12px;
    background-color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.time-display {
    font-size: 12px;
    color: var(--text-muted);
    font-family: monospace;
    min-width: 35px;
}

.volume-control {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100px;
}

.volume-slider {
    width: 100%;
    accent-color: var(--primary);
}

/* Lyrics & Post Content */
.song-details-content {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px;
}

.song-details-stack {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.song-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.tag-badge {
    padding: 8px 16px;
    background-color: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
}

.tag-badge:hover {
    background-color: var(--primary);
    border-color: var(--primary);
    color: white;
}

.section-headline {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
}

.lyrics-container {
    background-color: rgba(15, 23, 42, 0.4);
    border-radius: var(--radius-md);
    padding: 20px;
    font-size: 16px;
    line-height: 2.2;
    text-align: center;
    color: var(--text);
    white-space: pre-line;
    max-height: 400px;
    overflow-y: auto;
    font-weight: 500;
}

/* 6. Tag Playlist Page (Playlist View) */
.playlist-header-details {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 32px 0;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
}

@media (min-width: 768px) {
    .playlist-header-details {
        flex-direction: row;
        align-items: center;
    }
}

.playlist-header-cover {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 16/9; /* Google Discover compatible playlist poster */
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border);
}

.playlist-header-meta {
    flex-grow: 1;
}

.playlist-header-tag {
    display: inline-block;
    color: var(--primary);
    font-weight: 700;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.playlist-header-title {
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 12px;
}

.playlist-header-desc {
    color: var(--text-muted);
    font-size: 15px;
    line-height: 1.6;
}

/* Playlist Tracks List Table */
.tracks-list-container {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.track-row {
    display: flex;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background-color 0.2s;
    user-select: none;
}

.track-row:last-child {
    border-bottom: none;
}

.track-row:hover {
    background-color: var(--surface-hover);
}

.track-row.is-active {
    background-color: rgba(255, 42, 95, 0.1);
    border-right: 3px solid var(--primary);
}

.track-number {
    width: 40px;
    font-size: 14px;
    color: var(--text-muted);
    font-weight: 700;
    display: flex;
    align-items: center;
}

.track-row.is-active .track-number {
    color: var(--primary);
}

.track-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    margin-left: 16px;
    border: 1px solid var(--border);
}

.track-info {
    flex-grow: 1;
}

.track-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.track-row.is-active .track-title {
    color: var(--primary);
}

.track-artist {
    font-size: 13px;
    color: var(--text-muted);
}

.track-duration {
    font-size: 13px;
    color: var(--text-muted);
    font-family: monospace;
    margin-left: 20px;
}

.track-play-status {
    color: var(--primary);
    font-size: 16px;
    opacity: 0;
    transition: opacity 0.2s;
}

.track-row:hover .track-play-status,
.track-row.is-active .track-play-status {
    opacity: 1;
}

/* 7. Bottom Floating Player (Persistent Playlist Player) */
.floating-player {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-top: 1px solid rgba(226, 232, 240, 0.6);
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    z-index: 999;
    box-shadow: 0 -8px 30px rgba(0,0,0,0.06);
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.floating-player.is-visible {
    transform: translateY(0);
}

.floating-track-info {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 25%;
}

.floating-track-cover {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    border: 1px solid var(--border);
}

.floating-track-details {
    overflow: hidden;
}

.floating-track-title {
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-track-artist {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    max-width: 50%;
}

.floating-button-row {
    display: flex;
    align-items: center;
    gap: 16px;
}

.control-btn {
    background: none;
    border: none;
    color: var(--text);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover {
    color: var(--primary);
}

.control-btn:active {
    transform: scale(0.95);
}

.control-btn.btn-play-pause {
    background-color: var(--primary);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.control-btn.btn-play-pause:hover {
    background-color: var(--primary-hover);
    color: white;
}

.floating-progress-container {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
}

.floating-extra-controls {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-end;
    width: 25%;
}

/* Breadcrumbs (SEO schema-friendly) */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumbs a:hover {
    color: var(--primary);
}

.breadcrumbs .separator {
    font-size: 10px;
    opacity: 0.5;
}

/* Footer styling */
.site-footer {
    background-color: #ffffff;
    border-top: 1px solid var(--border);
    padding: 50px 0 30px 0;
    margin-top: 80px;
    color: var(--text-muted);
    font-size: 14px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 32px;
    margin-bottom: 40px;
    text-align: right;
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-col {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-col-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}

.footer-col ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-col li {
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
}

.footer-col li a {
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.footer-col li a:hover {
    color: var(--primary);
}

.footer-bottom {
    border-top: 1px solid var(--border);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    font-size: 12px;
}

@media (min-width: 768px) {
    .footer-bottom {
        flex-direction: row;
    }
}

.footer-logo {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 12px;
}

/* Utilities */
.text-center { text-align: center; }
.mb-4 { margin-bottom: 16px; }
.mb-8 { margin-bottom: 32px; }
.mt-4 { margin-top: 16px; }
.mt-8 { margin-top: 32px; }

/* Responsive adjustments */
@media (max-width: 768px) {
    .site-navigation {
        display: none; /* Can be expanded with a toggler if needed, but keeping it light and SEO-fast */
    }
    .hero-title {
        font-size: 28px;
    }
    .floating-track-info, .floating-extra-controls {
        display: none;
    }
    .floating-controls {
        max-width: 100%;
        width: 100%;
    }
}

/* Emerald green download buttons style */
.btn-emerald-320, .btn-emerald-128 {
    background-color: #10b981 !important;
    color: white !important;
}

.btn-emerald-320:hover, .btn-emerald-128:hover {
    background-color: #059669 !important;
    color: white !important;
    transform: translateY(-1px);
}

/* 8. Comments */
.comments-area .comment {
    background-color: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    list-style: none;
}

.comments-area .comment .children {
    list-style: none;
    margin-top: 16px;
    margin-right: 24px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.comments-area .comment-author {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.comments-area .comment-author .avatar {
    border-radius: 50%;
}

.comments-area .comment-author .fn {
    font-style: normal;
    font-weight: 700;
    font-size: 14px;
}

.comments-area .comment-metadata {
    font-size: 12px;
    color: var(--text-muted);
    margin-right: auto;
}

.comments-area .comment-content p {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text);
}

.comments-area .comment-reply-link {
    font-size: 12px;
    font-weight: 700;
    color: var(--primary);
}

.comment-respond input[type="text"],
.comment-respond input[type="email"],
.comment-respond input[type="url"],
.comment-respond textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 14px;
    background-color: var(--surface);
    color: var(--text);
    margin-bottom: 12px;
}

.comment-respond textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-respond label {
    display: none;
}
