/* Box Logo Upload - Frontend Styles */

.ublu-container {
    margin-bottom: 25px;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    background: #fff;
    overflow: hidden;
    font-family: inherit;
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
}

.ublu-header {
    padding: 15px 20px;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.ublu-container.is-active .ublu-header {
    border-bottom: 1px solid #e5e5e5;
    background-color: #fafafa;
}

/* Custom Checkbox */
.ublu-checkbox-wrapper {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin: 0;
}

.ublu-checkbox-wrapper input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.ublu-checkbox-custom {
    height: 22px;
    width: 22px;
    background-color: #fff;
    border: 2px solid #ccc;
    border-radius: 6px;
    margin-right: 12px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.ublu-container[dir="rtl"] .ublu-checkbox-custom {
    margin-right: 0;
    margin-left: 12px;
}

.ublu-checkbox-wrapper:hover input ~ .ublu-checkbox-custom {
    border-color: #F05824;
}

.ublu-checkbox-wrapper input:checked ~ .ublu-checkbox-custom {
    background-color: #F05824;
    border-color: #F05824;
}

.ublu-checkbox-custom:after {
    content: "";
    position: absolute;
    display: none;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.ublu-checkbox-wrapper input:checked ~ .ublu-checkbox-custom:after {
    display: block;
}

.ublu-checkbox-text {
    font-weight: 600;
    font-size: 16px;
    color: #333;
}

.ublu-checkbox-wrapper input:checked ~ .ublu-checkbox-text {
    color: #F05824;
}

/* Content Area */
.ublu-content-wrapper {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    padding: 0 20px;
}

.ublu-container.is-active .ublu-content-wrapper {
    max-height: 1000px; /* arbitrary large value for transition */
    opacity: 1;
    padding: 20px;
}

.ublu-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.ublu-titles {
    display: flex;
    flex-direction: column;
}

.ublu-main-label {
    font-weight: bold;
    font-size: 16px;
    color: #000;
}

.ublu-description {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.ublu-price-tag {
    background: #F05824;
    color: #fff;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* Upload Area */
.ublu-upload-area {
    border: 2px dashed #ccc;
    border-radius: 8px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    background: #fafafa;
}

.ublu-upload-area:hover, .ublu-upload-area.is-dragover {
    border-color: #F05824;
    background: rgba(240, 88, 36, 0.03);
}

.ublu-btn {
    background-color: #F05824;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease;
    width: 100%;
    max-width: 250px;
}

.ublu-btn:hover {
    background-color: #d84b1b;
}

.ublu-formats-hint {
    margin-top: 12px;
    font-size: 12px;
    color: #888;
}

/* Loading */
.ublu-upload-progress {
    margin-top: 15px;
    font-size: 14px;
    color: #F05824;
    font-weight: 500;
}

/* Preview Area */
.ublu-preview-area {
    text-align: center;
}

.ublu-preview-visual {
    position: relative;
    max-width: 400px;
    margin: 0 auto 20px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.ublu-box-base {
    width: 100%;
    height: auto;
    display: block;
}

/* The magic overlay container, positioned exactly over the box's circle */
.ublu-logo-overlay-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 45%; /* Approximate size of the circle relative to the box */
    height: 45%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.3s ease;
}

.ublu-logo-overlay {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: all 0.3s ease;
}

/* Blend mode (Default) */
.ublu-logo-overlay.mix-blend {
    mix-blend-mode: screen; /* Best for black background to drop out black/dark colors from logo, but since box is black, screen will make white backgrounds stay white. For UV DTF, that's realistic. */
}

/* Sticker mode */
.ublu-logo-overlay-container.is-sticker {
    background-color: #ffffff;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.1);
}
.ublu-logo-overlay-container.is-sticker .ublu-logo-overlay {
    mix-blend-mode: normal;
}

/* PDF Preview */
.ublu-pdf-preview {
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
    color: #555;
}

.ublu-pdf-preview svg {
    margin-bottom: 10px;
    color: #F05824;
}

.ublu-pdf-preview span {
    font-size: 14px;
    font-weight: 500;
    word-break: break-all;
}

/* Actions */
.ublu-preview-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.ublu-btn-text {
    background: none;
    border: none;
    color: #555;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    padding: 5px 10px;
}

.ublu-btn-text:hover {
    color: #000;
}

.ublu-text-danger {
    color: #d32f2f;
}

.ublu-text-danger:hover {
    color: #b71c1c;
}

/* Toggle Switch for Mode */
.ublu-toggle-sticker {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 13px;
    color: #666;
    margin-left: auto;
}

.ublu-container[dir="rtl"] .ublu-toggle-sticker {
    margin-left: 0;
    margin-right: auto;
}

.ublu-toggle-sticker input {
    margin-right: 6px;
    accent-color: #F05824;
}

.ublu-container[dir="rtl"] .ublu-toggle-sticker input {
    margin-right: 0;
    margin-left: 6px;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .ublu-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .ublu-preview-actions {
        flex-direction: column;
    }
    
    .ublu-toggle-sticker {
        margin: 10px auto 0;
    }
}
