/* OhMySounds — dark theme on top of Bootstrap 5.3 */

:root,
[data-bs-theme='dark'] {
  --bg: #15202b;
  --bar: #1e2732;
  --card: #1e2732;
  --line: #38444d;
  --text: #e7e9ea;
  --muted: #8b98a5;
  --link: #eeeeee;
  --primary: #375a7f;
  --primary-hover: #2f4d6d;
  --accent: #d32f2f;

  --bs-body-bg: var(--bg);
  --bs-body-color: var(--text);
  --bs-secondary-color: var(--muted);
  --bs-secondary-bg: var(--bar);
  --bs-tertiary-bg: #192530;
  --bs-border-color: var(--line);
  --bs-emphasis-color: #fff;
  --bs-link-color: #9ec5fe;
  --bs-link-color-rgb: 158, 197, 254;
  --bs-link-hover-color: #c5dcff;
  --bs-link-hover-color-rgb: 197, 220, 255;
  --bs-primary: var(--primary);
  --bs-primary-rgb: 55, 90, 127;
  color-scheme: dark;
}

html,
body {
  background-color: var(--bg);
  color: var(--text);
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.ic {
  fill: currentColor;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ---------------------------------------------------------------- buttons */
.btn-primary {
  --bs-btn-bg: var(--primary);
  --bs-btn-border-color: var(--primary);
  --bs-btn-hover-bg: var(--primary-hover);
  --bs-btn-hover-border-color: #2c4866;
  --bs-btn-active-bg: #2c4866;
  --bs-btn-active-border-color: #29435f;
  --bs-btn-disabled-bg: var(--primary);
  --bs-btn-disabled-border-color: var(--primary);
}
.btn-outline-primary {
  --bs-btn-color: #9ec5fe;
  --bs-btn-border-color: #4a6f96;
  --bs-btn-hover-bg: var(--primary);
  --bs-btn-hover-border-color: var(--primary);
  --bs-btn-active-bg: var(--primary-hover);
}

/* ---------------------------------------------------------------- navbar */
.bg-bar {
  background-color: var(--bar);
}
.navbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.navbar .nav-link {
  color: #fff;
}
.navbar .nav-link:hover,
.navbar .nav-link:focus {
  color: #cfd8e3;
}
.navbar-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  letter-spacing: 0.2px;
  color: #fff !important;
}
.brand-logo {
  display: block;
  flex-shrink: 0;
}
.navbar-toggler {
  color: #fff;
  box-shadow: none !important;
}
.btn-icon {
  border: 0;
  padding: 0;
  background: none;
  color: #fff;
}
.nav-icon-left {
  margin: 0 6px 3px 0;
}
#nav-login {
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.search-form .search-wrap {
  position: relative;
  width: 100%;
}
.search-form .search-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  color: #555;
  z-index: 2;
  pointer-events: none;
}
.search-form input {
  background: #fff;
  color: #111;
  border: 0;
  border-radius: 20px;
  padding-left: 38px;
  min-width: 280px;
}
.search-form input::placeholder {
  color: #6c757d;
}
.search-form input:focus {
  background: #fff;
  color: #111;
  box-shadow: 0 0 0 3px rgba(55, 90, 127, 0.55);
}
@media (max-width: 767.98px) {
  .search-form input {
    min-width: 0;
  }
  #searchbar.open {
    display: flex !important;
    order: 5;
    flex: 1 1 100%;
    margin: 6px 0 4px !important;
  }
}
.dropdown-menu {
  --bs-dropdown-bg: #253341;
  --bs-dropdown-link-color: #e7e9ea;
  --bs-dropdown-link-hover-bg: #2f4152;
  --bs-dropdown-border-color: rgba(255, 255, 255, 0.08);
}
.navbar .dropdown-menu {
  max-height: 75vh;
  overflow-y: auto;
}

/* ---------------------------------------------------------------- page */
#content {
  flex: 1 0 auto;
  width: 100%;
  max-width: 970px;
  margin: 20px auto 120px;
  padding: 0 12px;
  text-align: center;
}
@media (max-width: 770px) {
  #content {
    margin: 12px auto 80px;
  }
}

#breadcrumbs {
  margin: 12px 8px 8px;
  text-align: left;
}
#breadcrumbs ol {
  padding: 0;
  margin: 0;
  list-style: none;
}
#breadcrumbs li {
  display: inline;
  font-size: 14px;
  color: var(--muted);
}
#breadcrumbs a {
  text-decoration: underline;
}
.link-secondary {
  color: var(--link) !important;
}
.link-secondary:hover {
  color: #fff !important;
}

