/* Sheet Music page styles */

/* ——— Shared page box (mirrors chords-page-box) ——— */
.sheets-page-box {
  padding: 2rem 2.5rem;
  max-width: 100%;
  box-sizing: border-box;
  width: min(1440px, calc(100vw - 80px));
  max-width: 1440px;
  margin: 24px auto;
}

/* ——— Library listing ——— */
.sheets-wrap {
  width: 100%;
  max-width: 1600px;
  margin: 0 auto;
}

.sheets-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.sheets-header h2 {
  margin: 0;
  color: #00ff9d;
  text-shadow: 0 0 15px rgba(0, 255, 157, 0.6);
}

.sheets-header-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* ——— Filter bar ——— */
.sheets-filters {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.sheets-filters input[type="text"],
.sheets-filters input[type="number"] {
  background: rgba(0, 255, 157, 0.1);
  border: 2px solid rgba(0, 255, 157, 0.4);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 50px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s;
}

.sheets-filters input[type="text"] {
  flex: 1 1 200px;
  min-width: 140px;
}

.sheets-filters input[type="number"] {
  width: 120px;
}

.sheets-filters input:focus {
  border-color: #00ff9d;
  box-shadow: 0 0 16px rgba(0, 255, 157, 0.35);
}

.sheets-filters select {
  background: rgba(0, 255, 157, 0.1);
  border: 2px solid rgba(0, 255, 157, 0.4);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 50px;
  font-size: 0.95rem;
  outline: none;
  cursor: pointer;
  min-width: 120px;
}

.sheets-filters select option,
.sheets-filters select optgroup {
  background: #1a1a2e;
  color: white;
}

.sheets-filters button {
  background: #00ff9d;
  color: #000;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 50px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s;
}

.sheets-filters button:hover {
  background: #00cc7a;
}

.filter-clear {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  font-size: 0.9rem;
  white-space: nowrap;
}

/* ——— Listing rows ——— */
.sheets-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.letter-section {
  font-size: 1.4rem;
  font-weight: bold;
  color: #00ff9d;
  padding: 1.2rem 0 0.4rem 0.2rem;
  border-bottom: 1px solid rgba(0, 255, 157, 0.15);
  margin-top: 0.5rem;
  text-shadow: 0 0 8px rgba(0, 255, 157, 0.4);
}

.letter-section:first-child {
  margin-top: 0;
  padding-top: 0.5rem;
}

.sheet-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 1rem;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  text-decoration: none;
  color: white;
  transition: background 0.2s;
  gap: 1rem;
}

.sheet-row:hover {
  background: rgba(0, 255, 157, 0.1);
}

.sheet-row-title {
  font-weight: 600;
  font-size: 1.05rem;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-row-composer {
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.9rem;
  font-style: italic;
  margin-left: 0.5rem;
}

.sheet-row-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 255, 157, 0.15);
  color: #00ff9d;
  font-size: 0.75rem;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-right: 0.4rem;
  flex-shrink: 0;
}

.sheet-row-details {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sheet-row-tag {
  display: inline-block;
  background: rgba(0, 255, 157, 0.15);
  border: 1px solid rgba(0, 255, 157, 0.45);
  color: #00ff9d;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: bold;
  white-space: nowrap;
}

.sheet-row-style {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.8);
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.empty-state {
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
  padding: 3rem 1rem;
}

.empty-state i {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

/* ——— Buttons (same as chords) ——— */
.btn-primary-glow {
  background: #00ff9d;
  color: #000;
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.45);
}

.btn-primary-glow:hover {
  background: #00cc7a;
  transform: translateY(-1px);
}

.btn-secondary-glow {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.4);
  padding: 12px 24px;
  border-radius: 50px;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-secondary-glow:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: #00ff9d;
}

.btn-danger {
  background: transparent;
  color: #ff3366;
  border: 2px solid #ff3366;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: bold;
  text-decoration: none;
  display: inline-block;
  transition: all 0.2s;
  cursor: pointer;
}

.btn-danger:hover {
  background: #ff3366;
  color: #fff;
  box-shadow: 0 0 20px rgba(255, 51, 102, 0.5);
}

/* ——— Sheet view page ——— */
.sv-wrap {
  width: 100%;
  margin: 0 auto;
}

.sheet-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.sv-title {
  font-size: 2rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 0.25rem;
  font-family: 'Georgia', serif;
}

.sv-composer {
  color: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  font-style: italic;
}

.sv-meta {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin: 0.75rem 0;
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.95rem;
}

.sv-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

/* ——— Stacked page images ——— */
.sheet-pages {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.sheet-page {
  width: 100%;
  max-width: 900px;
}

.sheet-img {
  max-width: 100%;
  height: auto;
  display: block;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.18);
  border-radius: 4px;
  background: white;
}

/* ——— PDF embeds ——— */
.sheet-page--pdf {
  width: 100%;
  max-width: 900px;
}

.sheet-pdf {
  width: 100%;
  height: 85vh;
  border: none;
  border-radius: 4px;
  background: #fff;
}

