/* Video Technica - Shared Theme */
:root {
    --vt-bg: #0D0B27;
    --vt-bg-light: #16213e;
    --vt-accent: #c9a96e;
    --vt-accent-hover: #b08d4f;
    --vt-text: #ffffff;
    --vt-text-muted: rgba(255, 255, 255, 0.55);
    --vt-glass: rgba(255, 255, 255, 0.08);
    --vt-glass-border: rgba(255, 255, 255, 0.12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 300;
    color: var(--vt-text);
    background: var(--vt-bg);
}

/* --- Header bar --- */
.vt-header {
    flex-shrink: 0;
    padding: 0.75rem 1rem;
    text-align: center;
    border-bottom: 1px solid var(--vt-glass-border);
}

.vt-header-brand {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-style: italic;
    font-size: 1.1rem;
    letter-spacing: 0.04em;
    color: var(--vt-text);
    text-decoration: none;
}

.vt-header-brand:hover {
    color: var(--vt-accent);
}

/* --- Main content area --- */
.vt-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem 2rem;
}

/* --- Video player wrapper --- */
.vt-player-wrapper {
    width: 100%;
    max-width: 960px;
    margin-bottom: 1.5rem;
}

.vt-player-wrapper video,
.vt-player-wrapper iframe {
    display: block;
    width: 100%;
    border-radius: 8px;
    background: #000;
}

.vt-player-wrapper video {
    max-height: 70vh;
}

.vt-player-wrapper iframe {
    aspect-ratio: 16 / 9;
    border: none;
}

/* --- Video info section --- */
.vt-video-info {
    width: 100%;
    max-width: 960px;
    margin-bottom: 1.5rem;
}

.vt-video-title {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 3vw, 1.4rem);
    margin: 0 0 0.4rem;
}

.vt-video-source {
    font-size: 0.9rem;
    color: var(--vt-text-muted);
    margin: 0;
}

.vt-quality-info {
    font-size: 0.8rem;
    color: var(--vt-text-muted);
    margin-top: 0.75rem;
}

.vt-browser-warning {
    font-size: 0.8rem;
    color: #f5c242;
    background: rgba(245, 194, 66, 0.1);
    border: 1px solid rgba(245, 194, 66, 0.2);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin-top: 0.75rem;
}

/* --- Download section --- */
.vt-download-section {
    width: 100%;
    max-width: 960px;
    margin-bottom: 1.5rem;
}

.vt-download-label {
    font-size: 0.85rem;
    color: var(--vt-text-muted);
    margin-bottom: 0.75rem;
}

.vt-btn {
    display: inline-block;
    background: var(--vt-accent);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s, transform 0.1s;
}

.vt-btn:hover {
    background: var(--vt-accent-hover);
    color: #fff;
}

.vt-btn:active {
    transform: scale(0.98);
}

.vt-btn-sm {
    font-size: 0.8rem;
    padding: 0.35rem 0.75rem;
}

.vt-btn-outline {
    background: transparent;
    border: 1px solid var(--vt-accent);
    color: var(--vt-accent);
}

.vt-btn-outline:hover {
    background: var(--vt-accent);
    color: #fff;
}

.vt-download-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
}

.vt-terms-link {
    font-size: 0.75rem;
    color: var(--vt-text-muted);
    text-decoration: none;
    margin-left: 0.5rem;
}

.vt-terms-link:hover {
    color: var(--vt-accent);
}

.vt-download-expired {
    font-size: 0.85rem;
    color: var(--vt-text-muted);
}

.vt-download-notice {
    font-size: 0.7rem;
    color: var(--vt-text-muted);
    margin-top: 1rem;
    line-height: 1.6;
}

/* --- Download quality select (HLS) --- */
.vt-select {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--vt-glass-border);
    border-radius: 6px;
    color: var(--vt-text);
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 0.85rem;
    padding: 0.4rem 0.6rem;
    margin-right: 0.5rem;
}

.vt-select option {
    background: var(--vt-bg);
    color: var(--vt-text);
}

/* --- Popup (download confirmation) --- */
.popup {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: 0.3s;
}

.popup.is-show {
    opacity: 1;
    visibility: visible;
}

