/* Frontend Styles for Membership Video Manager */

:root {
    --mvm-primary: #0073aa;
    --mvm-secondary: #23282d;
    --mvm-border: #e0e0e0;
    --mvm-shadow: rgba(0, 0, 0, 0.1);
    --mvm-radius: 12px;
}

/* Video Grid */
.mvm-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
    margin: 30px 0;
    padding: 0;
}

@media (max-width: 768px) {
    .mvm-video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin: 20px 0;
    }
}

/* Video Item */
.mvm-video-item {
    background: #fff;
    border-radius: var(--mvm-radius);
    overflow: hidden;
    box-shadow: 0 2px 8px var(--mvm-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.mvm-video-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px var(--mvm-shadow);
}

.mvm-video-item.mvm-video-locked {
    opacity: 0.8;
}

/* Video Heading */
.mvm-video-heading {
    padding: 20px 20px 15px;
    background: linear-gradient(135deg, var(--mvm-primary) 0%, #005177 100%);
    color: #fff;
}

.mvm-video-heading h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

/* Video Wrapper */
.mvm-video-wrapper {
    position: relative;
    background: #000;
    overflow: hidden;
}

/* Responsive Video Container - Default 16:9 */
.mvm-video-responsive {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
}

/* Mobile/Vertical 9:16 aspect ratio */
.mvm-video-responsive.mvm-aspect-9-16 {
    padding-bottom: 177.78%;
}

/* Square 1:1 aspect ratio */
.mvm-video-responsive.mvm-aspect-1-1 {
    padding-bottom: 100%;
}

/* Classic 4:3 aspect ratio */
.mvm-video-responsive.mvm-aspect-4-3 {
    padding-bottom: 75%;
}

/* Ultrawide 21:9 aspect ratio */
.mvm-video-responsive.mvm-aspect-21-9 {
    padding-bottom: 42.86%;
}

.mvm-video-responsive iframe,
.mvm-video-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* Hosted Video Styling */
.mvm-hosted-video {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* Video Thumbnail */
.mvm-video-thumbnail {
    width: 100%;
    height: auto;
    display: block;
}

/* Locked Overlay */
.mvm-video-locked-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    z-index: 10;
}

.mvm-lock-icon {
    margin-bottom: 15px;
}

.mvm-lock-icon svg {
    width: 50px;
    height: 50px;
    color: #fff;
    opacity: 0.9;
}

.mvm-video-locked-overlay p {
    color: #fff;
    margin: 0;
    font-size: 16px;
    line-height: 1.6;
}

/* Video Info */
.mvm-video-info {
    padding: 20px;
}

.mvm-video-title {
    margin: 0 0 10px;
    font-size: 18px;
    font-weight: 600;
    color: var(--mvm-secondary);
    line-height: 1.4;
}

.mvm-video-description {
    margin: 0 0 12px;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

.mvm-video-duration {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f7f7f7;
    border-radius: 20px;
    font-size: 13px;
    color: #555;
    font-weight: 500;
}

.mvm-video-duration svg {
    width: 16px;
    height: 16px;
}

/* Locked Package Container */
.mvm-locked-container {
    background: #fff;
    border-radius: var(--mvm-radius);
    padding: 60px 30px;
    text-align: center;
    box-shadow: 0 4px 16px var(--mvm-shadow);
    margin: 30px 0;
}

.mvm-locked-icon {
    margin-bottom: 30px;
}

.mvm-locked-icon svg {
    width: 80px;
    height: 80px;
    color: var(--mvm-primary);
    opacity: 0.8;
}

.mvm-locked-message {
    font-size: 18px;
    color: var(--mvm-secondary);
    margin-bottom: 40px;
    line-height: 1.6;
}

/* Countdown Timer */
.mvm-countdown {
    max-width: 600px;
    margin: 0 auto;
}

.mvm-countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 480px) {
    .mvm-countdown-timer {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

.mvm-countdown-item {
    background: linear-gradient(135deg, var(--mvm-primary) 0%, #005177 100%);
    border-radius: 12px;
    padding: 20px;
    color: #fff;
}

.mvm-countdown-value {
    display: block;
    font-size: 36px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 8px;
}

.mvm-countdown-label {
    display: block;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.9;
}

/* Error and Notice Messages */
.mvm-error,
.mvm-notice {
    padding: 20px;
    border-radius: var(--mvm-radius);
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.6;
}

.mvm-error {
    background: #f8d7da;
    border-left: 4px solid #dc3545;
    color: #721c24;
}

.mvm-notice {
    background: #d1ecf1;
    border-left: 4px solid #17a2b8;
    color: #0c5460;
}

/* Loading State */
.mvm-loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.mvm-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top-color: var(--mvm-primary);
    border-radius: 50%;
    animation: mvm-spin 1s linear infinite;
}

@keyframes mvm-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Adaptive for Different Screen Sizes */
@media (max-width: 1200px) {
    .mvm-video-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .mvm-video-heading h3 {
        font-size: 18px;
    }
    
    .mvm-video-title {
        font-size: 16px;
    }
    
    .mvm-video-description {
        font-size: 13px;
    }
    
    .mvm-locked-container {
        padding: 40px 20px;
    }
    
    .mvm-countdown-value {
        font-size: 28px;
    }
}

/* Special handling for iPhone-sized videos (9:16) */
@media (max-width: 480px) {
    .mvm-video-grid {
        gap: 15px;
    }
    
    .mvm-video-item {
        border-radius: 8px;
    }
    
    .mvm-video-info {
        padding: 15px;
    }
    
    .mvm-video-heading {
        padding: 15px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .mvm-video-item {
        background: #1e1e1e;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .mvm-video-title {
        color: #fff;
    }
    
    .mvm-video-description {
        color: #ccc;
    }
    
    .mvm-video-duration {
        background: #2a2a2a;
        color: #ccc;
    }
    
    .mvm-locked-container {
        background: #1e1e1e;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
    }
    
    .mvm-locked-message {
        color: #fff;
    }
}

/* Animation on load */
.mvm-video-item {
    animation: mvm-fadeIn 0.5s ease-in-out;
}

@keyframes mvm-fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Accessibility improvements */
.mvm-video-item:focus-within {
    outline: 3px solid var(--mvm-primary);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .mvm-video-grid {
        grid-template-columns: 1fr;
    }
    
    .mvm-video-wrapper {
        display: none;
    }
    
    .mvm-locked-container {
        page-break-inside: avoid;
    }
}
