/**
 * PalMag AI Video Generator - Cinematic Documentary Player CSS
 */

.palmag-doc-container {
    max-width: 960px;
    margin: 28px auto;
    background: #090d16;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
    font-family: 'Segoe UI', Tahoma, -apple-system, BlinkMacSystemFont, sans-serif;
    color: #ffffff;
    direction: rtl;
    text-align: right;
    position: relative;
}

.palmag-doc-viewport {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000000;
    overflow: hidden;
    cursor: pointer;
}

.palmag-doc-stage {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.palmag-doc-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 1.2s ease-in-out, visibility 1.2s ease-in-out;
    background-size: cover;
    background-position: center;
    transform-origin: center center;
    will-change: transform;
}

.palmag-doc-slide.active {
    opacity: 1;
    visibility: visible;
}

/* Ken Burns Motion Animations */
.palmag-doc-slide.active.motion-zoom-in {
    animation: palmagZoomIn 12s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.palmag-doc-slide.active.motion-zoom-out {
    animation: palmagZoomOut 12s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.palmag-doc-slide.active.motion-pan-left {
    animation: palmagPanLeft 12s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.palmag-doc-slide.active.motion-pan-right {
    animation: palmagPanRight 12s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}

@keyframes palmagZoomIn {
    0% { transform: scale(1); }
    100% { transform: scale(1.18); }
}
@keyframes palmagZoomOut {
    0% { transform: scale(1.18); }
    100% { transform: scale(1); }
}
@keyframes palmagPanLeft {
    0% { transform: scale(1.1) translateX(4%); }
    100% { transform: scale(1.1) translateX(-4%); }
}
@keyframes palmagPanRight {
    0% { transform: scale(1.1) translateX(-4%); }
    100% { transform: scale(1.1) translateX(4%); }
}

/* Cinematic Overlay Gradients */
.palmag-doc-vignette {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(circle at center, transparent 40%, rgba(0, 0, 0, 0.75) 100%),
                linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 35%),
                linear-gradient(to bottom, rgba(0, 0, 0, 0.65) 0%, transparent 25%);
    z-index: 2;
}

/* Watermark & Badges */
.palmag-doc-header-overlay {
    position: absolute;
    top: 16px;
    right: 18px;
    left: 18px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 5;
    pointer-events: none;
}

.palmag-doc-badge-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 12px;
    font-weight: 800;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.palmag-doc-badge-brand .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ef4444;
    box-shadow: 0 0 8px #ef4444;
    animation: palmagPulse 1.8s infinite;
}

@keyframes palmagPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.palmag-doc-badge-duration {
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    color: #f1f5f9;
}

/* Play/Pause Central Button Overlay */
.palmag-doc-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 6;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(2px);
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.palmag-doc-container.playing .palmag-doc-play-overlay {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.palmag-doc-play-btn-circle {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    border: 3px solid rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    color: #ffffff;
    font-size: 28px;
    box-shadow: 0 8px 30px rgba(220, 38, 38, 0.6);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    margin-bottom: 12px;
}

.palmag-doc-play-btn-circle:hover {
    transform: scale(1.1);
    box-shadow: 0 10px 40px rgba(220, 38, 38, 0.8);
}

.palmag-doc-play-btn-circle svg {
    width: 32px;
    height: 32px;
    fill: #ffffff;
    margin-right: -4px;
}

.palmag-doc-play-overlay-title {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.8);
    max-width: 80%;
    text-align: center;
}

/* Subtitles Container */
.palmag-doc-subtitles {
    position: absolute;
    bottom: 24px;
    right: 24px;
    left: 24px;
    z-index: 5;
    text-align: center;
    pointer-events: none;
}

.palmag-doc-subtitle-text {
    display: inline-block;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.6;
    padding: 8px 20px;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
    max-width: 90%;
    animation: palmagSubtitleFade 0.4s ease;
}

@keyframes palmagSubtitleFade {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Controls Bar */
.palmag-doc-controls {
    background: #0f172a;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.palmag-doc-progress-wrap {
    position: relative;
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    cursor: pointer;
    transition: height 0.15s ease;
}

.palmag-doc-progress-wrap:hover {
    height: 8px;
}

.palmag-doc-progress-bar {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    border-radius: 4px;
    width: 0%;
    transition: width 0.1s linear;
}

.palmag-doc-chapter-markers {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.palmag-doc-marker {
    position: absolute;
    top: -2px;
    width: 3px;
    height: 10px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 2px;
    transform: translateX(50%);
}

.palmag-doc-controls-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.palmag-doc-controls-left,
.palmag-doc-controls-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.palmag-doc-btn {
    background: none;
    border: none;
    color: #94a3b8;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s, background 0.15s;
}

.palmag-doc-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.palmag-doc-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.palmag-doc-time {
    font-size: 12px;
    font-weight: 700;
    font-family: monospace;
    color: #cbd5e1;
}

/* Chapter Drawer / Scene Selector */
.palmag-doc-scenes-bar {
    background: #080c14;
    padding: 12px 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

.palmag-doc-scenes-bar::-webkit-scrollbar {
    height: 4px;
}
.palmag-doc-scenes-bar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.palmag-doc-scene-pill {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 11px;
    color: #94a3b8;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.palmag-doc-scene-pill:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.palmag-doc-scene-pill.active {
    background: rgba(220, 38, 38, 0.2);
    border-color: #dc2626;
    color: #fca5a5;
    font-weight: 700;
}

/* Documentary Post Metadata Box */
.palmag-doc-meta-card {
    margin: 24px auto;
    max-width: 960px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 18px 22px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
    direction: rtl;
    text-align: right;
}

.palmag-doc-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

.palmag-doc-meta-item {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.palmag-doc-meta-label {
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
}

.palmag-doc-meta-value {
    font-size: 13px;
    font-weight: 800;
    color: #0f172a;
}
