/**
 * Single Video Player Styles
 * Modern locked video state with clean design
 * 
 * @package CustomVideosPlugin
 * @since 2.1.0
 */

/* ====================================
   Main Container
   ==================================== */
.cvp-single-video-container {
    width: 100%;
    margin: 0;
    background: #ffffff;
    border-radius: 1rem;
    border: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: visible;
}

/* ====================================
   Grid Layout
   ==================================== */
.cvp-single-video-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    padding: 1rem;
}

@media (min-width: 1024px) {
    .cvp-single-video-grid {
        grid-template-columns: 7fr 5fr;
        gap: 2rem;
        padding: 1.5rem;
    }
}

/* ====================================
   Video Area
   ==================================== */
.cvp-single-video-area {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #1f2937;
    border-radius: 0.75rem;
    overflow: hidden;
}

@supports not (aspect-ratio: 16 / 9) {
    .cvp-single-video-area {
        height: 0;
        padding-top: 56.25%;
    }
    .cvp-single-video-area > * {
        position: absolute;
        top: 0;
        left: 0;
    }
}

/* Thumbnail background with blur */
.cvp-single-video-thumb-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: blur(8px);
    opacity: 0.5;
    z-index: 0;
}

/* Dark overlay on thumbnail */
.cvp-single-video-overlay-bg {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1;
}

/* Locked content overlay */
.cvp-single-video-locked-content {
    position: absolute;
    inset: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    text-align: center;
    padding: 1.5rem;
}

.cvp-single-video-locked-content.hidden {
    display: none;
}

/* Lock icon and title row */
.cvp-single-video-lock-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.cvp-single-video-lock-header .material-symbols-outlined,
.cvp-single-video-lock-header .lock-icon {
    font-size: 2rem;
}

.cvp-single-video-lock-header h2 {
    font-size: 1.5rem !important;
    font-weight: 700 !important;
    margin: 0 !important;
    color: #ffffff !important;
}

/* Unlock button */
.cvp-single-video-unlock-btn {
    background: #e76e3c;
    color: #ffffff;
    font-weight: 700;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.cvp-single-video-unlock-btn:hover {
    background: #d45a2a;
    transform: scale(1.05);
}

/* Preview button */
.cvp-single-video-preview-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: underline;
    text-underline-offset: 4px;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity 0.2s ease;
    padding: 0.5rem 1rem;
}

.cvp-single-video-preview-btn:hover {
    opacity: 1;
}

/* Preview ended overlay */
.cvp-single-video-preview-overlay {
    position: absolute;
    inset: 0;
    z-index: 15;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.8);
    color: #ffffff;
    text-align: center;
    padding: 1.5rem;
}

.cvp-single-video-preview-overlay.show {
    display: flex;
}

.cvp-single-video-preview-overlay p {
    font-size: 1.25rem;
    margin: 0 0 1rem;
}

/* Player container */
.cvp-single-video-player-container {
    display: none;
    position: absolute;
    inset: 0;
    z-index: 5;
}

.cvp-single-video-player-container iframe {
    width: 100%;
    height: 100%;
    position: absolute;
    inset: 0;
}

/* Playing state (unlocked video) */
.cvp-single-video-playing {
    position: relative;
    width: 100%;
    height: 100%;
}

.cvp-single-video-playing iframe {
    border-radius: 0.75rem;
}

/* ====================================
   Details Area
   ==================================== */
.cvp-single-video-details {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

@media (min-width: 1024px) {
    .cvp-single-video-details {
        padding: 0.5rem 0;
    }
}

/* Type badge */
.cvp-single-video-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 110px;
    max-width: 150px;
    height: 28px;
    padding: 0 12px;
    background: #E76E3C;
    color: #FFFFFF;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    box-sizing: border-box;
    margin-bottom: 1rem;
}

/* Title */
.cvp-single-video-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    line-height: 1.3;
    margin: 0 0 1rem;
}

@media (min-width: 1024px) {
    .cvp-single-video-title {
        font-size: 1.875rem;
    }
}

