:root {
  --h1: 1.5rem;
  --h2: 1.65rem;
  --h3: 1.25rem;
  --h4: 1.0rem;
  --h5: 0.85rem;
}

@media (max-width: 768px) {
  :root {
    --h1: 1.35rem;
    --h2: 1.25rem;
    --h3: 1.125rem;
    --h4: 0.95rem;
    --h5: 0.8rem;
  }
}

@media (max-width: 480px) {
  :root {
    --h1: 1.5rem;
  }
}

h1 { font-size: var(--h1); font-weight: 600; font-family: 'Cinzel', serif; }
h2 { font-size: var(--h2); font-weight: 600; }
h3 { font-size: var(--h3); font-weight: 600; }
h4 { font-size: var(--h4); }

html, body {
  overflow-x: hidden;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: center;

    letter-spacing: -0.25px;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.user-menu {
    display: flex;
    position: absolute;

    width: 100%;
    left: calc(50% - 16px);
    top: 16px;

    z-index: 1000;
    transform: translateX(-50%);

    justify-content: flex-end;

    pointer-events: none;
    gap: 8px;
}

.user-menu > div {
    display: flex;
    width: 40px;

    justify-content: center;
    align-items: center;

    pointer-events: auto;
}

.header__inner {
    display: flex;

    margin: 10px 20px;
    margin-bottom: 10px;
    padding-right: 50px;

    align-items: center;
    justify-content: left;
}

.header__inner * {
    user-select: none;
}

.header__logo-link {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

.header__logo-image {
    height: 2.4em;
    width: auto;
}

.header__logo-text {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

.header__logo-title {
    color: var(--text-header);
    letter-spacing: -0.5px;
    line-height: normal;
}

.header__logo-description {
    color: var(--text-secondary);
}

.main {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 100%;

    margin: 10px;
    padding: 0px 20px;

    align-content: start;

    background: var(--body-bg);
}

.main_content {
    display: flex;
    width: 100%;
    max-width: 100%;

    justify-content: center;

    gap: 32px;
}

.media__container {
    display: flex;
    width: 100%;
    max-width: 100%;

    justify-content: center;
}

.media_wrapper{
    display: flex;
    width: auto;
    max-width: 100%;

    background: #000;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);

    overflow: hidden;
}

.main_content__player:has(audio),
.media__container:has(audio),
.media_wrapper:has(audio) {
    width: 100%;
    max-width: 650px;
}

video {
    display: block;
    max-width: 65vw;
    max-height: 78vh;
}

audio {
    display: block;
    width: 100%;
    max-width: 650px;
    min-width: 200px;
}

.controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 20px 20px;

    opacity: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.95), transparent);
    
    transition: opacity 0.3s ease;
}

.media__container:hover .controls {
    opacity: 1;
}

.progress-bar {
    height: 6px;
    background: rgba(255,255,255,0.25);
    border-radius: 9999px;
    cursor: pointer;
    position: relative;
    margin-bottom: 20px;
}

.progress {
    height: 100%;
    background: linear-gradient(to right, #3b82f6, #60a5fa);
    border-radius: 9999px;
    width: 0%;
    position: relative;
}

.progress::after {
    content: '';
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.4);
    opacity: 0;
    transition: opacity 0.2s;
}

.progress-bar:hover .progress::after {
    opacity: 1;
}

.main_content__media-info {
    display: inline-flex;
    flex-direction: column;
    width: 100%;
    margin-top: 10px;

    justify-content: center;

    line-height: 1.5;
}

.media-info__title {
    display: flex;
    flex-direction: row;

    margin-bottom: 8px;

    align-items: start;

    gap: 10px;
}

.media-info__title-image {
    display: block;

    margin-top: 0.3em;

    width: 30px;
    height: 30px;

    /* Make the image circular */
    border-radius: 50%;

    /* Preserve aspect ratio and fill the circle */
    object-fit: cover;
}

.media-info__title-text {
    display: inline;    
}

.media-info-description {
    padding: 24px;
    border-radius: 20px;

    color: var(--text-secondary);
   
    font-size: var(--h4);
    white-space: pre-line;
    overflow-wrap: anywhere;
    word-break: break-word;

    background-color: var(--bg-card);
}

.media-info-description:empty {
    display: none;
}

