/*
Theme Name: LyricPro
Theme URI: https://example.com/lyricpro
Author: Your Name
Author URI: https://example.com
Description: A clean and modern music-focused WordPress theme.
Version: 1.0.0
Text Domain: lyricpro
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
*/

/* Font is loaded via preload in header.php for better performance */

:root {
  --primary-color: #6C5CE7;
  --accent-color: #00B894;
  --bg-color: #F9F9F9;
  --text-color: #2D3436;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Lazy loaded images */
img {
  max-width: 100%;
  height: auto;
}

img[data-src] {
  opacity: 0;
  transition: opacity 0.3s;
}

img.loaded {
  opacity: 1;
}

/* Ensure emoji display with system fonts (offline-friendly) */
h2, h3, .lp-block__title, .lp-widget__title {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', sans-serif;
}

/* Force color emoji rendering */
.lp-title-icon,
.lp-term-icon,
.emoji {
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Android Emoji', sans-serif;
  font-style: normal;
  font-weight: normal;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Icon wrapper */
.lp-title-icon, .lp-meta-icon {
  font-style: normal;
  display: inline-block;
  font-size: 1.2em;
  line-height: 1;
  vertical-align: middle;
  margin-right: 4px;
}

.lp-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 20px;
}

.lp-entry {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.lp-entry:last-of-type {
  border-bottom: none;
}

.lp-entry__title {
  margin: 0 0 8px;
  font-size: 1.6rem;
}

.lp-entry__title a {
  color: var(--text-color);
  text-decoration: none;
}

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

.lp-meta {
  font-size: 0.9rem;
  color: #636e72;
  margin-bottom: 12px;
}

.lp-content {
  line-height: 1.7;
}

.lp-single__title,
.lp-page__title,
.lp-archive__title {
  margin: 0 0 12px;
  font-size: 2rem;
  color: var(--text-color);
}

.lp-single__content,
.lp-page__content {
  line-height: 1.8;
}

.lp-page-links,
.lp-post-nav {
  margin-top: 20px;
}

.lp-archive__description {
  margin: 0 0 24px;
  color: #636e72;
}

/* Archive Header */
.lp-archive__header {
  background: #fff;
  border-radius: 12px;
  padding: 30px;
  margin-bottom: 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  border-left: 5px solid var(--primary-color);
}

.lp-archive__title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin: 0 0 15px;
}

.lp-archive__title .lp-title-icon {
  font-size: 2.5rem;
}

.lp-archive__description {
  font-size: 1rem;
  line-height: 1.6;
  color: #636e72;
  margin: 0 0 15px;
}

.lp-archive__count {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color) 0%, #5f4dd6 100%);
  color: #fff;
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* No Results */
.lp-no-results {
  background: #fff;
  border-radius: 12px;
  padding: 60px 30px;
  text-align: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.lp-no-results p {
  font-size: 1.1rem;
  color: #636e72;
  margin: 0;
}

/* Pagination */
.lp-pagination {
  margin-top: 40px;
  padding: 30px 0;
}

.lp-pagination .nav-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lp-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 45px;
  height: 45px;
  padding: 0 15px;
  background: #fff;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lp-pagination .page-numbers:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(118, 78, 255, 0.3);
}

.lp-pagination .page-numbers.current {
  background: var(--primary-color);
  color: #fff;
  box-shadow: 0 4px 12px rgba(118, 78, 255, 0.3);
}

.lp-pagination .page-numbers.dots {
  background: transparent;
  box-shadow: none;
  cursor: default;
}

.lp-pagination .page-numbers.dots:hover {
  background: transparent;
  transform: none;
}

.lp-pagination .prev,
.lp-pagination .next {
  background: var(--primary-color);
  color: #fff;
}

.lp-pagination .prev:hover,
.lp-pagination .next:hover {
  background: #5f4dd6;
}

.lp-404__title {
  font-size: 2rem;
  margin: 0 0 12px;
}

/* ============================================
   Homepage Layout với Sidebar
   ============================================ */

.lp-layout {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  align-items: start;
}

@media (max-width: 992px) {
  .lp-layout {
    grid-template-columns: 1fr;
  }

  .lp-sidebar--left {
    order: 2;
  }

  .lp-main {
    order: 1;
  }
}

/* ============================================
   Sidebar Styles
   ============================================ */

.lp-sidebar {
  position: sticky;
  top: 20px;
}

.lp-widget {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.lp-widget__title {
  margin: 0 0 16px;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-color);
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary-color);
}

