/* ── Dolby top navbar ──────────────────────────────────────────────────── */

.navbar {
    --navbar-height: 50px;
    padding-top: 3px;
    padding-bottom: 3px;
}

.my-container {
    padding-left: 36px;
    padding-right: 50px;
}

.navbar-brand img {
    position: relative;
    top: -3px;
    left: 2px;
}

body {
    padding-top: 65px;
}

/* Style for the history dropdown label */
:root {
    --manifest-tag-color: #1565c0;
    --manifest-attr-color: #8e24aa;
    --manifest-value-color: #2e7d32;
    --manifest-uri-color: #d84315;
}

/* Style for the error message */
.error-message {
    color: red;
    display: none;
}

/* URL input wrapper — needed for dropdown positioning */
.url-input-wrapper {
    position: relative;
    flex-wrap: nowrap;
}

/* Inner wrapper holds input + clear button */
.url-clear-wrap {
    position: relative;
    flex: 1;
    min-width: 0;
}

.url-clear-wrap #manifestUrl {
    width: 100%;
    padding-right: 1.8rem;
    box-sizing: border-box;
}

.url-clear-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: 1px solid #bbb;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 1.3rem;
    line-height: 1;
    color: #888;
    cursor: pointer;
}

.url-clear-btn:hover {
    color: #1565c0;
    border-color: #1565c0;
    background: #f0f0f0;
}

/* Custom history dropdown */
.url-history-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #fff;
    border: 1px solid #ced4da;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 8px rgba(0,0,0,.12);
    z-index: 1000;
    max-height: 260px;
    overflow-y: auto;
}

.url-history-dropdown li {
    padding: 6px 10px;
    font-size: 0.875rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
    color: #212529;
}

.url-history-dropdown li:hover,
.url-history-dropdown li.active {
    background: #e9f0fb;
    color: #1565c0;
}
.hls-comment {
    font-style: italic;
}

.hls-uri,
.xml-content,
.xml-uri {
    color: var(--manifest-uri-color);
}

.hls-uri:hover,
.xml-content:hover,
.xml-uri:hover {
    text-decoration: underline;
}

.hls-attr {
    color: var(--manifest-attr-color);
    font-weight: bold;
}

.hls-tag {
  color: var(--manifest-tag-color);
  font-weight: bold;
/*   background-color: #e3f2fd;
  padding: 0 4px;
  border-radius: 4px; */
}

.xml-comment {
    color: #6a9955;
    font-style: italic;
}

.xml-decl {
    color: #569cd6;
}

.xml-tag {
    color: var(--manifest-tag-color);
    font-weight: bold;
}

.xml-attr {
    color: var(--manifest-attr-color);
    font-weight: bold;
}

.xml-value,
.hls-value {
    color: #000;
}

.dolby-value {
    color: var(--manifest-value-color);
}

.hls-comment {
    color: var(--manifest-value-color);
    /* deeper green for readability */
}

pre {
    background: #f4f4f4;
    padding: 1em;
    overflow-x: auto;
    border-radius: 6px;
}

/* ── Info panels row (rendition/codec + DRM side by side) ───────────────── */

.manifest-info-panels {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.manifest-info-panels > * {
    flex: 1;
    min-width: 220px;
    margin-bottom: 0;
}

/* ── Compact header bar ──────────────────────────────────────────────────── */

.manifest-header-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    padding: 0.3rem 0.5rem;
    background: #f0f4f8;
    border: 1px solid #d0d9e2;
    border-radius: 6px;
    margin-bottom: 0.4rem;
}

.manifest-type-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 0.18rem 0.55rem;
    border-radius: 4px;
    color: #fff;
    white-space: nowrap;
}

