/*
  Audio Hub and audio-edit styles extracted from the original base stylesheet.
*/
/* --- Audio list cards --- */
.audio-card-list { display: flex; flex-direction: column; gap: .6rem; margin-top: 1rem; }
.audio-card {
  background: var(--surface); border: 1px solid var(--border-subtle);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  display: flex; align-items: flex-start; gap: 1rem; padding: 1.1rem 1.25rem;
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
}
.audio-card:hover { box-shadow: var(--shadow); border-color: var(--border); transform: translateY(-1px); }
@media (max-width: 600px) { .audio-card { flex-direction: column; } }
.audio-card-body  { flex: 1; min-width: 0; }
.audio-card-meta  { display: flex; align-items: baseline; gap: .75rem; flex-wrap: wrap; margin-bottom: .25rem; }
.audio-card-title { font-size: .9375rem; font-weight: 600; letter-spacing: -.01em; }
.audio-card-date  { white-space: nowrap; color: var(--text-xmuted); font-size: .78rem; }
.audio-card-desc  { margin-bottom: .5rem; line-height: 1.6; color: var(--text-muted); font-size: .875rem; }
.audio-preview-wrap audio { display: block; width: 100%; max-width: 420px; height: 36px; border-radius: 6px; margin-top: .35rem; }
.audio-card-actions { display: flex; flex-direction: column; gap: .4rem; flex-shrink: 0; }
@media (max-width: 600px) { .audio-card-actions { flex-direction: row; } }
/* --- Header --- */
.ah-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.25rem;
}
.ah-title { font-size: 1.5rem; font-weight: 800; letter-spacing: -.035em; margin: 0 0 .15rem; }
.ah-sub   { font-size: .8125rem; color: var(--text-muted); }

.ah-header-actions { display: flex; flex-direction: row; gap: .5rem; align-items: flex-start; flex-wrap: wrap; }

/* --- Inline folder create form --- */
.ah-new-folder-form {
  background: var(--surface); border: 1.5px solid var(--primary);
  border-radius: var(--radius-sm); padding: .75rem 1rem;
  margin-bottom: 1rem; box-shadow: var(--shadow-sm);
}
.ah-folder-input {
  padding: .45rem .75rem; border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); font-size: .9rem;
  font-family: inherit; min-width: 200px;
  transition: border-color var(--t), box-shadow var(--t);
}
.ah-folder-input:focus { outline: none; border-color: var(--primary); box-shadow: var(--focus-ring); }

/* --- Folder tabs row --- */
.ah-tabs-row {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: 1rem; align-items: center;
}
.ah-tab {
  display: inline-flex; align-items: center; gap: .3rem;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface);
  transition: border-color var(--t), background var(--t), box-shadow var(--t);
  overflow: hidden;
}
.ah-tab:hover { border-color: var(--primary); }
.ah-tab--active {
  border-color: var(--primary); background: var(--primary-light);
}
.ah-tab-label {
  padding: .35rem .85rem .35rem .75rem;
  font-size: .82rem; font-weight: 600; color: var(--text);
  text-decoration: none; white-space: nowrap;
  min-height: 32px; display: flex; align-items: center;
}
.ah-tab--active .ah-tab-label { color: var(--primary); }
.ah-tab-label:hover { color: var(--primary); }
.ah-tab-del {
  background: none; border: none; cursor: pointer;
  color: var(--text-muted); padding: .35rem .5rem .35rem 0;
  display: flex; align-items: center; line-height: 1;
  transition: color var(--t);
  min-height: 32px;
}
.ah-tab-del:hover { color: var(--danger); }

