/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Global look & feel improvements */
html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  background: radial-gradient(1200px 600px at 10% 0%, rgba(13,110,253,.06), transparent 60%),
              radial-gradient(1000px 500px at 90% 20%, rgba(32,201,151,.06), transparent 60%),
              #f8f9fb;
}

main.container {
  flex: 1 0 auto;
}

/* Typography tweaks */
h1, h2, h3, h4, h5, h6 {
  letter-spacing: .2px;
}

/* Helper spacing for lists that render items */
.stack-sm > * + * { margin-top: .5rem; }
.stack-md > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 1.5rem; }

/* Tables and forms look a bit nicer with subtle rounding */
.table,
.form-control,
.btn,
.card,
 .alert {
   border-radius: .5rem;
}

/* Footer subtle background fallback if variable not supported */
.bg-light-subtle {
  background-color: rgba(248, 249, 250, 0.7);
}

/* Compact inline audio player */
.file-item-line {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap; /* allow wrap on narrow screens */
}

.file-item-name {
  flex: 0 1 auto;
}

.audio-player {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
}

.audio-player__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.8rem;
  height: 1.8rem;
  line-height: 1;
  border: 1px solid rgba(0,0,0,.15);
  background: #fff;
  border-radius: 999px;
  cursor: pointer;
  font-size: .9rem;
  padding: 0;
}

.audio-player__btn:hover {
  background: #f3f4f6;
}

.audio-player__progress {
  appearance: none;
  -webkit-appearance: none;
  height: .35rem;
  background: #e5e7eb;
  border-radius: 999px;
  outline: none;
  width: clamp(120px, 24vw, 260px); /* compact on large screens */
}

/* Chrome/Safari slider styling */
.audio-player__progress::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: .8rem;
  height: .8rem;
  background: #0d6efd;
  border-radius: 50%;
  cursor: pointer;
  margin-top: -0.225rem; /* centers the thumb on the track */
}

/* Firefox slider styling */
.audio-player__progress::-moz-range-thumb {
  width: .8rem;
  height: .8rem;
  background: #0d6efd;
  border: none;
  border-radius: 50%;
  cursor: pointer;
}

.audio-player__progress::-moz-range-track {
  height: .35rem;
  background: #e5e7eb;
  border-radius: 999px;
}

/* File item form: stack on small screens, inline on large */
.file-item-form-row {
  display: flex;
  flex-direction: column;
  gap: .75rem 1rem;
}

.file-item-form-row .form-group {
  min-width: 0; /* allow shrinking of text input */
}

/* Responsive filesystem browser */
.fs-browser {
  width: 100%;
  overflow-x: auto;
}

.fs-table {
  min-width: 520px; /* allow horizontal scroll on very small screens */
}

.fs-table .fs-name {
  /* Keep this as a true table-cell to maintain equal row heights with sibling <td> */
  min-width: 0; /* allow child link to shrink while remaining visible */
}

.fs-table .fs-name a {
  display: inline-block;
  max-width: 60vw;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (min-width: 768px) {
  .fs-table .fs-name a { max-width: 40vw; }
}

.file-item-form-row .form-group--submit {
  align-self: flex-start;
}

@media (min-width: 992px) {
  .file-item-form-row {
    flex-direction: row;
    align-items: flex-end;
  }

  .file-item-form-row .form-group {
    flex: 1 1 auto;
  }

  .file-item-form-row .form-group--submit {
    flex: 0 0 auto;
    align-self: auto;
  }
}