/* ——— Fixed page navigation button ——— */
.page-nav-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  background: #00ff9d;
  color: #000;
  border: none;
  padding: 10px 18px;
  border-radius: 50px;
  font-weight: bold;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 0 14px rgba(0, 255, 157, 0.45);
  transition: all 0.2s;
}

.page-nav-btn:hover {
  background: #00cc7a;
  transform: translateY(-1px);
}

.page-nav-hint {
  position: fixed;
  bottom: 68px;
  right: 24px;
  z-index: 100;
  color: rgba(255, 255, 255, 0.5);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
}

/* ——— Upload / Edit form ——— */
.upload-wrap {
  width: 100%;
  margin: 0 auto;
}

.upload-wrap h2 {
  color: #00ff9d;
  text-shadow: 0 0 15px rgba(0, 255, 157, 0.6);
  margin-bottom: 1.5rem;
}

.upload-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.upload-form .form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.upload-form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
  min-width: 140px;
}

.upload-form label {
  color: rgba(255, 255, 255, 0.8);
  font-weight: 600;
  font-size: 0.95rem;
}

.upload-form input[type="text"],
.upload-form select {
  background: rgba(0, 255, 157, 0.08);
  border: 2px solid rgba(0, 255, 157, 0.35);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.2s;
}

.upload-form select option,
.upload-form select optgroup {
  background: #1a1a2e;
  color: white;
}

.upload-form input[type="text"]:focus,
.upload-form select:focus {
  border-color: #00ff9d;
  box-shadow: 0 0 10px rgba(0, 255, 157, 0.2);
}

.upload-form input[type="file"] {
  background: rgba(0, 255, 157, 0.08);
  border: 2px dashed rgba(0, 255, 157, 0.4);
  color: white;
  padding: 1.5rem;
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.upload-form input[type="file"]:hover {
  border-color: #00ff9d;
}

.upload-helper-text {
  color: rgba(255, 255, 255, 0.45);
  font-size: 0.85rem;
  margin-top: 0.25rem;
}

.upload-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* ——— Drag-to-reorder file list ——— */
.drag-list {
  margin-top: 0.5rem;
}

.drag-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  margin-bottom: 4px;
  cursor: grab;
  transition: opacity 0.2s, background 0.2s;
  user-select: none;
}

.drag-item:hover {
  background: rgba(0, 255, 157, 0.08);
}

.drag-item.dragging {
  opacity: 0.4;
}

.drag-handle {
  color: rgba(255, 255, 255, 0.35);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.drag-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 4px;
  background: white;
  flex-shrink: 0;
}

.drag-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.9rem;
}

.drag-page-num {
  color: #00ff9d;
  font-weight: bold;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ——— Replace section (edit page) ——— */
.replace-section {
  margin-top: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0;
}

.replace-section summary {
  cursor: pointer;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 600;
  padding: 0.75rem 1rem;
  transition: color 0.2s;
}

.replace-section summary:hover {
  color: #00ff9d;
}

.replace-inner {
  padding: 0 1rem 1rem;
}

.replace-warning {
  color: #ffaa00;
  font-size: 0.9rem;
  margin-bottom: 0.75rem;
}

.replace-warning i {
  margin-right: 0.3rem;
}

/* ——— Print styles ——— */
@media print {
  body * { visibility: hidden; }
  .sheet-header, .sheet-header *,
  .sheet-pages, .sheet-pages * {
    visibility: visible;
  }
  .sheet-header {
    page-break-after: avoid;
    position: relative;
    color: #000 !important;
    text-shadow: none !important;
  }
  .sheet-header .sv-title { color: #000 !important; }
  .sheet-header .sv-composer { color: #333 !important; }
  .sheet-header .sv-meta span { color: #333 !important; }
  .sheet-pages {
    position: absolute;
    left: 0; top: 0;
    width: 100%;
  }
  .sheet-page {
    page-break-after: always;
    max-width: 100%;
  }
  .sheet-img {
    box-shadow: none;
    border-radius: 0;
  }
  .sv-actions, .page-nav-btn, .page-nav-hint,
  nav, .navbar, .area > .snow {
    display: none !important;
  }
}

/* ——— Mobile responsive ——— */
@media (max-width: 768px) {
  .sheets-page-box {
    padding: 1rem;
    width: calc(100vw - 20px);
    margin: 12px auto;
  }

  .sheets-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .sheets-filters {
    flex-direction: column;
    align-items: stretch;
  }

  .sheets-filters input[type="text"],
  .sheets-filters select,
  .sheets-filters input[type="number"] {
    width: 100%;
    min-width: unset;
  }

  .sheet-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.3rem;
  }

  .sheet-row-details {
    justify-content: flex-start;
  }

  .upload-form .form-row {
    flex-direction: column;
  }

  .page-nav-hint {
    display: none;
  }

  .page-nav-btn {
    bottom: 16px;
    right: 16px;
  }
}