.page-head {
  margin: 18px 0 6px;
}
.page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}
.page-sub {
  color: var(--muted);
  margin: 6px auto 0;
  max-width: 680px;
  font-size: 0.95rem;
}
#user-profile-title {
  font-size: clamp(30px, 6vw, 50px);
  font-weight: 700;
  margin: 0 0 4px;
}

/* ---------------------------------------------------------------- grid of instants */
#instants_container {
  margin: 24px auto 30px;
  text-align: center;
}
.instants {
  margin: 24px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 30px 10px;
  justify-content: center;
}
.instant {
  position: relative;
  width: 94px;
  text-align: center;
  word-wrap: break-word;
  content-visibility: auto;
  contain-intrinsic-size: auto 172px;
}
.instant-link {
  display: block;
  font-size: 14px;
  line-height: 1.4em;
  height: 2.8em;
  overflow: hidden;
  text-decoration: underline;
  color: var(--link);
}
.instant-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 6px;
}
.ia {
  border: 0;
  background: none;
  padding: 2px;
  margin: 0;
  line-height: 0;
  color: #c9d1d9;
  border-radius: 6px;
  cursor: pointer;
}
.ia:hover {
  color: #fff;
}
.ia:focus-visible {
  outline: 2px solid #6ea8fe;
}
[data-fav] .on {
  display: none;
}
[data-fav].is-fav .on {
  display: inline-block;
}
[data-fav].is-fav .off {
  display: none;
}
.ia[data-fav].is-fav {
  color: #ff4d5e;
}
.pager {
  margin: 10px 0 30px;
}
#loading {
  border: 5px solid transparent;
  border-top: 5px solid #747474;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  margin: 0 auto 40px;
  animation: spin 1s linear infinite;
}

/* ---------------------------------------------------------------- the round sound button */
/* A plastic base ring + a colored glossy cap that sinks when pressed. Size scales with --s. */
.sb {
  --c: #ff0000;
  --s: 1;
  position: relative;
  width: calc(94px * var(--s));
  height: calc(94px * var(--s));
  margin: 0 auto 6px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 30%, #626d79 0%, #343c46 48%, #1b2027 78%, #11151a 100%);
  box-shadow:
    0 calc(5px * var(--s)) calc(10px * var(--s)) rgba(0, 0, 0, 0.55),
    inset 0 1px 1px rgba(255, 255, 255, 0.22),
    inset 0 -2px 3px rgba(0, 0, 0, 0.5);
}
.sb-lg {
  --s: 2.1;
}
.sb-xs {
  --s: 0.4;
  margin: 0;
}
.sb-cap {
  position: absolute;
  left: 50%;
  top: calc(8px * var(--s));
  width: calc(72px * var(--s));
  height: calc(72px * var(--s));
  transform: translateX(-50%);
  border: 0;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  background: radial-gradient(
    circle at 50% 28%,
    color-mix(in srgb, var(--c) 55%, #fff) 0%,
    var(--c) 42%,
    color-mix(in srgb, var(--c) 72%, #000) 100%
  );
  box-shadow:
    0 calc(7px * var(--s)) 0 color-mix(in srgb, var(--c) 42%, #000),
    0 calc(9px * var(--s)) calc(6px * var(--s)) rgba(0, 0, 0, 0.55),
    inset 0 calc(-4px * var(--s)) calc(8px * var(--s)) rgba(0, 0, 0, 0.25);
  transition:
    transform 0.06s ease-out,
    box-shadow 0.06s ease-out,
    filter 0.15s;
}
.sb-cap::after {
  content: '';
  position: absolute;
  left: 17%;
  top: 6%;
  width: 66%;
  height: 40%;
  border-radius: 50%;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0.7), rgba(255, 255, 255, 0.05));
  pointer-events: none;
}
.sb-cap:hover {
  filter: brightness(1.08);
}
.sb-cap:active,
.sb-cap.pressed {
  transform: translate(-50%, calc(5px * var(--s)));
  box-shadow:
    0 calc(2px * var(--s)) 0 color-mix(in srgb, var(--c) 42%, #000),
    0 calc(3px * var(--s)) calc(3px * var(--s)) rgba(0, 0, 0, 0.55),
    inset 0 calc(-3px * var(--s)) calc(6px * var(--s)) rgba(0, 0, 0, 0.3);
}
.sb-cap:focus-visible {
  outline: 3px solid #6ea8fe;
  outline-offset: 2px;
}
.sb.playing .sb-cap {
  filter: brightness(1.15) saturate(1.1);
}
.sb .loader {
  display: none;
  position: absolute;
  inset: calc(-3px * var(--s));
  border: calc(4px * var(--s)) solid transparent;
  border-top-color: #a7b1bc;
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  pointer-events: none;
}
.sb.loading .loader {
  display: block;
}
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ---------------------------------------------------------------- sound page */
#instant-page-title {
  margin: 10px 20px 25px;
  font-size: clamp(30px, 6vw, 50px);
  font-weight: 700;
  word-wrap: break-word;
}
#instant-page-button {
  margin: 0 auto 30px;
}
#instant-page-description {
  margin: 20px auto;
  max-width: 680px;
  white-space: pre-line;
}
#instant-page-likes {
  margin: 15px;
}
.instant-page-meta {
  color: var(--muted);
}
#instant-page-tags {
  margin: 16px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
}
.tag-pill {
  background: #253341;
  color: #cfd8e3;
  font-weight: 500;
  text-decoration: none;
  padding: 0.45em 0.8em;
}
.tag-pill:hover {
  background: #2f4152;
  color: #fff;
}
#instant-page-extra-buttons-container {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}
.instant-page-extra-button {
  margin: 8px 10px;
  width: 300px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.instant-page-extra-button[data-fav] .on,
.instant-page-extra-button[data-fav].is-fav .off {
  display: none;
}
.instant-page-extra-button[data-fav].is-fav .on {
  display: inline;
}
.instant-page-extra-button[data-fav].is-fav {
  --bs-btn-bg: #7a2632;
  --bs-btn-border-color: #7a2632;
  --bs-btn-hover-bg: #6a1f2a;
}
#instant-embed {
  margin: 10px 0 20px;
  width: 300px;
  max-width: 100%;
  height: 70px;
  font-size: 12px;
  background: #0f1720;
  color: #cfd8e3;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px;
  resize: none;
}
#recommendations {
  margin: 40px 0;
}
.instants-container-title {
  margin: 50px 0 24px;
  font-size: 1.25rem;
  font-weight: 600;
}
@media (max-width: 600px) {
  .instants-container-title {
    margin: 30px 0 20px;
  }
}

