* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-image: url(../assets/BG.jpg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;

  display: grid;
  place-content: center;
  height: 100vh;

  overflow: hidden;

  -webkit-backdrop-filter: brightness(0.5);
  backdrop-filter: brightness(0.5);
}

#app {
  display: grid;
  grid-template-columns: max-content max-content;
  grid-template-rows: max-content max-content max-content;
  grid-template-areas: 
  'aside header'
  'aside main'
  'aside footer';
  gap: 1.5rem;
  transition: grid-template-columns 0.25s ease;
}

#app.menu-collapsed {
  grid-template-columns: 0 max-content;
}

header {
  grid-area: header;
  position: relative;
  z-index: 30;
}

main {
  grid-area: main;
  position: relative;
  z-index: 10;
}

aside {
  grid-area: aside;
  position: relative;
  z-index: 40;
  overflow: hidden;
}

footer {
  grid-area: footer;
}

.side-menu {
  display: flex;
  padding: 0.75rem;
  height: fit-content;
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  align-self: center;
  gap: 0.75rem;

  border-radius: 5rem;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0px 8px 4px 0px rgba(0, 0, 0, 0.05),
    0px 1px 1px 0px rgba(255, 255, 255, 0.3) inset,
    0px -1px 1px 0px rgba(255, 255, 255, 0.1) inset;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  transition: opacity 0.2s ease, transform 0.25s ease;
}

#app.menu-collapsed .side-menu {
  opacity: 0;
  transform: translateX(-0.8rem);
  pointer-events: none;
}

.side-menu ion-icon {
  display: flex;
  padding: 0.5rem;
  align-items: flex-start;

  border-radius: 5rem;

  width: 1.5rem;
  height: 1.5rem;

  color: #ffffff;
  opacity: 0.8;
}

.side-menu ion-icon[role="button"] {
  cursor: pointer;
}

.side-menu ion-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.side-menu ion-icon.is-active {
  background: rgba(255, 255, 255, 0.28);
  opacity: 1;
  box-shadow: 0 0 0.7rem rgba(255, 255, 255, 0.2) inset;
}

.volume-popover {
  position: absolute;
  left: calc(100% + 0.7rem);
  top: 3.3rem;
  transform: translateY(-50%);
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.48rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: rgba(17, 22, 48, 0.72);
  box-shadow:
    0 0.5rem 1.2rem rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.26);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}

.volume-popover[hidden] {
  display: none !important;
}

.volume-value {
  color: rgba(255, 255, 255, 0.9);
  font-family: Inter;
  font-size: 0.72rem;
  min-width: 2.35rem;
}

.volume-range {
  width: 7.25rem;
  accent-color: #6fc9ff;
  cursor: pointer;
}

.nav-bar {
  display: flex;
  padding: 0.5rem 0.75rem;
  width: fit-content;
  justify-content: center;
  align-items: center;
  justify-self: center;
  gap: 1.5rem;

  border-radius: 5rem;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0px 8px 4px 0px rgba(0, 0, 0, 0.05),
    0px 1px 1px 0px rgba(255, 255, 255, 0.3) inset,
    0px -1px 1px 0px rgba(255, 255, 255, 0.1) inset;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.search-container {
  position: relative;
  z-index: 40;
}

.actions {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}

.actions ion-icon {
  width: 1.5rem;
  height: 1.5rem;

  color: #ffffff;
  opacity: 0.8;

  display: flex;
  padding: 0.5rem;
  align-items: center;
  justify-content: center;
}

.actions ion-icon[role="button"] {
  cursor: pointer;
}

.actions i.ai-panel-left {
  font-size: 1.5rem;
  width: 2.5rem;
  height: 2.5rem;

  color: #ffffff;
  opacity: 0.8;

  display: flex;
  align-items: center;
  justify-content: center;
}

.actions i.ai-panel-left:hover,
.actions ion-icon:hover {
  border-radius: 5rem;
  background: rgba(255, 255, 255, 0.2);
  opacity: 1;
}

.actions ion-icon.is-active {
  border-radius: 5rem;
  background: rgba(255, 255, 255, 0.3);
  opacity: 1;
  box-shadow: 0 0 0.85rem rgba(255, 255, 255, 0.18) inset;
}

.actions ion-icon[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
}


.address-bar {
  display: flex;
  width: 27.5rem;
  padding: 0.75rem;
  justify-content: space-between;
  align-items: center;

  border-radius: 5rem;
  background: rgba(0, 0, 0, 0.1);
  box-shadow: 0px -1px 0px 0px rgba(255, 255, 255, 0.1) inset,
    0px 1px 0px 0px rgba(0, 0, 0, 0.2) inset;

  color: rgba(255, 255, 255, 0.8);
  font-family: Inter;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5rem;
}

.address-url {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.address-url input {
  width: 100%;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-family: Inter;
  font-size: 0.9375rem;
  line-height: 1.5rem;
  outline: none;
}

.address-url input::placeholder {
  color: rgba(255, 255, 255, 0.55);
}

.search-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.search-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.search-btn ion-icon {
  width: 1.05rem;
  height: 1.05rem;
}

.adress-bar ion-icon {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;

  opacity: 0.8;
}

.address-url ion-icon {
  width: 1rem;
  height: 1rem;

  margin-top: -3px;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  width: 100%;
  max-height: 18rem;
  overflow-y: auto;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(20, 22, 45, 0.92);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 0.8rem 1.6rem rgba(0, 0, 0, 0.28);
  z-index: 999;
}

.search-results::-webkit-scrollbar {
  width: 0.6rem;
}

.search-results::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
}

.search-results::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.8), rgba(173, 216, 255, 0.75));
  border-radius: 1rem;
  border: 2px solid rgba(20, 22, 45, 0.9);
}