/* Term List (Genres & Artists) */
.lp-term-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.lp-term-list--scrollable {
  max-height: 400px;
  overflow-y: auto;
  padding-right: 8px;
}

.lp-term-list--scrollable::-webkit-scrollbar {
  width: 6px;
}

.lp-term-list--scrollable::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.lp-term-list--scrollable::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 10px;
}

.lp-term-list--scrollable::-webkit-scrollbar-thumb:hover {
  background: #5f4dd6;
}

.lp-term-list__item {
  margin-bottom: 8px;
}

.lp-term-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  color: var(--text-color);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.2s ease;
  font-weight: 500;
}

.lp-term-link:hover {
  background: var(--primary-color);
  color: #fff;
  transform: translateX(4px);
}

.lp-term-icon {
  font-size: 1.2rem;
  line-height: 1;
  flex-shrink: 0;
  display: inline-block;
  transition: transform 0.2s ease;
}

.lp-term-link:hover .lp-term-icon {
  transform: scale(1.2);
}

.lp-term-name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-term-count {
  font-size: 0.85rem;
  opacity: 0.7;
  flex-shrink: 0;
  margin-left: auto;
}

.lp-no-terms {
  color: #636e72;
  font-size: 0.9rem;
  padding: 10px;
}

/* Search Form */
.lp-search-form {
  display: flex;
  gap: 8px;
}

.lp-search-form__input {
  flex: 1;
  padding: 10px 14px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: border-color 0.2s ease;
}

.lp-search-form__input:focus {
  outline: none;
  border-color: var(--primary-color);
}

.lp-search-form__button {
  padding: 10px 20px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}

.lp-search-form__button:hover {
  background: #5f4dd6;
}

/* Song Mini List (Latest & Popular) */
.lp-song-mini-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.lp-song-mini {
  position: relative;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 6px;
  border-left: 3px solid var(--primary-color);
  transition: all 0.3s ease;
}

.lp-song-mini:hover {
  background: #e9ecef;
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(118, 78, 255, 0.15);
}

.lp-song-mini__link {
  text-decoration: none;
  color: inherit;
  display: block;
}

/* Simple link style (title only) */
.lp-song-mini__link--simple {
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.4;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.lp-song-mini:hover .lp-song-mini__link--simple {
  color: var(--primary-color);
}

/* Old title style (keep for compatibility) */
.lp-song-mini__title {
  margin: 0 0 6px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-color);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lp-song-mini:hover .lp-song-mini__title {
  color: var(--primary-color);
}

.lp-song-mini__artist {
  margin: 0 0 4px;
  font-size: 0.8rem;
  color: #666;
  display: flex;
  align-items: center;
  gap: 4px;
}

.lp-song-mini__views {
  margin: 0;
  font-size: 0.75rem;
  color: #999;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Popular Songs with Rank */
.lp-song-mini--popular {
  padding-left: 32px;
}

.lp-song-mini__rank {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary-color) 0%, #5f4dd6 100%);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(118, 78, 255, 0.3);
}

/* Simple rank (smaller, text-based) */
.lp-song-mini__rank--simple {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--primary-color);
  font-weight: 700;
  font-size: 0.85rem;
}

.lp-song-mini--popular:nth-child(1) .lp-song-mini__rank {
  background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
  box-shadow: 0 2px 6px rgba(255, 215, 0, 0.4);
}

.lp-song-mini--popular:nth-child(1) .lp-song-mini__rank--simple {
  color: #FFA500;
}