/* ---------------------------------------------------------------- categories index */
.category-list {
  list-style: none;
  padding: 0;
  margin: 24px auto;
  max-width: 520px;
}
.category-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  padding: 10px 6px;
}
.category-list h3 {
  font-size: 1.15rem;
  margin: 0;
}
.category-list a {
  color: var(--link);
}

/* ---------------------------------------------------------------- forms */
.form-page {
  max-width: 620px;
  margin: 10px auto 0;
}
.form-page.narrow {
  max-width: 420px;
}
.form-control,
.form-select {
  background-color: #0f1720;
  border-color: var(--line);
}
.form-control:focus,
.form-select:focus {
  background-color: #0f1720;
}
.card {
  --bs-card-bg: var(--card);
  --bs-card-border-color: var(--line);
}
.upload-preview {
  display: flex;
  justify-content: center;
  margin: 10px 0 18px;
}
.color-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.swatch {
  cursor: pointer;
  position: relative;
}
.swatch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.swatch span {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid rgba(255, 255, 255, 0.15);
}
.swatch input:checked + span {
  border-color: #fff;
  box-shadow: 0 0 0 2px var(--primary);
}
.swatch input:focus-visible + span {
  outline: 2px solid #6ea8fe;
  outline-offset: 2px;
}
.instant-status-wrap {
  width: 104px;
}

/* ---------------------------------------------------------------- legal */
.legal {
  max-width: 760px;
  margin: 10px auto;
  line-height: 1.65;
}
.legal h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
}
.legal h2 {
  font-size: 1.2rem;
  margin-top: 1.6rem;
}

/* ---------------------------------------------------------------- footer */
.page-footer {
  background-color: var(--bar);
  flex-shrink: 0;
}
.page-footer .container {
  max-width: 970px;
}
.page-footer li {
  margin: 14px 0;
  font-size: 14px;
}
.page-footer .link-light {
  color: #b8c2cc !important;
}
.page-footer .link-light:hover {
  color: #fff !important;
}
#footer-copyright {
  padding: 20px 0 60px;
  color: var(--muted) !important;
}

/* ---------------------------------------------------------------- toast */
.omx-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: #f5f7fa;
  color: #111;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 2000;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
.omx-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------------------------------------------------------------- embed page */
.embed-body {
  background: transparent;
  min-height: 0;
  display: block;
}
.instant.embed {
  margin: 8px auto 0;
  content-visibility: visible;
}
.embed-brand {
  display: block;
  font-size: 11px;
  color: var(--muted);
  text-decoration: none;
  margin-top: 2px;
}

/* ---------------------------------------------------------------- admin */
.admin-body {
  display: block;
}
.admin-table td,
.admin-table th {
  vertical-align: middle;
}
.admin-body .sb {
  margin: 0;
}

@media (prefers-reduced-motion: reduce) {
  .sb-cap,
  .omx-toast {
    transition: none;
  }
}