.search-results::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(198, 232, 255, 0.9));
}

.search-result,
.search-message,
.search-fallback {
  width: 100%;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: transparent;
  color: #ffffff;
  text-align: left;
  padding: 0.65rem 0.75rem;
  font-family: Inter;
  cursor: pointer;
}

.search-result {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 0.6rem;
}

.search-result:hover {
  background: rgba(255, 255, 255, 0.08);
}

.search-result:last-child,
.search-message:last-child,
.search-fallback:last-child {
  border-bottom: none;
}

.search-thumb {
  width: 96px;
  height: 54px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.search-title {
  display: block;
  font-size: 0.9rem;
  line-height: 1.2rem;
  margin-bottom: 0.18rem;
}

.search-channel {
  display: block;
  color: rgba(255, 255, 255, 0.66);
  font-size: 0.8rem;
}

.search-message {
  cursor: default;
}

.search-fallback {
  text-decoration: none;
  display: block;
}

.search-fallback:hover {
  background: rgba(255, 255, 255, 0.08);
}

.screen {
  width: 60rem;
  height: 33.75rem;

  border-radius: 2rem;
  border: 1px solid transparent;
  box-shadow: 0px 8px 4px 0px rgba(0, 0, 0, 0.05);
  position: relative;
}

.screen::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right,
  rgb(255 255 255 / 0.1),
  rgb(255 255 255 / 0.6));

  border-radius: inherit;

  margin: -1px;
  z-index: -1;
}

#video {
  width: 100%;
  height: 100%;

  border-radius: inherit;
}

#ambient-light {
  position: absolute;
  z-index: -1;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
  scale: 1.2;
  filter: blur(100px) opacity(0.5) saturate(300%);
  box-shadow: 0px 0px 80px rgba(0, 0, 0, 0);
}

