/* Lennon Music V8.2.8: focused changes to sidebar, album layout, player and auth form. */

/* The album identity card should follow its square cover, not stretch into a wide column. */
@media (min-width: 1261px) {
  .main-content .lm827-record-layout {
    grid-template-columns: minmax(0, 390px) minmax(0, 1fr);
    gap: 20px;
    align-items: start;
  }
  .main-content .lm827-record-card { width: 100%; max-width: 390px; }
  .main-content .lm827-record-card .lm827-record-cover {
    width: 100%; max-width: 350px; height: auto; aspect-ratio: 1;
  }
}
/* On smaller desktops, a full-width tracklist is preferable to crushed controls. */
@media (min-width: 1121px) and (max-width: 1260px) {
  .main-content .lm827-record-layout { grid-template-columns: minmax(0, 1fr); }
  .main-content .lm827-record-card { display:grid; grid-template-columns: minmax(180px,260px) minmax(0,1fr); align-items:center; gap:20px; }
  .main-content .lm827-record-card .lm827-record-cover { width:100%; max-height:none; }
}
.main-content .lm827-record-layout > .lm827-album-tracks {
  margin: 0 !important;
  align-self: start;
  width: 100%;
  min-width: 0;
}

@media (min-width: 1041px) {
  /* The small rail toggle should be a true square, not a low pill. */
  html.lm-sidebar-compact #lm-sidebar-resize,
  html.lm-sidebar-compact .lm-sidebar-resize {
    width: 55px !important;
    height: 55px !important;
    min-width: 55px !important;
    min-height: 55px !important;
    border-radius: 13px !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    background: #282b33;
    border: 1px solid #414550;
    color: #e0e2e8;
  }
  html.lm-sidebar-compact .sidebar-brand-row {
    align-items: center !important;
  }
  html.lm-sidebar-compact .sidebar-brand-row #lm-sidebar-resize { align-self: center; }
  #lm-sidebar-resize svg, .lm-sidebar-resize .svg-inline--fa { width: 19px !important; height: 19px !important; }
  html.lm-sidebar-compact #lm-sidebar-resize:hover {
    background: #353a42 !important;
    border-color: #8c969e !important;
  }
}

/* Tooltip is portalled outside the clipped/scrollable sidebar. */
.lm828-nav-tooltip {
  position: fixed;
  z-index: 145;
  pointer-events: none;
  max-width: min(270px, calc(100vw - 115px));
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 17px;
  background: linear-gradient(140deg,rgba(43,47,57,.98),rgba(24,27,34,.98));
  border: 1px solid rgba(213,219,227,.24);
  border-radius: 14px;
  box-shadow: 0 14px 36px #0008, inset 0 1px rgba(255,255,255,.08);
  color: #f5f6fa;
  font-family: Vazirmatn,Tahoma,sans-serif;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.75;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateX(12px) scale(.96);
  transform-origin: right center;
  transition: opacity .18s ease, transform .28s cubic-bezier(.19,1,.22,1), visibility .18s;
}
.lm828-nav-tooltip::after {
  content: '';
  position: absolute;
  right: -5px;
  top: calc(50% - 5px);
  width: 9px;
  height: 9px;
  background: #2b2f39;
  border-top: 1px solid rgba(213,219,227,.24);
  border-right: 1px solid rgba(213,219,227,.24);
  transform: rotate(45deg);
}
.lm828-nav-tooltip > .lm828-tooltip-icon {
  width: 28px; height:28px; display:grid; place-items:center;
  border-radius: 9px;
  background: #3a3f48;
  color: var(--accent);
  font-size: 12px;
}
.lm828-nav-tooltip.is-visible { opacity:1; visibility:visible; transform:translateX(0) scale(1); }

/* The player is aligned with the content area, not with the whole viewport. */
@media (min-width: 1041px) {
  #global-player.player {
    left: calc((100vw - var(--sidebar)) / 2) !important;
    right: auto !important;
    width: min(960px, calc(100vw - var(--sidebar) - 48px)) !important;
    max-width: calc(100vw - var(--sidebar) - 48px);
    transition: left .32s cubic-bezier(.2,.8,.2,1), width .32s cubic-bezier(.2,.8,.2,1), transform .5s cubic-bezier(.22,1,.36,1), opacity .32s, visibility .32s;
  }
}
/* The album cover is never a CSS background on this player. */
#global-player .player-art {
  position: relative;
  width: 59px !important;
  height: 59px !important;
  flex: 0 0 59px !important;
  border-radius: 13px !important;
  overflow: hidden;
  background: #282d35 !important;
  display:grid;
  place-items:center;
}
#global-player .player-art .player-cover-image {
  width:100%; height:100%; display:block;
  object-fit:cover; object-position:center;
  border-radius: inherit;
  background: #282d35;
}
#global-player .player-art > .svg-inline--fa,
#global-player .player-art > i,
#global-player .player-art > svg {
  width: 23px !important;
  height: 23px !important;
  max-width: 23px;
  max-height: 23px;
  font-size: 23px;
  color: #d3d7df;
}
/* Reserve the upper-left corner so the close control does not overlap volume. */
@media (min-width: 1041px) {
  #global-player.player { padding-left: 48px !important; }
}
/* A fixed-position control anchored in the floating island, not in volume actions. */
#global-player.player { position: fixed; }
#global-player .player-close {
  position: absolute !important;
  left: 9px !important;
  right: auto !important;
  top: 9px !important;
  margin: 0 !important;
  padding: 0 !important;
  display:grid !important;
  place-items:center !important;
  width: 29px !important;
  height: 29px !important;
  border-radius: 10px !important;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.16);
  color:#d7d9e0;
  z-index: 3;
  cursor:pointer;
  transition: background .2s,color .2s,transform .2s;
}
#global-player .player-close svg, #global-player .player-close i {
  width:14px !important;height:14px !important;font-size:14px;
}
#global-player .player-close:hover { background:#464b54 !important; color:#fff !important; transform:scale(1.05); }
@media (max-width: 1040px) {
  #global-player .player-close { top:5px!important; left:5px!important; width:27px!important; height:27px!important; }
  #global-player.player { padding-left:36px !important; }
  #global-player .player-art { width:44px!important;height:44px!important;flex-basis:44px!important; }
}

/* Browser-autofilled credentials keep the dark modal's exact input surface. */
.lm-auth-popup .field-control input:is(:-webkit-autofill, :-webkit-autofill:hover, :-webkit-autofill:focus, :-webkit-autofill:active),
.auth-modal-form .field-control input:is(:-webkit-autofill, :-webkit-autofill:hover, :-webkit-autofill:focus) {
  -webkit-box-shadow: 0 0 0 1000px #292b32 inset !important;
  box-shadow: 0 0 0 1000px #292b32 inset !important;
  -webkit-text-fill-color: #f5f5f7 !important;
  caret-color: #f5f5f7 !important;
  border: 0 !important;
  border-radius: 8px !important;
  transition: background-color 9999s ease-out 0s;
}
.lm-auth-popup .field-control input:autofill {
  box-shadow: 0 0 0 1000px #292b32 inset !important;
  color: #f5f5f7 !important;
}
.lm-auth-popup .field-control {
  background:#292b32!important;
  border-color:#464955!important;
}
.lm-auth-popup .field-control:focus-within {
  border-color:#9abc71!important;
  box-shadow:0 0 0 3px rgba(190,232,117,.09)!important;
}
@media (prefers-reduced-motion: reduce) {
  .lm828-nav-tooltip, #global-player.player, #global-player .player-close { transition-duration: .01ms!important; }
}
