/**
 * UARTIK 3D Personalization - Frontend Styles
 *
 * @package UARTIK
 * @since 1.0.0
 */

/* ==========================================================================
   CONTAINER
   ========================================================================== */

.uartik-3d-personalization {
    margin: 0 0 30px 0;
    padding: 0;
}

/* ==========================================================================
   SECTION
   ========================================================================== */

.uartik-3d-section {
    margin-bottom: 25px;
    padding: 0;
}

.uartik-3d-title {
    margin: 0 0 20px 0;
    padding: 0 0 12px 0;
    font-size: 16px;
    font-weight: 700;
    color: var(--uartik-text);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.uartik-3d-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(135deg, var(--uartik-primary, #C06C84) 0%, var(--uartik-primary-hover, #9E5268) 100%);
    border-radius: 2px;
}

.uartik-3d-title-icon {
    width: 20px;
    height: 20px;
    color: var(--uartik-primary, #C06C84);
    display: flex;
    align-items: center;
    justify-content: center;
}

.uartik-3d-title-icon svg {
    width: 100%;
    height: 100%;
}

.uartik-3d-title abbr.required {
    color: var(--uartik-primary);
    text-decoration: none;
    font-weight: 600;
}

/* ==========================================================================
   DROPZONE
   ========================================================================== */

.uartik-3d-dropzone {
    border: 2px dashed #E5DED6;
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #FAFAF8;
}

.uartik-3d-dropzone:hover {
    border-color: var(--uartik-primary, #C06C84);
    background: #FFF5F7;
}

.uartik-3d-dropzone.dragging {
    border-color: var(--uartik-primary, #C06C84);
    background: #FFF5F7;
    border-style: solid;
    box-shadow: 0 0 0 4px rgba(192, 108, 132, 0.15);
}

.uartik-3d-dropzone.has-error {
    border-color: #dc3232;
    background: #FFF5F5;
}

.uartik-3d-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.uartik-3d-dropzone-icon {
    width: 48px;
    height: 48px;
    color: var(--uartik-primary, #C06C84);
    opacity: 0.7;
    transition: all 0.3s ease;
}

.uartik-3d-dropzone:hover .uartik-3d-dropzone-icon,
.uartik-3d-dropzone.dragging .uartik-3d-dropzone-icon {
    opacity: 1;
    transform: translateY(-3px);
}

.uartik-3d-dropzone-icon svg {
    width: 100%;
    height: 100%;
}

.uartik-3d-dropzone-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--uartik-text, #2D2D2D);
}

.uartik-3d-dropzone-formats {
    font-size: 13px;
    color: var(--uartik-text-muted, #5A5A5A);
}

.uartik-3d-dropzone-resolution {
    font-size: 12px;
    color: var(--uartik-text-light, #7A7A7A);
}

/* Hidden when preview is shown */
.uartik-3d-section.has-photo .uartik-3d-dropzone {
    display: none;
}

/* ==========================================================================
   UPLOAD PROGRESS
   ========================================================================== */

.uartik-3d-upload-progress {
    padding: 20px;
    text-align: center;
    background: #FAFAF8;
    border-radius: 12px;
    border: 2px solid #E5DED6;
}

.uartik-3d-progress-bar {
    height: 6px;
    background: #E5DED6;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 10px;
}

.uartik-3d-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--uartik-primary, #C06C84), var(--uartik-primary-hover, #9E5268));
    border-radius: 3px;
    transition: width 0.3s ease;
    animation: uartik-3d-progress-pulse 1.5s ease-in-out infinite;
}

@keyframes uartik-3d-progress-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.uartik-3d-progress-text {
    font-size: 13px;
    color: var(--uartik-text-muted, #5A5A5A);
}

/* ==========================================================================
   PREVIEW
   ========================================================================== */

.uartik-3d-preview {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 2px solid var(--uartik-primary, #C06C84);
    border-radius: 12px;
    position: relative;
    box-shadow: 0 0 0 3px rgba(192, 108, 132, 0.1);
}

.uartik-3d-preview-image {
    width: 70px;
    height: 70px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.uartik-3d-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.uartik-3d-preview-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.uartik-3d-preview-filename {
    font-size: 14px;
    font-weight: 600;
    color: var(--uartik-text, #2D2D2D);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.uartik-3d-preview-size,
.uartik-3d-preview-dimensions {
    font-size: 12px;
    color: var(--uartik-text-muted, #5A5A5A);
}

.uartik-3d-preview-remove {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: #f5f5f5;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #666;
    /* Reset Kadence button defaults */
    font-size: 0;
    line-height: 0;
    box-shadow: none;
    min-width: 0;
    min-height: 0;
}

.uartik-3d-preview-remove:hover {
    background: #dc3232;
    color: #fff;
}

.uartik-3d-preview-remove svg {
    width: 14px !important;
    height: 14px !important;
    min-width: 14px !important;
    min-height: 14px !important;
    stroke: currentColor !important;
    fill: none !important;
    display: block !important;
}

.uartik-3d-preview-check {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background: var(--uartik-primary, #C06C84);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    animation: uartik-3d-check-in 0.3s ease;
}

.uartik-3d-preview-check svg {
    width: 14px;
    height: 14px;
}

@keyframes uartik-3d-check-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* ==========================================================================
   WARNING MESSAGE
   ========================================================================== */

.uartik-3d-warning {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #FFF8E5;
    border: 1px solid #F0D070;
    border-radius: 8px;
    margin-top: 12px;
}

.uartik-3d-warning-icon {
    width: 20px;
    height: 20px;
    color: #D4A012;
    flex-shrink: 0;
}

.uartik-3d-warning-icon svg {
    width: 100%;
    height: 100%;
}

.uartik-3d-warning-text {
    font-size: 13px;
    color: #856404;
    line-height: 1.4;
}

/* ==========================================================================
   ERROR MESSAGE
   ========================================================================== */

.uartik-3d-error {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    background: #FFF5F5;
    border: 1px solid #F5C6CB;
    border-radius: 8px;
    margin-top: 12px;
}

.uartik-3d-error-icon {
    width: 20px;
    height: 20px;
    color: #dc3232;
    flex-shrink: 0;
}

.uartik-3d-error-icon svg {
    width: 100%;
    height: 100%;
}

.uartik-3d-error-text {
    font-size: 13px;
    color: #721c24;
    line-height: 1.4;
}

/* ==========================================================================
   TEXT INPUT
   ========================================================================== */

.uartik-3d-text-wrapper {
    position: relative;
}

.uartik-3d-textarea {
    width: 100%;
    min-height: 100px;
    padding: 15px;
    border: 2px solid #E5DED6;
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    line-height: 1.5;
    resize: vertical;
    transition: all 0.3s ease;
    background: #fff;
}

.uartik-3d-textarea:focus {
    outline: none;
    border-color: var(--uartik-primary, #C06C84);
    box-shadow: 0 0 0 3px rgba(192, 108, 132, 0.15);
}

.uartik-3d-textarea::placeholder {
    color: var(--uartik-text-light, #7A7A7A);
}

.uartik-3d-textarea.has-error {
    border-color: #dc3232;
}

.uartik-3d-text-counter {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 12px;
    color: var(--uartik-text-light, #7A7A7A);
    background: #fff;
    padding: 2px 5px;
    border-radius: 4px;
}

.uartik-3d-text-counter.limit-warning {
    color: #D4A012;
}

.uartik-3d-text-counter.limit-reached {
    color: #dc3232;
}

/* ==========================================================================
   CART DISPLAY
   ========================================================================== */

.uartik-3d-cart-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    vertical-align: middle;
}

/* Cart item with 3D data */
.cart_item .uartik-3d-cart-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed #E5DED6;
}

.cart_item .uartik-3d-cart-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
}

.cart_item .uartik-3d-cart-label {
    color: var(--uartik-text-light, #7A7A7A);
    font-weight: 400;
}

.cart_item .uartik-3d-cart-value {
    color: var(--uartik-text, #2D2D2D);
    font-weight: 500;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {
    .uartik-3d-dropzone {
        padding: 25px 15px;
    }

    .uartik-3d-dropzone-icon {
        width: 40px;
        height: 40px;
    }

    .uartik-3d-dropzone-text {
        font-size: 14px;
    }

    .uartik-3d-preview {
        flex-wrap: wrap;
        padding: 12px;
    }

    .uartik-3d-preview-image {
        width: 60px;
        height: 60px;
    }

    .uartik-3d-preview-info {
        flex: 1 1 calc(100% - 90px);
    }

    .uartik-3d-textarea {
        min-height: 80px;
        padding: 12px;
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .uartik-3d-title {
        font-size: 15px;
    }

    .uartik-3d-preview {
        flex-direction: column;
        text-align: center;
    }

    .uartik-3d-preview-info {
        align-items: center;
    }

    .uartik-3d-preview-remove {
        top: 8px;
        right: 8px;
    }

    .uartik-3d-preview-check {
        bottom: auto;
        top: 8px;
        right: 45px;
    }
}