.more-videos-overlay {
  position: absolute;
  inset: 0;
  z-index: 22;
  border-radius: inherit;
  padding: 1rem 1rem 0.9rem;
  display: grid;
  grid-template-rows: max-content 1fr max-content;
  gap: 0.8rem;
  background:
    radial-gradient(circle at 15% 15%, rgba(60, 181, 255, 0.18), transparent 45%),
    radial-gradient(circle at 80% 80%, rgba(99, 255, 182, 0.14), transparent 42%),
    rgba(2, 8, 18, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.more-videos-overlay[hidden] {
  display: none !important;
}

.more-videos-close {
  justify-self: end;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.more-videos-close:hover {
  background: rgba(255, 255, 255, 0.22);
}

.more-videos-status {
  align-self: center;
  justify-self: center;
  color: rgba(255, 255, 255, 0.82);
  font-family: Inter;
  font-size: 0.95rem;
}

.more-videos-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(15rem, 1fr);
  gap: 0.9rem;
  overflow-x: auto;
  align-items: end;
  padding-bottom: 0.2rem;
}

.more-videos-grid::-webkit-scrollbar {
  height: 0.45rem;
}

.more-videos-grid::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(130, 214, 255, 0.62);
}

.more-video-card {
  border: none;
  border-radius: 0.9rem;
  background: rgba(7, 14, 30, 0.64);
  color: #fff;
  padding: 0;
  text-align: left;
  overflow: hidden;
  cursor: pointer;
  box-shadow: 0 0.65rem 1.2rem rgba(0, 0, 0, 0.28);
}

.more-video-card:hover {
  outline: 2px solid rgba(121, 210, 255, 0.85);
}

.more-video-thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.more-video-meta {
  padding: 0.55rem 0.6rem 0.65rem;
}

.more-video-title {
  display: block;
  font-family: Inter;
  font-size: 0.85rem;
  line-height: 1.15rem;
  color: rgba(255, 255, 255, 0.95);
}

.more-video-channel {
  display: block;
  margin-top: 0.22rem;
  font-family: Inter;
  font-size: 0.76rem;
  color: rgba(187, 220, 255, 0.8);
}

.interaction {
  display: flex;
  align-items: center;
  gap: 1rem;

  justify-self: center;
}

.interaction .ellipse {
  width: 0.5rem;
  height: 0.5rem;

  border-radius: 8px;
  
  background-color: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.interaction .rectangle {
  width: 5rem;
  height: 0.5rem;

  border-radius: 8px;
  
  background-color: rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}

.share-toast {
  position: fixed;
  left: 50%;
  bottom: 1.5rem;
  transform: translateX(-50%);
  z-index: 2000;
  max-width: min(90vw, 22rem);
  padding: 0.6rem 0.9rem;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(16, 22, 45, 0.88);
  color: #ffffff;
  font-family: Inter;
  font-size: 0.9rem;
  text-align: center;
  box-shadow: 0 0.7rem 1.4rem rgba(0, 0, 0, 0.32);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
}

.share-toast.success {
  border-color: rgba(84, 214, 147, 0.7);
  background: rgba(16, 40, 28, 0.9);
  box-shadow: 0 0.7rem 1.4rem rgba(12, 53, 35, 0.45);
}

.share-toast.error {
  border-color: rgba(255, 120, 120, 0.75);
  background: rgba(52, 21, 30, 0.9);
  box-shadow: 0 0.7rem 1.4rem rgba(66, 21, 35, 0.46);
}

.share-toast.show {
  animation: toastInOut 2000ms ease forwards;
}



.queue-modal {
  position: fixed;
  inset: 0;
  z-index: 3100;
  background:
    radial-gradient(circle at 18% 15%, rgba(109, 200, 255, 0.2), transparent 45%),
    radial-gradient(circle at 82% 78%, rgba(246, 51, 219, 0.22), transparent 44%),
    rgba(3, 5, 15, 0.58);
  -webkit-backdrop-filter: blur(14px) saturate(135%);
  backdrop-filter: blur(14px) saturate(135%);
  display: grid;
  place-items: center;
  padding: 1.2rem;
}

.queue-modal[hidden] {
  display: none !important;
}

.queue-modal-card {
  width: min(42rem, 96vw);
  max-height: 86vh;
  overflow: hidden;
  border-radius: 1.4rem;
  border: 1px solid rgba(198, 228, 255, 0.4);
  background:
    linear-gradient(160deg, rgba(23, 31, 74, 0.62), rgba(52, 21, 74, 0.56));
  box-shadow:
    0 1.3rem 2.8rem rgba(0, 0, 0, 0.44),
    inset 0 0 0.85rem rgba(145, 205, 255, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.34);
  -webkit-backdrop-filter: blur(24px) saturate(150%);
  backdrop-filter: blur(24px) saturate(150%);
  display: grid;
  grid-template-rows: max-content max-content minmax(7rem, 1fr) minmax(7rem, 1fr);
  gap: 0.9rem;
  padding: 1.05rem;
  color: #ffffff;
  font-family: Inter;
  position: relative;
}

.queue-modal-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.22) 0%,
    rgba(255, 255, 255, 0.07) 26%,
    rgba(255, 255, 255, 0) 55%
  );
}

.queue-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.queue-modal-header h2 {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  text-shadow: 0 0 0.55rem rgba(136, 212, 255, 0.36);
}

