/* ══════════════════════════════════════════════════════════
   VIDGETC Custom Video Player
   Dark neon theme with glassmorphism
   ══════════════════════════════════════════════════════════ */

.vg-player {
    position: relative;
    width: 100%;
    max-width: 100%;
    border-radius: 20px;
    overflow: hidden;
    background: #000;
    border: 1px solid var(--glass-border);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    margin: 40px 0;
    aspect-ratio: 16 / 9;
}

.vg-player:hover .vg-controls {
    opacity: 1;
    transform: translateY(0);
}

.vg-player:hover .vg-top-bar {
    opacity: 1;
    transform: translateY(0);
}

.vg-player.playing .vg-big-play {
    opacity: 0;
    pointer-events: none;
}

/* ── Video element ── */
.vg-player video,
.vg-player iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    object-fit: cover;
}

.vg-player iframe {
    border: none;
}

/* ── YouTube Thumbnail Overlay ── */
.vg-yt-overlay {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.vg-yt-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    transition: var(--transition);
}

.vg-yt-overlay:hover::after {
    background: rgba(0, 0, 0, 0.15);
}

.vg-yt-overlay .vg-big-play {
    opacity: 1;
    pointer-events: auto;
}

/* ── Big Play Button ── */
.vg-big-play {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(12px);
    border: 2px solid var(--accent-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 0 30px rgba(0, 255, 136, 0.3), inset 0 0 20px rgba(0, 255, 136, 0.05);
}

.vg-big-play:hover {
    transform: translate(-50%, -50%) scale(1.1);
    box-shadow: 0 0 50px rgba(0, 255, 136, 0.5), inset 0 0 30px rgba(0, 255, 136, 0.1);
    background: rgba(0, 255, 136, 0.15);
}

.vg-big-play svg {
    width: 32px;
    height: 32px;
    fill: var(--accent-primary);
    margin-left: 4px;
}

/* ── Top Bar ── */
.vg-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 20px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.7) 0%, transparent 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 15;
    opacity: 0;
    transform: translateY(-10px);
    transition: var(--transition);
}

.vg-video-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0,0,0,0.5);
    max-width: 70%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.vg-source-badge {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ── Controls Bar ── */
.vg-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0 16px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    z-index: 15;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

/* ── Progress Bar ── */
.vg-progress-wrap {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    margin-bottom: 12px;
    position: relative;
    transition: height 0.2s ease;
}

.vg-progress-wrap:hover {
    height: 6px;
}

.vg-progress-bar {
    height: 100%;
    background: var(--accent-primary);
    border-radius: 4px;
    position: relative;
    width: 0%;
    transition: none;
}

.vg-progress-bar::after {
    content: '';
    position: absolute;
    right: -5px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    box-shadow: 0 0 8px rgba(0, 255, 136, 0.5);
    transition: transform 0.2s ease;
}

.vg-progress-wrap:hover .vg-progress-bar::after {
    transform: translateY(-50%) scale(1);
}

.vg-progress-buffered {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    pointer-events: none;
}

/* ── Control Buttons Row ── */
.vg-controls-row {
    display: flex;
    align-items: center;
    gap: 12px;
}

.vg-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: var(--transition);
}

.vg-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent-primary);
}

.vg-btn svg {
    width: 20px;
    height: 20px;
}

/* Time */
.vg-time {
    font-size: 0.75rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Space Grotesk', monospace;
    letter-spacing: 0.03em;
    user-select: none;
}

/* Spacer */
.vg-spacer {
    flex: 1;
}

/* Volume */
.vg-volume-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.vg-volume-slider {
    width: 0;
    overflow: hidden;
    transition: width 0.3s ease;
}

.vg-volume-group:hover .vg-volume-slider {
    width: 60px;
}

.vg-volume-slider input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 60px;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    outline: none;
    cursor: pointer;
}

.vg-volume-slider input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

.vg-volume-slider input[type="range"]::-moz-range-thumb {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent-primary);
    cursor: pointer;
    border: none;
    box-shadow: 0 0 6px rgba(0, 255, 136, 0.4);
}

/* Speed button */
.vg-speed-btn {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: var(--transition);
}

.vg-speed-btn:hover {
    background: var(--accent-primary);
    color: #000;
}

/* ── Fullscreen ── */
.vg-player.fullscreen {
    border-radius: 0;
    position: fixed;
    inset: 0;
    z-index: 99999;
    max-width: none;
    aspect-ratio: auto;
}

/* ── YouTube embed mode ── */
.vg-player.vg-youtube .vg-controls,
.vg-player.vg-youtube .vg-top-bar {
    pointer-events: none;
}

.vg-player.vg-youtube.has-overlay .vg-top-bar {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

/* ── Article Video Block ── */
.art-video-block {
    margin: 40px 0;
}

.art-hero-compact + .art-video-block {
    margin-top: 0;
}

.art-video-block .vg-player {
    margin: 0;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .vg-big-play {
        width: 60px;
        height: 60px;
    }
    .vg-big-play svg {
        width: 24px;
        height: 24px;
    }
    .vg-controls {
        padding: 0 12px 10px;
    }
    .vg-top-bar {
        padding: 12px 14px;
    }
    .vg-video-title {
        font-size: 0.8rem;
    }
    .vg-volume-group:hover .vg-volume-slider {
        width: 40px;
    }
}

/* ── Light theme adjustments ── */
body.light-theme .vg-player {
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
