/* =========================== MCP Chords CSS =========================== */
/* Thanh điều khiển chính */
.mcp-controls-bar {
    display: flex;
    flex-wrap: nowrap; /* Ngăn các group xuống dòng */
    align-items: center;
    gap: 12px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    position: sticky;
    top: 10px; /* Thêm chút khoảng cách với mép trên khi dính lại */
    z-index: 1000;
    overflow-x: auto; /* Cho phép cuộn ngang khi không đủ chỗ */
    -webkit-overflow-scrolling: touch; /* Cải thiện trải nghiệm cuộn trên iOS */
}

/* Tùy chỉnh thanh cuộn cho đẹp hơn (trên trình duyệt Webkit) */
.mcp-controls-bar::-webkit-scrollbar {
    height: 6px;
}
.mcp-controls-bar::-webkit-scrollbar-track {
    background: transparent;
}
.mcp-controls-bar::-webkit-scrollbar-thumb {
    background-color: #d1d5db;
    border-radius: 10px;
}

/* Nhóm điều khiển (ví dụ: Tone, Zoom) */
.mcp-control-group {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 999px; /* Tạo hình dạng viên thuốc */
    padding: 5px;
}

/* Nhãn của nhóm (Tone, Zoom) */
.mcp-control-label {
    font-size: 14px;
    font-weight: 500;
    color: #111827;
    display: flex;
    align-items: center;
    white-space: nowrap; /* Ngăn chữ bị xuống dòng */
}

/* Nút chung */
.mcp-control-group button {
    background: #f3f4f6;
    border: none;
    border-radius:100px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
}

.mcp-control-group button:hover {
    background: #e5e7eb;
}

.mcp-control-group button:active {
    background: #d1d5db;
    transform: scale(0.95);
}

/* Các nút tăng/giảm (+, -) */
.mcp-tone-down, .mcp-tone-up,
.mcp-zoom-down, .mcp-zoom-up,
.mcp-scroll-down, .mcp-scroll-up {
    border-radius: 50%; /* Bo tròn */
    width: 28px;
    height: 28px;
    font-size: 16px;
    flex-shrink: 0; /* Ngăn nút bị co lại khi không đủ chỗ */
}

/* Các nút chức năng (Cuộn, Chia cột) */
.mcp-scroll-play, .mcp-columns-toggle {
    border-radius: 999px;
    height: 28px;
    font-size: 14px;
    padding: 0 12px;
    gap: 6px; /* Khoảng cách giữa icon và chữ */
    white-space: nowrap;
}

/* Giá trị hiển thị (C, 100%, 1x) */
.mcp-tone-value, .mcp-zoom-value, .mcp-scroll-value {
    font-size: 14px;
    font-weight: 500;
    min-width: 32px;
    text-align: center;
    color: #111827;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mcp-control-group button{
    margin: 0;
}

/* =========================== Chord list =========================== */
.mcp-chord-list {
  font-family: monospace, monospace;
  white-space: pre-wrap;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 16px;
  line-height: 1.6;
  font-size: 16px;
  overflow-x: auto;
}

/* Hợp âm được bọc span.mcp-chord */
.mcp-chord {
  font-weight: 700;
  color: #2563eb; /* xanh dương */
  margin: 0 2px;
  cursor: pointer;
  transition: color 0.2s ease;
}
.mcp-chord:hover {
  color: #1e40af;
}

/*info */
.play-info{
    max-width: 400px;
    background: #fef8eb;
    border-radius: 10px;
    padding: 12px 6px;
}
.play-info p{
    margin-bottom:2px;
}
/* =========================== Scroll animation =========================== */
.mcp-scroll-active {
  scroll-behavior: smooth;
}