.popup-inner {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 480px;
    padding: 2rem;
    background: var(--vt-bg-light);
    border: 1px solid var(--vt-glass-border);
    border-radius: 12px;
    z-index: 2;
    color: var(--vt-text);
    text-align: center;
}

.popup-inner p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.popup-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.close-btn {
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.2s;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.close-btn i {
    font-size: 16px;
    color: var(--vt-text-muted);
}

.black-background {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1;
    cursor: pointer;
}

/* --- Multi-chapter layout --- */
.vt-multi-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 1rem 1rem 2rem;
}

.vt-multi-title {
    font-family: 'Noto Sans JP', sans-serif;
    font-weight: 400;
    font-size: clamp(1.1rem, 3vw, 1.5rem);
    text-align: center;
    margin: 0 0 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--vt-glass-border);
}

.vt-multi-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 1rem;
    min-height: 0;
    transition: grid-template-columns 0.3s ease;
}

.vt-multi-layout.sidebar-collapsed {
    grid-template-columns: 40px 1fr;
}

.vt-multi-sidebar {
    background: var(--vt-glass);
    border: 1px solid var(--vt-glass-border);
    border-radius: 8px;
    align-self: start;
    max-height: calc(100vh - 180px);
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.vt-multi-sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--vt-text-muted);
    border-bottom: 1px solid var(--vt-glass-border);
    cursor: pointer;
    white-space: nowrap;
}

.vt-multi-sidebar-header:hover {
    color: var(--vt-text);
}

.vt-sidebar-arrow {
    margin-left: auto;
    transition: transform 0.3s ease;
    font-size: 0.75rem;
}

.sidebar-collapsed .vt-sidebar-arrow {
    transform: rotate(180deg);
}

.sidebar-collapsed .vt-multi-sidebar-header {
    padding: 0.75rem 0;
    justify-content: center;
    border-bottom: none;
}

.sidebar-collapsed .vt-multi-sidebar-header .fa-list,
.sidebar-collapsed .vt-sidebar-label {
    display: none;
}

.sidebar-collapsed .vt-multi-sidebar {
    max-height: 40px;
    overflow: hidden;
}

.vt-chapter-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.vt-chapter-item {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.vt-chapter-item:last-child {
    border-bottom: none;
}

.vt-chapter-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.vt-chapter-item.active {
    background: rgba(201, 169, 110, 0.15);
    border-left: 3px solid var(--vt-accent);
    padding-left: calc(1rem - 3px);
}

.vt-chapter-no {
    font-size: 0.8rem;
    color: var(--vt-accent);
    min-width: 1.8em;
    text-align: right;
    flex-shrink: 0;
}

.vt-chapter-name {
    font-size: 0.85rem;
    color: var(--vt-text);
}

.vt-multi-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.vt-multi-content .vt-player-wrapper {
    max-width: none;
    margin-bottom: 1rem;
}

.vt-multi-content .vt-player-wrapper video {
    max-height: 65vh;
}

.vt-multi-content .vt-player-wrapper iframe {
    display: none;
}

.vt-multi-content .vt-video-info {
    max-width: none;
}

.vt-multi-content .vt-video-title {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin: 0 0 0.3rem;
}

/* Mobile: stack vertically, start collapsed */
@media (max-width: 768px) {
    .vt-multi-layout {
        grid-template-columns: 1fr;
    }

    .vt-multi-layout.sidebar-collapsed {
        grid-template-columns: 1fr;
    }

    .vt-multi-sidebar {
        max-height: none;
    }

    .sidebar-collapsed .vt-multi-sidebar {
        max-height: 40px;
    }

    .sidebar-collapsed .vt-multi-sidebar-header .fa-list,
    .sidebar-collapsed .vt-sidebar-label {
        display: inline;
    }

    .sidebar-collapsed .vt-multi-sidebar-header {
        padding: 0.75rem 1rem;
        justify-content: flex-start;
    }
}

/* --- Footer --- */
.vt-footer {
    flex-shrink: 0;
    padding: 1.25rem 1rem;
    text-align: center;
    border-top: 1px solid var(--vt-glass-border);
}

.vt-footer small {
    font-size: 0.7rem;
    color: var(--vt-text-muted);
}

.vt-footer a {
    color: var(--vt-text-muted);
    text-decoration: none;
}

.vt-footer a:hover {
    color: var(--vt-accent);
}
