/**
 * youonTV Reels - Frontend Player Styles
 */

.youon-reel-player-container {
    max-width: 500px;
    margin: 0 auto;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
}

/* Fullscreen feed layout */
.youon-reel-layout-feed {
    max-width: none;
    margin: 0;
    border-radius: 0;
    height: 100vh;
}

.youon-reel-layout-feed .youon-reel-player {
    aspect-ratio: auto;
    height: 100vh;
}

.youon-reel-layout-feed .youon-reel-video {
    height: 100%;
}

.youon-topbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 16px 18px;
    z-index: 30;
    display: flex;
    justify-content: center;
    pointer-events: none;
}

.youon-brand {
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}

.youon-actions {
    position: absolute;
    right: 12px;
    bottom: 110px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    z-index: 30;
}

.youon-action-btn {
    width: 52px;
    height: 60px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.35);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.youon-action-count {
    position: absolute;
    bottom: 6px;
    left: 0;
    right: 0;
    text-align: center;
    font-size: 11px;
    font-weight: 800;
    opacity: 0.95;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.youon-action-btn:hover {
    background: rgba(0,0,0,0.55);
}

.youon-action-btn.active {
    border-color: rgba(255, 0, 92, 0.8);
}

.youon-action-btn.active svg {
    color: rgba(255, 0, 92, 0.95);
}

/* Toast */
.youon-toast {
    position: absolute;
    left: 50%;
    top: 70px;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.6);
    border: 1px solid rgba(255,255,255,0.18);
    color: #fff;
    padding: 10px 14px;
    border-radius: 999px;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    white-space: nowrap;
}

.youon-toast.show {
    opacity: 1;
}

/* Comments overlay */
.youon-comments-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.55);
    z-index: 60;
}

.youon-comments-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 70vh;
    background: #0c0c0f;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-top: 1px solid rgba(255,255,255,0.12);
    display: flex;
    flex-direction: column;
}

.youon-comments-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    color: #fff;
    border-bottom: 1px solid rgba(255,255,255,0.10);
}

.youon-comments-title {
    font-weight: 800;
}

.youon-comments-close {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.15);
    background: rgba(255,255,255,0.06);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.youon-comments-list {
    padding: 12px 14px;
    overflow: auto;
    color: #fff;
    flex: 1;
}

.youon-comments-empty {
    opacity: 0.8;
}

.youon-comment {
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

.youon-comment-author {
    font-weight: 800;
    font-size: 13px;
    opacity: 0.95;
}

.youon-comment-content {
    font-size: 14px;
    opacity: 0.92;
    margin-top: 4px;
    white-space: pre-wrap;
}

.youon-comments-form {
    display: flex;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid rgba(255,255,255,0.10);
}

.youon-comments-input {
    flex: 1;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: #fff;
    padding: 10px;
    resize: none;
}

.youon-comments-submit {
    border-radius: 12px;
    border: 1px solid rgba(0,217,255,0.35);
    background: rgba(0,217,255,0.18);
    color: #fff;
    font-weight: 800;
    padding: 10px 14px;
    cursor: pointer;
}

.youon-comments-submit:disabled {
    opacity: 0.6;
    cursor: default;
}

.youon-reel-meta {
    position: absolute;
    left: 12px;
    right: 72px;
    bottom: 20px;
    z-index: 30;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0,0,0,0.7);
}

.youon-reel-title {
    font-size: 18px;
    font-weight: 800;
    margin-bottom: 6px;
}

.youon-reel-caption {
    font-size: 14px;
    line-height: 1.4;
    opacity: 0.92;
    max-height: 4.2em;
    overflow: hidden;
}

.youon-reel-player {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 16;
    background: #000;
    overflow: hidden;
}

.youon-reel-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Stack Indicator */
.youon-stack-indicator {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    color: #00D9FF;
    animation: pulse 2s infinite;
    z-index: 10;
    filter: drop-shadow(0 0 10px rgba(0, 217, 255, 0.6));
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
    50% {
        opacity: 0.6;
        transform: translateY(-50%) scale(1.1);
    }
}

.in-stack-mode .youon-stack-indicator {
    display: none;
}

/* Video Controls */
.youon-reel-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 12px;
}

.youon-play-pause-btn {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
}

.youon-mute-btn {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-weight: 600;
}

.youon-mute-btn:hover {
    background: rgba(0, 0, 0, 0.7);
}

/* Progress Bar */
.youon-progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 4px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 25;
}

.youon-progress-fill {
    height: 100%;
    width: 0;
    background: #00D9FF;
}

.youon-play-pause-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

/* Story Choices */
.youon-story-choices {
    position: absolute;
    inset: 0;
    padding: 80px 20px 40px 20px;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 20px;
    z-index: 40;
}

.youon-story-choice-header {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-weight: 800;
    letter-spacing: 0.4px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.youon-choice-btn {
    width: min(220px, 42vw);
    height: min(220px, 42vw);
    font-size: 16px;
    font-weight: 800;
    text-transform: uppercase;
    border: 2px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border-radius: 18px;
    cursor: pointer;
    transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.youon-choice-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: scale(1.03);
    border-color: rgba(255, 255, 255, 0.65);
}

.youon-choice-arrow {
    font-size: 42px;
    line-height: 1;
}

.youon-choice-text {
    text-align: center;
    padding: 0 10px;
}

.story-choice-active .youon-reel-video {
    filter: brightness(0.5);
}

/* Stack overlay (functional, horizontal thumbs) */
.youon-stack-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 10px 12px 14px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.85), rgba(0,0,0,0.0));
    z-index: 35;
}

.youon-stack-back {
    position: absolute;
    left: 10px;
    top: 10px;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 24px;
    line-height: 40px;
    cursor: pointer;
}

.youon-stack-count {
    text-align: center;
    color: rgba(255,255,255,0.9);
    font-weight: 700;
    font-size: 12px;
    padding: 4px 0 10px 0;
}

.youon-stack-strip {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
}

.youon-stack-thumb {
    flex: 0 0 auto;
    width: 88px;
    height: 54px;
    border-radius: 10px;
    border: 2px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.1);
    background-size: cover;
    background-position: center;
    color: #fff;
    cursor: pointer;
}

.youon-stack-thumb.active {
    border-color: #00D9FF;
}

/* Reel Info */
.youon-reel-info {
    padding: 20px;
    background: #1a1a1a;
    color: #fff;
}

.youon-reel-info h3 {
    margin: 0 0 10px 0;
    font-size: 20px;
    font-weight: 700;
    color: #00D9FF;
}

.youon-reel-info p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #ccc;
}

/* Stack Mode Indicator */
.in-stack-mode::after {
    content: 'STACK MODE';
    position: absolute;
    top: 20px;
    left: 20px;
    background: #00D9FF;
    color: #000;
    padding: 5px 15px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 20px;
    z-index: 15;
}

/* Responsive */
@media (max-width: 768px) {
    .youon-reel-player-container {
        max-width: 100%;
        border-radius: 0;
    }
    
    .youon-choice-btn {
        font-size: 16px;
        padding: 15px;
    }
}
