/**
 * Frontend styles for WP Shorts - Reel Format
 */

/* Reel Container */
.wp-shorts-reel-container {
    width: 100%;
    height: 80vh;
    min-height: 600px;
    margin: 0 auto;
    padding: 0;
    background: #000;
    position: relative;
    overflow: hidden;
    max-width: 500px;
    border-radius: 0;
}

.wp-shorts-reel-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Reel Item (Each Video) */
.wp-shorts-reel-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
    margin: 0;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
    z-index: 1;
}

.wp-shorts-reel-item.active {
    opacity: 1;
    visibility: visible;
    z-index: 10;
}

/* Video Wrapper */
.wp-shorts-reel-video-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #000;
    overflow: hidden;
}

/* Video Elements */
.wp-shorts-reel-iframe,
.wp-shorts-reel-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border: none;
    background: #000;
}

.wp-shorts-reel-video {
    display: block;
}

/* Video Info Overlay */
.wp-shorts-reel-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0.4) 50%, transparent 100%);
    padding: 40px 20px 20px;
    z-index: 10;
    pointer-events: none;
}

.wp-shorts-reel-content {
    max-width: 100%;
}

.wp-shorts-reel-title {
    margin: 0 0 8px 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
    line-height: 1.3;
}

.wp-shorts-reel-description {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Button Link */
.wp-shorts-reel-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    background: rgba(255,255,255,0.95);
    color: #000;
    padding: 12px 24px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    z-index: 15;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    pointer-events: auto;
}

.wp-shorts-reel-button:hover {
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.4);
    color: #000;
    text-decoration: none;
}

.wp-shorts-reel-button:active {
    transform: translateY(0);
}

/* Navigation Buttons */
.wp-shorts-reel-nav {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255,255,255,0.2);
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 20;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    pointer-events: auto;
    box-sizing: border-box;
}

.wp-shorts-reel-nav:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.8);
    transform: translateX(-50%) scale(1.1);
}

.wp-shorts-reel-nav:active {
    transform: translateX(-50%) scale(0.95);
}

.wp-shorts-reel-nav .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
    color: #fff;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    line-height: 1;
}

.wp-shorts-reel-nav-up {
    top: 20px;
}

.wp-shorts-reel-nav-down {
    bottom: 20px;
}

/* Hide navigation buttons when not needed */
.wp-shorts-reel-nav[style*="display: none"] {
    display: none !important;
}

/* Loading State */
.wp-shorts-reel-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.wp-shorts-reel-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Modal Styles */
.wp-shorts-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.9);
    animation: fadeIn 0.3s;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.wp-shorts-modal-content {
    position: relative;
    margin: 5% auto;
    padding: 20px;
    width: 90%;
    max-width: 900px;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wp-shorts-close {
    position: absolute;
    top: 15px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    line-height: 1;
    transition: color 0.2s ease;
}

.wp-shorts-close:hover {
    color: #ccc;
}

.wp-shorts-video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
}

.wp-shorts-video-container iframe,
.wp-shorts-video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* Single Video Styles */
.wp-shorts-single-video {
    max-width: 1200px;
    margin: 0 auto;
}

.wp-shorts-video-player-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 20px;
}

.wp-shorts-video-iframe,
.wp-shorts-video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.wp-shorts-video-details {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.wp-shorts-video-details .wp-shorts-video-title {
    font-size: 24px;
    margin-bottom: 15px;
}

.wp-shorts-video-details .wp-shorts-video-description {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin-bottom: 15px;
}

.wp-shorts-video-meta {
    margin-top: 15px;
}

.wp-shorts-duration-badge {
    display: inline-block;
    background: #333;
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Responsive - Reel Format */
@media (max-width: 768px) {
    .wp-shorts-reel-container {
        height: 70vh;
        min-height: 500px;
        max-width: 100%;
    }
    
    .wp-shorts-reel-video-wrapper {
        max-width: 100%;
        padding: 0 10px;
    }
    
    .wp-shorts-reel-info {
        padding: 30px 15px 15px;
    }
    
    .wp-shorts-reel-title {
        font-size: 16px;
    }
    
    .wp-shorts-reel-description {
        font-size: 13px;
    }
    
    .wp-shorts-reel-nav {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .wp-shorts-reel-nav .dashicons {
        font-size: 16px;
        width: 16px;
        height: 16px;
    }
    
    .wp-shorts-reel-button {
        bottom: 15px;
        right: 15px;
        padding: 10px 20px;
        font-size: 13px;
    }
    
    .wp-shorts-reel-nav-up {
        top: 15px;
    }
    
    .wp-shorts-reel-nav-down {
        bottom: 15px;
    }
    
    .wp-shorts-modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 10px;
    }
    
    .wp-shorts-close {
        top: 10px;
        right: 20px;
        font-size: 30px;
    }
}

@media (max-width: 480px) {
    .wp-shorts-reel-container {
        height: 60vh;
        min-height: 400px;
    }
    
    .wp-shorts-reel-video-wrapper {
        padding: 0 5px;
    }
    
    .wp-shorts-reel-info {
        padding: 20px 10px 10px;
    }
    
    .wp-shorts-reel-title {
        font-size: 14px;
    }
    
    .wp-shorts-reel-description {
        font-size: 12px;
        -webkit-line-clamp: 2;
    }
    
    .wp-shorts-reel-nav {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .wp-shorts-reel-nav .dashicons {
        font-size: 14px;
        width: 14px;
        height: 14px;
    }
    
    .wp-shorts-reel-button {
        bottom: 10px;
        right: 10px;
        padding: 8px 16px;
        font-size: 12px;
    }
}

