/* Post Preview Modal Styles */

/* Modal Overlay */
.post-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.post-preview-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Modal Container */
.post-preview-modal {
    background: var(--popup-bg);
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    width: 90%;
    max-width: 800px;
    max-height: calc(100vh - 100px);
    display: flex;
    flex-direction: column;
    transform: scale(0.95) translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.post-preview-overlay.active .post-preview-modal {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.post-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: rgba(155, 155, 155, 0.1);
}

.post-preview-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--body-deep);
}

.post-preview-close {
    background: none;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--body-deep);
    transition: background 0.2s ease, color 0.2s ease;
}

.post-preview-close:hover {
    background: rgba(155, 155, 155, 0.1);
    color: var(--body-deep);
}

.post-preview-close svg {
    width: 20px;
    height: 20px;
}

/* Modal Body */
.post-preview-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
}

/* Loading State */
.post-preview-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--body-deep);
}

.post-preview-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: preview-spin 0.8s linear infinite;
    margin-bottom: 16px;
}

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

/* Error State */
.post-preview-error {
    text-align: center;
    padding: 40px 20px;
    color: var(--error);
}

.post-preview-error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

/* Preview Content Container */
.post-preview-content {
    min-height: 200px;
}

/* Preview Button Styling */
.post-preview-btn {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    color: #fff !important;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-preview-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.post-preview-btn:active {
    transform: translateY(0);
}

.post-preview-btn svg {
    width: 18px;
    height: 18px;
}

/* === Preview Content Styles === */

/* Cover Image for Regular Posts */
.preview-cover-wrapper {
    width: 100%;
    margin-bottom: 20px;
    border-radius: 12px;
    overflow: hidden;
    padding-top: 42%;
    position: relative;
}

.preview-cover-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
}

/* Regular Post Preview */
.post-preview-container .qa-main-heading {
    font-size: 28px;
    font-weight: 700;
    color: var(--body-deep);
    margin: 0 0 16px 0;
    line-height: 1.3;
}

.preview-post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
}

.preview-post-meta .qa-avatar-link {
    width: 40px !important;
    height: 40px !important;
}

.preview-post-meta .qa-avatar-link img {
    height: 40px !important;
    width: 40px !important;
    border-radius: 100%;
    object-fit: cover;
}

.preview-post-meta .rights {
    font-size: 17px;
    font-weight: bold;
    color: var(--body-deep);
}



.qa-q-view-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}




/* Video Type Badge */
.preview-video-type-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    border-radius: 16px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* Launch Logo */
.preview-launch-logo {
    flex-shrink: 0;
}

.preview-launch-logo img {
    width: 80px;
    height: 80px;
    border-radius: 16px;
    object-fit: cover;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ================================
   DARK THEME SUPPORT
   ================================ */

body.dark-theme .post-preview-overlay {
    background: rgba(0, 0, 0, 0.8);
}

body.dark-theme .post-preview-modal {
    background: #1a1a2e;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

body.dark-theme .post-preview-header {
    background: #16162a;
    border-bottom-color: #2d2d4a;
}

body.dark-theme .post-preview-header h3 {
    color: #e5e7eb;
}

body.dark-theme .post-preview-close {
    color: #9ca3af;
}

body.dark-theme .post-preview-close:hover {
    background: #2d2d4a;
    color: #e5e7eb;
}

body.dark-theme .post-preview-body {
    background: #1a1a2e;
}

body.dark-theme .post-preview-loading {
    color: #9ca3af;
}

body.dark-theme .post-preview-spinner {
    border-color: #2d2d4a;
    border-top-color: #6366f1;
}

body.dark-theme .post-preview-error {
    color: #f87171;
}

/* Dark theme preview content */


body.dark-theme .preview-post-meta {
    color: #9ca3af;
}


/* Dark theme video preview */
body.dark-theme .preview-video-type-badge {
    background: #451a03;
    color: #fcd34d;
}

/* Dark theme launch preview */


body.dark-theme .preview-launch-logo img {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}