.queue-close {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: inset 0 0 0.3rem rgba(255, 255, 255, 0.2);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.queue-close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.queue-search-form {
  display: grid;
  grid-template-columns: max-content 1fr max-content;
  gap: 0.5rem;
  align-items: center;
  border-radius: 999px;
  border: 1px solid rgba(197, 227, 255, 0.28);
  background: rgba(7, 11, 29, 0.36);
  padding: 0.55rem 0.7rem;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.queue-search-form input {
  border: none;
  background: transparent;
  color: #ffffff;
  outline: none;
  font-family: Inter;
  font-size: 0.9rem;
}

.queue-search-form input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.queue-search-form button {
  border: none;
  border-radius: 999px;
  background: linear-gradient(120deg, rgba(98, 197, 255, 0.36), rgba(214, 84, 255, 0.32));
  color: #ffffff;
  font-family: Inter;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
}

.queue-search-form button:hover {
  background: linear-gradient(120deg, rgba(98, 197, 255, 0.52), rgba(214, 84, 255, 0.44));
}

.queue-search-results,
.queue-list {
  border-radius: 1rem;
  border: 1px solid rgba(208, 231, 255, 0.2);
  background: rgba(10, 15, 40, 0.28);
  box-shadow:
    inset 0 0 1rem rgba(115, 167, 255, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  overflow: auto;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.queue-search-results::-webkit-scrollbar,
.queue-list::-webkit-scrollbar {
  width: 0.62rem;
}

.queue-search-results::-webkit-scrollbar-track,
.queue-list::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
}

.queue-search-results::-webkit-scrollbar-thumb,
.queue-list::-webkit-scrollbar-thumb {
  border-radius: 999px;
  border: 2px solid rgba(12, 18, 45, 0.95);
  background: linear-gradient(180deg, rgba(123, 216, 255, 0.92), rgba(237, 108, 255, 0.82));
}

.queue-search-results::-webkit-scrollbar-thumb:hover,
.queue-list::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(155, 228, 255, 0.98), rgba(244, 140, 255, 0.92));
}

.queue-search-results {
  min-height: 8rem;
  max-height: 14rem;
}

.queue-list-wrap h3 {
  font-size: 0.92rem;
  font-weight: 700;
  margin-bottom: 0.45rem;
  color: rgba(233, 247, 255, 0.92);
}

.next-videos-list-wrap {
  margin-top: 0.3rem;
}

#next-videos-modal .queue-modal-card {
  grid-template-rows: max-content minmax(0, 1fr);
  min-height: min(80vh, 44rem);
}

#next-videos-modal .next-videos-list-wrap {
  display: grid;
  grid-template-rows: max-content minmax(0, 1fr);
  min-height: 0;
}

#next-videos-modal .queue-list {
  min-height: 0;
  max-height: none;
  height: 100%;
}

.queue-list {
  min-height: 8rem;
  max-height: 15rem;
}

.queue-result,
.queue-item,
.queue-message {
  border-bottom: 1px solid rgba(170, 214, 255, 0.16);
}

.queue-result,
.queue-item {
  width: 100%;
  border-left: none;
  border-right: none;
  border-top: none;
  background: transparent;
  color: #ffffff;
  display: grid;
  grid-template-columns: 88px 1fr max-content;
  gap: 0.65rem;
  text-align: left;
  padding: 0.6rem;
}

.queue-result {
  cursor: pointer;
}

.queue-result:hover {
  background: linear-gradient(120deg, rgba(102, 198, 255, 0.18), rgba(232, 93, 255, 0.14));
}

.queue-item {
  cursor: default;
}

.queue-item-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
}

.queue-move,
.queue-remove {
  width: 2rem;
  height: 2rem;
  align-self: center;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.queue-move:hover,
.queue-remove:hover {
  background: rgba(255, 110, 110, 0.35);
}

.queue-move:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.queue-move:disabled:hover {
  background: rgba(255, 255, 255, 0.14);
}

.queue-remove ion-icon {
  font-size: 1rem;
}

.queue-result-thumb,
.queue-item-thumb {
  width: 88px;
  height: 50px;
  object-fit: cover;
  border-radius: 0.45rem;
}

.queue-result-title,
.queue-item-title {
  display: block;
  font-size: 0.86rem;
  line-height: 1.14rem;
  color: rgba(242, 248, 255, 0.95);
}

.queue-result-channel,
.queue-item-channel {
  display: block;
  margin-top: 0.2rem;
  color: rgba(189, 222, 255, 0.76);
  font-size: 0.75rem;
}

.queue-message {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.84rem;
  padding: 0.75rem;
}

#app {
  animation: appear 400ms 500ms backwards;
}

@keyframes appear {
  from {
    scale: 2;
    opacity: 0;
  }
}

@keyframes toastInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(0.6rem);
  }

  12%,
  78% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(0.6rem);
  }
}