button {
    background: none;
    border: none;

    background-color: var(--bg-button);
    color: inherit;

    cursor: pointer;

    transition: border-color 0.5s ease, background-color 0.5s ease, color 0.5s ease, transform 0.5s ease;
}

.back-button {
  display: flex;
  width: 35px;
  height: 35px;
  margin-right: 10px;
  padding: 0;

  align-items: center;
  justify-content: center;

  background: rgba(0,0,0,0.05);
  border-radius: 50%;
  border: none;
}

.back-button svg {
  width: 24px;
  height: 24px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.back-button:hover {
    background-color: var(--bg-button-hover);
}

.time {
    font-size: 0.9rem;
    color: #cbd5e1;
    font-variant-numeric: tabular-nums;
}

.main_content__sidebar {
    display: flex;
    flex-direction: column;
    width: 350px;
    min-width: 350px;
    gap: 24px;
    line-height: 1.5;
}

.sidebar-card {
    max-width: 420px;
    padding: 24px;
    border-radius: 20px;

    background-color: var(--bg-card);
}

.sidebar-card_title {
    margin-bottom: 20px;
}

.sidebar-card__parameters {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: var(--h4);
}

.sidebar-card__parameters_item {
    display: flex;
    justify-content: space-between;
}

.parameters-item__name {
    color: var(--text-secondary);
}

.parameters-item__value {
    display: inline-flex;
    gap: 6px;
}

.parameters-item__value-link {
    color: inherit;
    text-decoration: none;
    overflow: hidden;
}

.parameters-item__value-link:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.item-value__action-button {
    display: inline-flex;

    align-items: center;
    justify-content: center;

    padding: 0;
    margin: 0;

    background: transparent;

    color: inherit;
    cursor: pointer;

    border: none;
    border-radius: 4px;

    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        opacity 0.25s ease,
        transform 0.25s ease;
}

.item-value__action-button:hover {
    transform: scale(1.15);
}

.item-value__action-button svg {
    display: block;

    width: 18px;
    height: 18px;

    color: var(--action-copy-icon-color);
}

.playlist-item {
    display: flex;
    gap: 16px;
    padding: 8px 0;
    cursor: pointer;
    border-radius: 12px;
    transition: background 0.2s;
}

.playlist-item:hover {
    background-color: #27272a;
}

.icon {
    display: inline-block;
    width: 1.25em;
    text-align: center;
}

@media (max-width: 1280px) {
    video {
        max-width: 62vw;
    }
}

@media (max-width: 1160px) {
    video {
        max-width: 56vw;
    }
}

@media (max-width: 1000px) {
    .user-menu {
        width: 98%;
        left: calc(50% - 8px);
        top: 10px;
    }

    .main {
        width: 100%;
        margin: 0px;
        border: none;
        border-radius: 0px;
        box-shadow: none;
    }

    .main_content {
        display: flex;
        flex-direction: column;

        gap: 16px;
    }

    video {
        max-width: 93vw;
        max-height: 80vh;
    }

    .main_content__sidebar {
        width: auto;
        max-width: 350px;
        min-width: 280px;
    }

    .sidebar-card {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .main {
        padding: 8px;
    }

    .header__inner {
        margin: 10px;
        margin-bottom: 6px;
    }

    .header__logo-link {
        gap: 6px;
    }

    .header__logo-image {
        height: 2.3em;
    }

    video {
        max-width: 95vw;
        max-height: 80vh;
    }

    .main_content__media-info {
            padding: 0 4px;
    }

    .media-info__title-image {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .main {
        padding: 0;
    }

    .user-menu {
        height: 45px;
        left: 50%;
        top: 0px;
    }

    .header__inner {
        margin: 10px 6px;
    }

    .back-button {
        width: auto;
        height: auto;
    }

    .header__logo-text h5 {
        display: none;
    }

    .header__logo-image {
        height: 1.5em;
    }

    .media_wrapper.is-full {
        background: none;
        border-radius: 0;
        box-shadow: none;
    }

    video {
        width: 100%;
        height: auto;
        max-width: none;
        max-height: 80vh;
    }

    .main_content__sidebar,
    .sidebar-card {
        width: 100%;
        max-width: 100%;
    }

    .main_content__sidebar {
        padding: 0 4px 4px;
    }
}
