/* Preview section */
/* Preview section specifically */
.preview-section {
    /* Base card styles now in base.css */
}

.preview-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    width: 100%;
}

#preview-canvas {
    max-width: 100%;
    /* Limit height to viewport - 80px to keep it visible without scrolling */
    max-height: calc(100vh - 80px);
    width: auto;
    /* Allow width to shrink if height is the limiting factor */
    height: auto;
    /* Maintain aspect ratio */
    border: 1px solid #ddd;
    background-color: #000;
    margin-bottom: 10px;
    transform-origin: center center;
    transition: transform 0.1s ease-out;
}

/* Constrain preview when timeline is pinned (fixed at bottom) */
.timeline-pinned #preview-canvas {
    max-height: calc(100vh - 260px);
}

.controls {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin-top: 10px;
}

#seek-slider {
    flex-grow: 1;
    margin: 0 10px;
}

/* Image preview */
.image-preview {
    margin-top: 10px;
    width: 100%;
    height: 200px;
    border: 1px dashed #ccc;
    border-radius: 4px;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background-color: #f0f0f0;
}

.image-preview img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.image-preview .placeholder {
    color: #999;
    text-align: center;
}

/* Preview Zoom Controls */
.preview-zoom-controls {
    position: absolute;
    top: 15px;
    left: 15px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.preview-container:hover .preview-zoom-controls {
    opacity: 1;
}

.zoom-button {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 1.2em;
    transition: background 0.2s;
}

.zoom-button:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Drag Cursors */
.preview-container.can-drag {
    cursor: grab;
}

.preview-container.dragging {
    cursor: grabbing;
}

/* Font preview elements */
.font-preview {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #f9f9f9;
    font-size: 18px;
}

.font-preview-text {
    display: block;
    margin-bottom: 5px;
}

@media (max-width: 767px) {
    #preview-canvas {
        max-height: 70vh;
    }
}