/* Author and rating row */
.cvp-single-video-author-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.cvp-single-video-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cvp-single-video-author-avatar {
    width: 3rem !important;
    height: 3rem !important;
    border-radius: 50% !important;
    object-fit: cover !important;
    border: 1px solid #e5e7eb !important;
}

.cvp-single-video-author-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1f2937;
}

.cvp-single-video-divider {
    width: 1px;
    height: 1rem;
    background: #d1d5db;
}

.cvp-single-video-rating {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.cvp-single-video-rating-number {
    font-size: 0.875rem;
    font-weight: 700;
    color: #111827;
}

.cvp-single-video-stars {
    display: flex;
    gap: 2px;
}

.cvp-single-video-stars img {
    width: 16px;
    height: 16px;
}

/* Meta info bar */
.cvp-single-video-meta-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    margin-bottom: 1rem;
}

.cvp-single-video-meta-item {
    font-size: 0.8rem;
    font-weight: 500;
    color: #6b7280;
}

.cvp-single-video-meta-item:not(:last-child)::after {
    content: '|';
    margin: 0 0.5rem;
    color: #d1d5db;
}

/* Duration bold */
.cvp-single-video-meta-item.cvp-meta-duration {
    font-weight: 700;
    color: #111827;
}

/* Description */
.cvp-single-video-description {
    font-size: 0.875rem;
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.25rem;
    position: relative;
    overflow: visible;
    white-space: pre-line;
}

/* Description tooltip */
.cvp-desc-tooltip-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.cvp-desc-info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    color: #6b7280;
    cursor: pointer;
    border: 1px solid #d1d5db;
    border-radius: 50%;
    transition: all 0.2s ease;
    padding: 5px;
}

.cvp-desc-info-icon:hover {
    color: #111827;
    border-color: #111827;
}

.cvp-desc-info-icon svg {
    width: 16px;
    height: 16px;
}

.cvp-desc-tooltip {
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 8px;
    width: 380px;
    max-height: 350px;
    overflow-y: auto;
    padding: 0;
    background: #ffffff;
    color: #1f2937;
    font-size: 0.8rem;
    line-height: 1.5;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

.cvp-desc-tooltip-header {
    display: block;
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px 8px 0 0;
}

.cvp-desc-tooltip-wrapper:hover .cvp-desc-tooltip {
    opacity: 1;
    visibility: visible;
}

.cvp-desc-tooltip-content {
    display: block;
    padding: 0.75rem 1rem;
}

/* Self-study badge */
.cvp-single-video-self-study {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: #fef3c7;
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 0.5rem;
    border: 1px solid #fde68a;
    margin-top: auto;
    width: fit-content;
}

.cvp-single-video-self-study .material-symbols-outlined {
    font-size: 0.875rem;
    font-weight: 700;
}

/* ====================================
   Payment Success Modal
   ==================================== */
.cvp-pay-success-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}

.cvp-pay-success-content {
    background: #ffffff;
    padding: 1.5rem;
    border-radius: 0.75rem;
    max-width: 360px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.cvp-pay-success-content p {
    margin: 0 0 1rem;
    font-size: 1rem;
}

/* ====================================
   Skeleton Loading State
   ==================================== */
.cvp-single-video-loading .cvp-single-video-area {
    background: #1f2937;
}

.cvp-skeleton-pulse {
    background: linear-gradient(110deg, #1f2937 30%, #2d3748 50%, #1f2937 70%);
    background-size: 200% 100%;
    animation: cvp-skeleton-shimmer 1.5s ease-in-out infinite;
}

.cvp-video-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.cvp-video-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.15);
    border-top-color: #fff;
    border-radius: 50%;
    animation: cvp-spin 0.8s linear infinite;
}

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

.cvp-skeleton-line {
    background: linear-gradient(110deg, #e5e7eb 30%, #f3f4f6 50%, #e5e7eb 70%);
    background-size: 200% 100%;
    animation: cvp-skeleton-shimmer 1.5s ease-in-out infinite;
}

@keyframes cvp-skeleton-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
