/* previewSizes.css - Preview dimensions for different types */

:root {
    --preview-scale: 2.5;  /* Adjusted scale for mobile-friendly size */
    --preview-base-width: 1080px;
}

/* HD Preview - 438px width, calculated height based on 1080x1920 aspect ratio */
.kilo-flyers-template-preview.hd-preview {
    width: 438px;
    height: 778px; /* 438 / 0.5625 = 778px (1080/1920 aspect ratio) */
    display: inline-block;
}

/* Post Preview - 438px width, calculated height based on 1080x1350 aspect ratio */
.kilo-flyers-template-preview.post-preview {
    width: 438px;
    height: 547px; /* 438 / 0.8 = 547px (1080/1350 aspect ratio) */
    display: inline-block;
}

/* Square Preview - 438x438 */
.kilo-flyers-template-preview.square-preview {
    width: 438px;
    height: 438px;
    display: inline-block;
}

/* Banner Preview - Exactly 1314x438 with horizontal scroll */
.kilo-flyers-template-preview.banner-preview {
    width: 1314px;
    height: 438px;
    display: inline-block;
}

/* Preview container styles */
.kilo-flyers-template-preview {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Clip portraits to preview window */
    border: 3px solid #ffffff; /* White outline for generated views */
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.5);
}

/* Preview image sizes - using the same dimensions as their containers */
.kilo-flyers-template-preview img.background,
.kilo-flyers-template-preview img.foreground {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Z-index for layers */
.kilo-flyers-template-preview img.background {
    z-index: 1;
}

.kilo-flyers-template-preview img.foreground {
    z-index: 3;
    pointer-events: none; /* Allow clicking through foreground to text layers */
}

/* Preview interaction styles */
.kilo-flyers-template-preview {
    position: relative;  /* Create stacking context for absolute children */
    overflow: hidden;    /* Clip portraits to preview window */
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
}

.kilo-flyers-template-preview.selected {
    border-color: white;
}

/* Client version - Show all 4 preview types */

/* Show all preview types in correct order: HD, Post, Square, Banner */
.hd-preview {
    display: inline-block !important;
    margin: 10px;
    vertical-align: bottom; /* Align from bottom */
    order: 1; /* HD first */
}

.post-preview {
    display: inline-block !important;
    margin: 10px;
    vertical-align: bottom; /* Align from bottom */
    order: 2; /* Post second */
}

.square-preview {
    display: inline-block !important;
    margin: 10px;
    vertical-align: bottom; /* Align from bottom */
    order: 3; /* Square third */
}

.banner-preview {
    display: inline-block !important;
    margin: 10px;
    vertical-align: bottom; /* Align from bottom */
    order: 4; /* Banner last */
}

/* Hide editing tools popup - causes conflicts */
.editing-tools-popup {
    display: none !important;
}

/* Adjust preview container for multiple previews */
.preview-container {
    display: flex;
    justify-content: flex-start; /* Start from left to enable scroll */
    align-items: flex-end; /* Align from bottom */
    padding: 20px 10px;
    overflow-x: auto; /* Enable horizontal scrolling */
    overflow-y: hidden; /* Prevent vertical scroll */
    width: 100%;
}

.preview {
    display: flex;
    justify-content: flex-start; /* Start from left */
    align-items: flex-end; /* Align from bottom */
    gap: 15px;
    min-width: max-content; /* Allow content to extend beyond container */
    flex-wrap: nowrap; /* Force single row */
}

/* Enable preview interactions for portrait and text layers */
.kilo-flyers-template-preview {
    pointer-events: auto; /* Enable interactions */
}

.kilo-flyers-template-preview img.preview-portrait {
    pointer-events: auto; /* Ensure portrait is interactive */
    z-index: 2; /* Between background and foreground */
}