/* --- Folder row (legacy, kept for .ah-folder-badge) --- */
.ah-folder {
  position: relative;
  display: flex; flex-direction: column;
  width: 130px;
}
.ah-folder-tab {
  height: 18px;
  background: var(--accent);
  border-radius: 8px 8px 0 0;
  display: flex; align-items: center; justify-content: flex-end;
  padding-right: .45rem;
}
.ah-folder-label {
  display: block;
  background: var(--accent);
  border-radius: 0 6px 8px 8px;
  padding: .55rem .75rem .6rem;
  font-size: .8125rem; font-weight: 700; color: #0F0F1A;
  text-decoration: none; letter-spacing: -.01em;
  transition: filter var(--t);
  min-height: 48px; display: flex; align-items: center;
}
.ah-folder-label:hover { filter: brightness(.92); }
.ah-folder--active .ah-folder-tab,
.ah-folder--active .ah-folder-label { background: #e8ff50; }
.ah-folder-del {
  background: none; border: none; cursor: pointer; padding: 0;
  color: rgba(0,0,0,.45); line-height: 1;
  transition: color var(--t);
}
.ah-folder-del:hover { color: rgba(0,0,0,.8); }

/* --- Folder cards --- */
.ah-folder-grid { margin-bottom: .7rem; }
.ah-folder-card {
  cursor: default;
  background:
    linear-gradient(145deg, rgba(11,233,206,.12), rgba(255,255,255,.52) 46%, rgba(178,123,255,.14)),
    rgba(255,255,255,.58);
}
.ah-folder-card-thumb {
  min-height: 116px;
  background:
    radial-gradient(circle at 22% 16%, rgba(11,233,206,.22), transparent 36%),
    radial-gradient(circle at 84% 86%, rgba(255,51,153,.16), transparent 38%),
    rgba(255,255,255,.28);
  border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .55rem; padding: 1.05rem .75rem .75rem;
  text-decoration: none;
  overflow: hidden;
  transition: background var(--t), transform var(--t);
}
.ah-folder-card-thumb:hover { background-color: rgba(255,255,255,.42); }
.ah-glyph {
  display: block;
  filter: drop-shadow(0 10px 18px rgba(13,14,16,.12));
}
.ah-folder-glyph {
  color: var(--eb-ink);
}
.ah-audio-glyph {
  color: var(--eb-ink);
}
.ah-folder-card-name {
  display: block; font-size: .86rem; font-weight: 680;
  color: var(--eb-ink); text-decoration: none; letter-spacing: -.025em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ah-folder-card-name:hover { color: var(--eb-pink); }
.ah-folder-rename-form { margin-top: .2rem; }
.ah-folder-rename-input {
  width: 100%; padding: .2rem .4rem;
  border: 1.5px solid var(--primary); border-radius: 5px;
  font-size: .82rem; font-family: inherit;
  box-shadow: var(--focus-ring);
}

/* --- Drag & Drop --- */
.ah-file-card[draggable] { cursor: grab; }
.ah-file-card[draggable]:active { cursor: grabbing; }
.ah-dragging { opacity: .4; }
.ah-drop-hover {
  border-color: var(--primary) !important;
  background: var(--primary-light) !important;
  box-shadow: 0 0 0 3px rgba(91,76,245,.2);
}
.ah-drop-success {
  border-color: #16a34a !important;
  background: #dcfce7 !important;
}

/* --- Toolbar --- */
.ah-toolbar {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: 1rem; flex-wrap: wrap;
}
.ah-toolbar-hint { font-size: .8125rem; color: var(--text-muted); }

/* --- File grid --- */
.ah-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: .72rem;
  margin-bottom: 1.5rem;
}
.ah-file-card {
  background: rgba(255,255,255,.55);
  border: 1px solid rgba(13,14,16,.08);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  overflow: visible;  /* allow details dropdown to escape card bounds */
  display: flex; flex-direction: column;
  transition: box-shadow var(--t), border-color var(--t), transform var(--t);
}
.ah-file-card:hover {
  box-shadow: var(--shadow);
  border-color: rgba(13,14,16,.13);
  transform: translateY(-2px);
}

.ah-file-thumb {
  min-height: 116px;
  background:
    radial-gradient(circle at 26% 18%, rgba(178,123,255,.22), transparent 36%),
    radial-gradient(circle at 80% 82%, rgba(11,233,206,.16), transparent 40%),
    rgba(255,255,255,.3);
  border-radius: 18px 18px 0 0;  /* clip thumb corners instead */
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: .55rem; padding: 1.05rem .75rem .75rem;
  position: relative;
  overflow: hidden;
}
.ah-file-thumb::after,
.ah-folder-card-thumb::after {
  content: "";
  position: absolute;
  right: -34px;
  bottom: -44px;
  width: 96px;
  height: 112px;
  border: 16px solid rgba(255,255,255,.22);
  border-radius: 999px;
  transform: rotate(24deg);
}
.ah-waveform-ring {
  position: relative;
  z-index: 1;
  display: flex; align-items: center; justify-content: center;
}
.ah-file-type {
  position: relative;
  z-index: 1;
  padding: .24rem .58rem;
  border: 1px solid rgba(13,14,16,.08);
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  color: rgba(13,14,16,.55);
  font-size: .62rem; font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase;
}

.ah-file-info {
  padding: .62rem .8rem .42rem;
  flex: 1;
}
.ah-file-name {
  font-size: .86rem; font-weight: 680;
  letter-spacing: -.025em; color: var(--eb-ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ah-file-meta {
  color: var(--eb-muted);
  font-size: .7rem; margin-top: .12rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.ah-file-footer {
  padding: .42rem .58rem .58rem;
  border-top: 1px solid rgba(13,14,16,.06);
  background: rgba(13,14,16,.025);
  border-radius: 0 0 18px 18px;
}
.ah-file-actions-row {
  display: flex; align-items: center; gap: .22rem;
}
.ah-file-actions-row .btn,
.ah-move-details summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  color: rgba(13,14,16,.68);
  background: rgba(255,255,255,.48);
}
.ah-file-actions-row .btn:hover,
.ah-move-details summary:hover {
  color: var(--eb-ink);
  background: rgba(255,255,255,.78);
}
.ah-del-btn { color: var(--text-xmuted); }
.ah-del-btn:hover { background: #FEE2E2; color: var(--danger); }

.ah-folder-badge {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  font-size: .62rem; color: var(--text-muted);
  margin-top: .25rem; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}

.ah-player {
  display: block; width: 100%;
  height: 28px; margin-top: .4rem;
  border-top: 1px solid var(--border-subtle);
}

/* --- Move-to-folder dropdown --- */
.ah-move-details { position: relative; }
.ah-move-details summary { list-style: none; }
.ah-move-details summary::-webkit-details-marker { display: none; }
.ah-move-menu {
  position: absolute; left: 0; top: calc(100% + 4px); z-index: 50;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 140px; overflow: hidden;
}
.ah-move-option {
  display: block; width: 100%;
  padding: .45rem .75rem;
  background: none; border: none;
  text-align: left; font-size: .8rem; font-weight: 500;
  color: var(--text); cursor: pointer;
  transition: background var(--t);
}
.ah-move-option:hover { background: var(--border-subtle); }
.ah-move-option--active { color: var(--primary); font-weight: 700; background: var(--primary-light); }

/* --- Pagination --- */
.ah-pagination {
  display: flex; align-items: center; justify-content: center;
  gap: .4rem; margin-top: .5rem; margin-bottom: 1rem;
}
.ah-pag-btn {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 6px;
  font-size: .82rem; font-weight: 600;
  background: var(--surface); border: 1.5px solid var(--border);
  color: var(--text); cursor: pointer; text-decoration: none;
  transition: background var(--t), border-color var(--t);
}
.ah-pag-btn--active { background: var(--accent); border-color: var(--accent); color: #0F0F1A; }
.ah-pag-btn--disabled { opacity: .4; cursor: default; }
.ah-pag-total { font-size: .78rem; color: var(--text-muted); padding: 0 .4rem; }

/* --- Responsive --- */
@media (max-width: 600px) {
  .ah-grid { grid-template-columns: repeat(2, 1fr); }
  .ah-header-actions { flex-direction: row; }
  .ah-fab { width: auto; flex-direction: row; padding: .5rem .85rem; font-size: .75rem; }
}
/* --- Audio edit workspace --- */
.audio-edit-card {
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
}
.audio-edit-header { margin-bottom: 1.25rem; }
.audio-edit-sub {
  margin-top: .2rem;
  color: var(--text-muted);
  font-size: .875rem;
}
.audio-edit-layout {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}
.audio-edit-preview {
  min-width: 0;
  padding: 1.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.audio-edit-preview-icon { margin-bottom: 1rem; }
.audio-edit-kicker {
  display: block;
  margin-bottom: .25rem;
  color: var(--text-xmuted);
  font-size: .68rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .08em;
}
.audio-edit-filename {
  display: block;
  overflow: hidden;
  margin-bottom: 1.25rem;
  color: var(--text);
  font-size: .875rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.audio-edit-preview audio {
  display: block;
  width: 100%;
  height: 38px;
}
.audio-edit-form {
  min-width: 0;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.audio-edit-form textarea {
  width: 100%;
  min-height: 160px;
  resize: vertical;
}
.audio-edit-upload {
  margin-bottom: 1.25rem;
  padding: 1rem;
  background: var(--bg);
  border: 1px dashed var(--border);
  border-radius: var(--radius-sm);
}
.audio-edit-upload label { margin-bottom: .4rem; }
.audio-edit-upload input[type="file"] {
  width: 100%;
  padding: .45rem;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface);
  color: var(--text-muted);
  font: inherit;
  font-size: .82rem;
}
.audio-edit-upload input[type="file"]::file-selector-button {
  margin-right: .75rem;
  padding: .4rem .7rem;
  border: 1px solid #111318;
  border-radius: 6px;
  background: #111318;
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.audio-edit-upload p {
  color: var(--text-muted);
  font-size: .75rem;
}
@media (max-width: 760px) {
  .audio-edit-card { padding: 1rem; }
  .audio-edit-layout { grid-template-columns: 1fr; }
  .audio-edit-preview,
  .audio-edit-form { padding: 1rem; }
}