.lp-song-mini--popular:nth-child(2) .lp-song-mini__rank {
  background: linear-gradient(135deg, #C0C0C0 0%, #808080 100%);
  box-shadow: 0 2px 6px rgba(192, 192, 192, 0.4);
}

.lp-song-mini--popular:nth-child(2) .lp-song-mini__rank--simple {
  color: #808080;
}

.lp-song-mini--popular:nth-child(3) .lp-song-mini__rank {
  background: linear-gradient(135deg, #CD7F32 0%, #8B4513 100%);
  box-shadow: 0 2px 6px rgba(205, 127, 50, 0.4);
}

.lp-song-mini--popular:nth-child(3) .lp-song-mini__rank--simple {
  color: #CD7F32;
}

/* View count display in popular songs */
.lp-song-mini--popular {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-song-mini--popular .lp-song-mini__views {
  font-size: 0.75rem;
  color: #636e72;
  margin-left: auto;
  white-space: nowrap;
}

.lp-no-songs {
  color: #999;
  font-size: 0.9rem;
  text-align: center;
  padding: 20px;
}

/* ============================================
   Block Sections
   ============================================ */

.lp-block {
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.lp-block__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 3px solid var(--primary-color);
}

.lp-block__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-color);
}

.lp-block__view-all {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.lp-block__view-all:hover {
  color: #5f4dd6;
  text-decoration: underline;
}

/* ============================================
   Songs List Layout (Full Width)
   ============================================ */

.lp-songs-grid {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.lp-songs-grid--4col,
.lp-songs-grid--5col {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.lp-no-results {
  text-align: center;
  color: #636e72;
  padding: 40px 20px;
  font-size: 1rem;
}

/* ============================================
   Song List Item (Full Width, No Card Style)
   ============================================ */

.lp-song-item {
  width: 100%;
  padding: 20px 0;
  transition: all 0.2s ease;
}

.lp-song-item:hover {
  background: rgba(108, 92, 231, 0.02);
  padding-left: 10px;
  padding-right: 10px;
}

/* HR Separator */
.lp-song-separator {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 0;
}

.lp-song-separator:last-of-type {
  display: none;
}

/* Dòng 1: Title */
.lp-song-item__title {
  margin: 0 0 12px;
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.4;
}

.lp-song-item__title-link {
  color: var(--text-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

.lp-song-item__title-link:hover {
  color: var(--primary-color);
}

/* Dòng 2: Meta (Tác giả - Ca sĩ - Danh mục) */
.lp-song-item__meta {
  font-size: 0.9rem;
  color: #636e72;
  margin-bottom: 12px;
  line-height: 1.6;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}

.lp-song-item__author,
.lp-song-item__artist,
.lp-song-item__genre {
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lp-song-item__separator {
  margin: 0 4px;
  opacity: 0.5;
  flex-shrink: 0;
}

/* Term links (Ca sĩ & Thể loại) */
.lp-song-item__meta .lp-term-link {
  color: var(--primary-color);
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid transparent;
  white-space: nowrap;
}

.lp-song-item__meta .lp-term-link:hover {
  color: #5f4dd6;
  border-bottom-color: #5f4dd6;
}

/* More indicator (+1, +2) cho ca sĩ/thể loại */
.lp-more-indicator {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  margin-left: 4px;
  font-size: 0.75em;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-color) 0%, #5f4dd6 100%);
  border-radius: 10px;
  cursor: help;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.lp-more-indicator:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(118, 78, 255, 0.3);
}

/* Mobile: Cho phép wrap */
@media (max-width: 768px) {
  .lp-song-item__meta {
    flex-wrap: wrap;
  }
}

/* Dòng 3: Excerpt */
.lp-song-item__excerpt {
  font-size: 0.95rem;
  line-height: 1.7;
  color: #555;
  margin-bottom: 16px;
  text-align: justify;
}

/* Dòng 4: Footer với button */
.lp-song-item__footer {
  display: flex;
  justify-content: flex-end;
}

.lp-song-item__button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s ease;
}

.lp-song-item__button:hover {
  background: #5f4dd6;
  transform: translateX(3px);
  box-shadow: 0 2px 8px rgba(108, 92, 231, 0.3);
}

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 576px) {
  .lp-layout {
    padding: 15px;
  }

  .lp-block {
    padding: 16px;
  }

  .lp-block__title {
    font-size: 1.2rem;
  }
  
  /* Song list mobile adjustments */
  .lp-song-item {
    padding: 16px 0;
  }
  
  .lp-song-item__title {
    font-size: 1.05rem;
  }
  
  .lp-song-item__meta {
    font-size: 0.85rem;
  }
  
  .lp-song-item__excerpt {
    font-size: 0.9rem;
  }
  
  .lp-song-item__button {
    font-size: 0.9rem;
    padding: 8px 20px;
  }
}