.manifest-type-hls  { background: #1565c0; }
.manifest-type-dash { background: #6a1b9a; }

.manifest-header-spacer { flex: 1; }

.manifest-action-btn {
    padding: 0.25rem 0.65rem;
    font-size: 0.8rem;
}

.manifest-editor {
    width: 100%;
    min-height: 400px;
    font-family: monospace;
    font-size: 0.875rem;
    background: #f4f4f4;
    padding: 1em;
    border: 1px solid #ccc;
    border-radius: 6px;
    box-sizing: border-box;
    white-space: pre;
    overflow-x: auto;
    resize: vertical;
}

/* Reset & Base Styles */
/* * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
} */

body {
    font-family: 'Segoe UI', Roboto, sans-serif;
    background: #f4f6f8;
    color: #333;
    line-height: 1.6;
    padding: 0rem;
}

/* Layout */
main {
    max-width: 100%;
    margin: 0 auto;
    background: #fff;
    padding: 80px 1rem 1rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Header */
h1 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #2c3e50;
    text-align: center;
}

a {
    text-decoration: none;
};   
/* Form */
form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

label {
    font-weight: 600;
}

.form-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}

.history-toggle-btn {
  padding: calc(0.75rem - 1px);
  font-size: 1rem;
  box-sizing: border-box;
  border: 1px solid #adb5bd;
  border-radius: 4px;
  background: #fff;
  color: #495057;
  cursor: pointer;
  white-space: nowrap;
}

.history-toggle-btn[aria-pressed="true"] {
  background: #e67e22;
  border-color: #e67e22;
  color: #fff;
}

.history-toggle-btn:hover {
  border-color: #1565c0;
  color: #1565c0;
}

.history-toggle-btn[aria-pressed="true"]:hover {
  background: #ca6f1e;
  border-color: #ca6f1e;
  color: #fff;
}

input[type="url"] {
  flex: 1;
  min-width: 250px;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

input[type="url"]:focus {
    border-color: #3498db;
    outline: none;
}

button {
    padding: 0.75rem;
    box-sizing: border-box;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

button:hover {
    background-color: #2980b9;
}

#player {
    display: none;
    margin-top: 2rem;
    padding: 0.5rem;
    background: #ecf0f1;
    border-radius: 6px;
    font-family: monospace;
    white-space: pre-wrap;
    overflow-x: auto;
}

.media-preview {
    margin-bottom: 1rem;
    padding: 1rem;
    background: #ffffff;
    border: 1px solid #d7dee5;
    border-radius: 6px;
}

.media-preview-title {
    margin-bottom: 0.75rem;
    font-weight: 700;
    color: #2c3e50;
}

.media-preview-video {
    display: block;
    width: 100%;
    max-width: 960px;
    background: #000;
    border-radius: 6px;
}

.media-preview-status {
    margin: 0.75rem 0 0;
    color: #51606f;
}

.media-preview-actions {
    margin-top: 0.5rem;
}

.media-preview-actions a {
    color: #1565c0;
    text-decoration: underline;
}

.media-preview-url {
    display: block;
    margin-top: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f4f6f8;
    border-radius: 4px;
    white-space: pre-wrap;
    word-break: break-all;
}

.codec-summary {
    margin-bottom: 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.codec-summary-toggle {
    padding: 0.45rem 0.7rem;
    font-weight: 700;
    font-size: 0.88rem;
    line-height: 1.2;
    cursor: pointer;
    color: #2c3e50;
    background: #eef2f5;
    -webkit-user-select: none;
    user-select: none;
}

.codec-summary-body {
    padding: 0.5rem 0.6rem;
}

.codec-summary-empty,
.codec-summary-other {
    margin: 0;
    color: #666;
}

.codec-summary-other {
    margin-top: 0.4rem;
    font-size: 0.82rem;
}

.codec-summary-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    background: #fff;
    border: 1px solid #d7dee5;
}

.codec-summary-table th,
.codec-summary-table td {
    width: 50%;
    padding: 0.28rem 0.45rem;
    text-align: left;
    vertical-align: top;
    border: 1px solid #d7dee5;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.78rem;
    line-height: 1.1;
}

.codec-summary-table th {
    background: #eef5fb;
    color: #2c3e50;
    font-family: 'Segoe UI', Roboto, sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
}

.codec-summary-missing {
    color: #8a94a2;
}

/* ── Rendition Summary ──────────────────────────────────────────────────── */

.rendition-summary {
    margin-bottom: 1rem;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
}

.rendition-summary-toggle {
    padding: 0.45rem 0.7rem;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    color: #2c3e50;
    background: #eef2f5;
    -webkit-user-select: none;
    user-select: none;
}

.rendition-summary-body {
    padding: 0.5rem 0.6rem;
    overflow-x: auto;
}

.rendition-summary-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border: 1px solid #d7dee5;
    font-family: Consolas, 'Courier New', monospace;
    font-size: 0.78rem;
}

.rendition-summary-table th,
.rendition-summary-table td {
    padding: 0.28rem 0.55rem;
    text-align: left;
    vertical-align: top;
    border: 1px solid #d7dee5;
    white-space: nowrap;
}

.rendition-summary-table th {
    background: #eef5fb;
    color: #2c3e50;
    font-family: 'Segoe UI', Roboto, sans-serif;
    font-size: 0.74rem;
    letter-spacing: 0.02em;
    font-weight: 700;
}

/* ── Duration Badge ──────────────────────────────────────────────────────── */

.duration-badge {
    padding: 0.15rem 0.5rem;
    background: #e8f4fd;
    border: 1px solid #90caf9;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #1565c0;
    font-family: 'Segoe UI', Roboto, sans-serif;
    white-space: nowrap;
}

/* ── DRM Badge ───────────────────────────────────────────────────────────── */

.drm-badge {
    margin-bottom: 1rem;
    background: #fff8e1;
    border: 1px solid #f9a825;
    border-radius: 6px;
    overflow: hidden;
}

.drm-badge-toggle {
    padding: 0.45rem 0.7rem;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    color: #6d4c00;
    background: #fff3cd;
    -webkit-user-select: none;
    user-select: none;
}

.drm-badge-body {
    padding: 0.5rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.drm-badge-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.drm-badge-method {
    font-weight: 700;
    font-size: 0.85rem;
    color: #6d4c00;
    background: #ffe082;
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
}

.drm-badge-keyformat {
    font-size: 0.82rem;
    color: #5d4037;
}

.drm-badge-uri {
    font-size: 0.75rem;
    color: #4e342e;
    background: #fdf3d8;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    word-break: break-all;
}

.drm-pssh-block {
    flex-basis: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    margin-top: 0.3rem;
}

.drm-pssh-label {
    font-size: 0.72rem;
    font-weight: 700;
    color: #6d4c00;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.drm-pssh-value {
    font-size: 0.72rem;
    color: #4e342e;
    background: #fdf3d8;
    padding: 0.3rem 0.5rem;
    border-radius: 3px;
    word-break: break-all;
    white-space: pre-wrap;
    display: block;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    font-size: 0.9rem;
    color: #777;
}

#error {
  display: none;
  background: #fdecea;
  border-left: 4px solid #e74c3c;
  padding: 1em;
  margin-top: 1rem;
  border-radius: 6px;
  font-weight: bold;
  color: #c0392b;
}

#urlHistory {
    min-width: 400px;
}

