/* YouTube Shorts Style - Fullscreen Layout */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

.shorts-page {
    width: 100vw;
    height: 100vh;
    background: #000000;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
}

/* Back Button (Fixed at top-left) */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    color: #ffffff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

/* Desktop Back Button - Positioned next to centered video */
@media (min-width: 769px) {
    .back-btn {
        left: calc(50% - 405px/2 - 80px);
    }
}

/* Mobile Back Button - Edge of screen */
@media (max-width: 768px) {
    .back-btn {
        top: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
    }
}

.back-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

.back-btn svg {
    width: 24px;
    height: 24px;
}

/* Shorts Container (Fullscreen) */
.shorts-container {
    width: 100vw;
    height: 100vh;
    overflow-y: auto;
    scroll-snap-type: y mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.shorts-container::-webkit-scrollbar {
    display: none;
}

/* Individual Short Video */
.short-video-container {
    width: 100vw;
    height: 100vh;
    position: relative;
    scroll-snap-align: start;
    background: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.short-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
    background: #000000;
}

/* Desktop Layout - Centered 9:16 Video */
@media (min-width: 769px) {
    .short-video-container {
        justify-content: center;
    }
    
    .short-video {
        width: 405px;
        height: 720px;
        border-radius: 16px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }
}

/* Mobile Layout - Fullscreen Video */
@media (max-width: 768px) {
    .short-video {
        width: 100vw;
        height: 100vh;
        border-radius: 0;
    }
}

/* Loading Screen */
.loading-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: #ffffff;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top: 3px solid #e50914;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* No Shorts Screen */
.no-shorts-screen {
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000000;
}

.no-shorts-content {
    text-align: center;
    color: #ffffff;
    padding: 2rem;
}

.no-shorts-content svg {
    color: rgba(255, 255, 255, 0.4);
    margin-bottom: 1.5rem;
}

.no-shorts-content h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.no-shorts-content p {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2rem;
}

.back-home-btn {
    background: #e50914;
    color: #ffffff;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.back-home-btn:hover {
    background: #b8070f;
    transform: scale(1.05);
}

/* Right-Side Action Buttons (Fixed) */
.action-buttons {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Desktop Action Buttons - Positioned next to centered video */
@media (min-width: 769px) {
    .action-buttons {
        right: calc(50% - 405px/2 - 80px);
    }
}

/* Mobile Action Buttons - Edge of screen */
@media (max-width: 768px) {
    .action-buttons {
        right: 15px;
        gap: 1rem;
    }
}

.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    color: #ffffff;
    padding: 1rem;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 70px;
    font-size: 0.75rem;
    font-weight: 600;
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.action-btn.active {
    background: rgba(229, 9, 20, 0.8);
    color: #ffffff;
}

.action-btn svg {
    margin-bottom: 0.3rem;
}

.action-count, .action-text {
    font-size: 0.7rem;
    font-weight: 600;
    text-align: center;
    line-height: 1;
}

/* Play/Pause Indicator */
.play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 50;
}

.play-indicator.show {
    opacity: 1;
}

.play-indicator svg {
    width: 40px;
    height: 40px;
    color: #ffffff;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.9);
    color: #ffffff;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    backdrop-filter: blur(10px);
    font-size: 0.9rem;
    font-weight: 500;
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast.show {
    opacity: 1;
    visibility: visible;
}

.toast.error {
    background: rgba(229, 9, 20, 0.9);
}

.toast.success {
    background: rgba(34, 197, 94, 0.9);
}

/* Mobile Responsive (≤768px) - Additional mobile styles */
@media (max-width: 768px) {
    .back-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .action-btn {
        min-width: 60px;
        padding: 0.8rem;
    }
    
    .action-btn svg {
        width: 28px;
        height: 28px;
    }
    
    .action-count, .action-text {
        font-size: 0.65rem;
    }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
    .back-btn {
        top: 10px;
        left: 10px;
        width: 40px;
        height: 40px;
    }
    
    .back-btn svg {
        width: 18px;
        height: 18px;
    }
    
    .action-buttons {
        right: 10px;
        gap: 0.8rem;
    }
    
    .action-btn {
        min-width: 55px;
        padding: 0.7rem;
    }
    
    .action-btn svg {
        width: 24px;
        height: 24px;
    }
    
    .action-count, .action-text {
        font-size: 0.6rem;
    }
}

/* Smooth Hardware-Accelerated Scrolling */
.shorts-container {
    -webkit-overflow-scrolling: touch;
    transform: translateZ(0);
    will-change: scroll-position;
}

.short-video-container {
    transform: translateZ(0);
    will-change: transform;
}

/* Video Loading Animation */
.short-video[data-loading="true"] {
    background: linear-gradient(45deg, #1a1a1a 25%, #2a2a2a 25%, #2a2a2a 50%, #1a1a1a 50%, #1a1a1a 75%, #2a2a2a 75%);
    background-size: 40px 40px;
    animation: loading-shimmer 1s linear infinite;
}

@keyframes loading-shimmer {
    0% { background-position: 0 0; }
    100% { background-position: 40px 40px; }
}