/* =========================== Responsive =========================== */
@media (max-width: 600px) {
  .mcp-controls-bar {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* Layout chia cột */
.mcpchord-content {
  column-count: 1; /* mặc định 1 cột */
  column-gap: 2rem; /* khoảng cách giữa các cột */
}
.mcpchord-content.mcp-columns {
  column-count: 2; /* bật chia 2 cột */
}
@media (max-width: 768px) {
  .mcpchord-content.mcp-columns {
    column-count: 1; /* mobile vẫn hiển thị 1 cột */
  }
}

/* Nút toggle active */
.mcp-columns-toggle.active {
  background: #0073aa;
  color: #fff;
  border-color: #0073aa;
}

/* Fix cho CPT single */
body.single-chord #main-content {
    --wd-col-lg: 1 !important; /* 1 cột */
}

/* =========================== Giao diện trang Hợp âm =========================== */
.main-page-wrapper{
    background-image: url(https://guitarshare.vn/wp-content/uploads/2023/04/wd-furniture-background.jpg);
    background-repeat: repeat;
}

.entry-content{
    font-size: 20px;
    background: #fff;
    border: 1px solid #DFDFDF;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 10px -4px rgba(0,0,0,0.1); /* nhẹ hơn */
}

/* =========================== Extra layout dưới entry-content =========================== */
.mcpchord-extra {
    display: flex;
    gap: 24px;
}

.mcpchord-col-left {
    flex: 2;
}

.mcpchord-col-right {
    flex: 1;
    background: #fff;
    border: 1px solid #DFDFDF;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 10px -4px rgba(0,0,0,0.1);
}

.chord-instruction h2,
.mcpchord-col-right h3 {
    font-size: 20px;
    margin-bottom: 12px;
    border-bottom: 2px solid #eee;
    padding-bottom: 6px;
}

.instruction-content {
    font-size: 16px;
    line-height: 1.6;
}

.related-chords {
    list-style: none;
    padding: 0;
    margin: 0;
}
.related-chords li {
    margin-bottom: 8px;
}
.related-chords a {
    color: #2563eb;
    text-decoration: none;
}
.related-chords a:hover {
    text-decoration: underline;
}

/* Responsive: về 1 cột trên mobile */
@media (max-width: 768px) {
    .mcpchord-extra {
        flex-direction: column;
    }
}

/* Tách riêng Hướng dẫn chi tiết và Thảo luận */
.mcpchord-col-left section {
    background: #fff;
    border: 1px solid #DFDFDF;
    border-radius: 10px;
    padding: 16px;
    box-shadow: 0 4px 10px -4px rgba(0,0,0,0.1);
    margin-bottom: 32px; /* tạo khoảng cách giữa các khối */
}

.mcpchord-col-left section:last-child {
    margin-bottom: 0; /* bỏ khoảng cách cuối cùng */
}

.mcpchord-col-left h2 {
    font-size: 20px;
    margin-bottom: 12px;
    border-bottom: 2px solid #eee;
    padding-bottom: 6px;
}

/* =========================== */
/* Song Info & Version Boxes   */
/* =========================== */

/* Wrapper hai cột */
.song-info-wrapper {
  display: flex;
  flex-wrap: nowrap;
  gap: 20px;
  margin-bottom: 20px;
  /* Đặt align-items thành flex-start để các cột căn chỉnh từ đầu nếu chiều cao khác nhau */
  align-items: flex-start;
}

/* Cột chung */
.song-info-col {
  box-sizing: border-box;
  /* Đảm bảo các cột có thể co lại nếu nội dung quá dài */
  flex-shrink: 1;
}

/* Cột trái: thông tin bài hát inline */
.song-info-col.song-info-left {
  flex: 0 0 50%; /* Đảm bảo chiều rộng 50% */
  display: flex;
  flex-wrap: wrap; /* Cho phép các mục con xuống dòng */
  gap: 12px;
  align-items: center;
  /* Thêm min-width để tránh cột bị co lại quá nhỏ nếu nội dung quá dài không thể xuống dòng hoàn toàn */
  min-width: 0; /* Cho phép flex item co lại dưới kích thước nội dung của nó */
}
.song-info-col.song-info-left p {
  margin: 0;
  /* Xóa white-space: nowrap; để cho phép văn bản xuống dòng */
  white-space: normal;
  /* Đảm bảo từ dài có thể bị ngắt nếu cần thiết */
  word-wrap: break-word;
  overflow-wrap: break-word;
  /* Đặt flex-basis thành auto hoặc một giá trị cố định nếu bạn muốn các đoạn p tự động chiếm không gian */
  flex-basis: auto;
  min-width: 0; /* Quan trọng để p có thể co lại và xuống dòng */
}

/* Cột phải: các box phiên bản */
.song-info-col.song-info-right {
  flex: 0 0 50%; /* Đảm bảo chiều rộng 50% */
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0; /* Cho phép flex item co lại */
}
.song-info-col.song-info-right h3 {
  display: none;
}

/* Các thay đổi cho `version-details` để đảm bảo nội dung bên trong cũng xuống dòng nếu cần */
.version-details {
  display: flex;
  /* Thay đổi flex-wrap từ nowrap thành wrap nếu bạn muốn ca sĩ và tone xuống dòng */
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  min-width: 0; /* Cho phép phần tử này co lại */
}

.version-singers {
  font-size: 14px;
  color: #333;
  /* Cho phép văn bản xuống dòng */
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* =========================== */
/* Responsive: mobile 1 cột    */
/* =========================== */
@media (max-width: 600px) {
  .song-info-wrapper {
    flex-wrap: wrap;
  }
  .song-info-col {
    flex: 0 0 100%;
  }
  .version-box {
    margin-bottom: 8px;
  }
}

/* =========================== */
/* Box phiên bản trình bày     */
/* =========================== */
.version-box {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 6px 10px;
  gap: 8px;
}

/* Nút play nền đỏ */
.version-icon button {
  width: 28px;
  height: 28px;
  background: #e63946;
  color: #fff;
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.version-icon svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Thông tin ca sĩ + tone */
.version-details {
  display: flex;
  gap: 6px;
  align-items: center;
}
.version-tone {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  white-space: nowrap;
}
.version-singers {
  font-size: 14px;
  color: #333;
  white-space: nowrap;
}

/* =========================== */
/* Responsive: mobile 1 cột     */
/* =========================== */
@media (max-width: 600px) {
  .song-info-wrapper {
    flex-wrap: wrap;
  }
  .song-info-col {
    flex: 0 0 100%;
  }
  .version-box {
    margin-bottom: 8px;
  }
}


/* ===================== Cảm âm - Flute styling ===================== */

/* Container flute */
.mcpflute-content {
    column-count: 1;
    column-gap: 2rem;
    margin-bottom: 1.5rem;
}
.mcpflute-content.mcp-columns {
    column-count: 2;
}
@media (max-width: 768px) {
    .mcpflute-content.mcp-columns {
        column-count: 1;
    }
}

/* Dòng lyrics và note */
.flute-line {
    margin: 0.25em 0;
    line-height: 1.5;
}
.flute-line.lyrics {
    font-family: inherit;
}
.flute-line.notes {
    font-family: monospace;
    color: #10b981;  /* Màu emerald green cho note */
}

/* Span note */
.mcp-flute-note {
    font-weight: 700;
    padding: 0 2px;
    cursor: default;
    transition: background 0.2s ease;
}
.mcp-flute-note:hover {
    background: rgba(16, 185, 129, 0.1);
}

body.single-flute #main-content {
    --wd-col-lg: 1 !important; /* 1 cột */
}


/* ===== Item box ==============*/
/* ===== Container 2 cột 70/30 ===== */
.chord-two-columns {
  display: grid;
  grid-template-columns: 70% 30%;
  gap: 2rem;
  margin: 2rem 0;
}

/* ===== Item box – toàn vùng click ===== */
.item-guitarshare-box {
  position: relative;
  background-color: #fff;
  border: 1px solid #eee;
  border-radius: 4px;
  padding: 1rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}

/* layer link trải kín box */
.item-guitarshare-box .box-link {
  position: absolute;
  inset: 0;
  z-index: 1;
  text-indent: -9999px; /* ẩn nội dung text nếu có */
  background: transparent;
}

/* chỉ đẩy lên trước những phần cần click riêng (tiêu đề/link term) */
.chord-title,
.chord-composer,
.chord-singer {
  position: relative;
  z-index: 2;
}

/* ===== Tiêu đề ===== */
.chord-title {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

/* ===== Sáng tác / Ca sĩ mỗi dòng riêng ===== */
.chord-composer,
.chord-singer {
  display: block;
  font-size: 0.95rem;
  color: #555;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.25rem;
}

/* ===== Excerpt (nối liền) ===== */
/* không cần đặt z-index hay vị trí, để nó nằm dưới lớp box-link */
.chord-excerpt-line {
  margin-top: 0.5rem;
  font-size: 0.95rem;
  color: #444;
  line-height: 1.4;
}

/* ===== Pagination (cột MỚI NHẤT) ===== */
.chord-latest .chord-latest-pagination {
  text-align: center;
  margin-top: 1rem;
}
.chord-latest .chord-latest-pagination ul {
  list-style: none;
  padding: 0;
  display: inline-block;
}
.chord-latest .chord-latest-pagination li {
  display: inline;
}
.chord-latest .chord-latest-pagination a,
.chord-latest .chord-latest-pagination span {
  margin: 0 0.25rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid #ddd;
  border-radius: 3px;
  background: #f7f7f7;
  color: #333;
  text-decoration: none;
}
.chord-latest .chord-latest-pagination .current {
  background: #333;
  color: #fff;
  border-color: #333;
}
.chord-latest .chord-latest-pagination a:hover {
  background: #e2e2e2;
}

/* ===== Danh sách HOT ===== */
.chord-hot-list {
  background: #fff;
  border-radius: 6px;
  padding: 1rem;
}
.chord-hot-item {
  position: relative;
  padding: 0.75rem 0;
  border-bottom: 1px dashed #ddd;
}
.chord-hot-item:last-child {
  border-bottom: none;
}
.chord-hot-item h4.chord-title {
  margin: 0 0 0.25rem;
  font-size: 1rem;
}
