/**
 * Frontend Uppy Uploader for Vendors
 * Custom CSS for vendor dashboard integration
 */

/* Base styling for all themes */
.DashboardContainer {
    margin: 20px 0;
    width: 100%;
}

.uppy-Dashboard {
    border: 1px solid #e5e5e5;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
}

.uppy-Dashboard-inner {
    background-color: #fff;
}

/* First image upload indicator */
.dokan-dashboard .first-image-uploader .uppy-Dashboard-note {
    color: #f05025;
    font-weight: bold;
}

.dokan-dashboard .first-image-uploader .uppy-Dashboard-AddFiles {
    border: 2px dashed #f05025;
    position: relative;
    transition: all 0.3s ease;
}

.dokan-dashboard .first-image-uploader .uppy-Dashboard-AddFiles:before {
    content: "⭐ Featured Image";
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f05025;
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 12px;
    z-index: 10;
}

/* Dokan specific styling */
.uppy-theme-dokan .uppy-Dashboard-inner {
    background-color: #f8f8f8;
}

.uppy-theme-dokan .uppy-Dashboard-AddFiles {
    border: 1px dashed #ddd;
}

.dokan-dashboard .uppy-Dashboard-browse {
    color: #f05025;
}

/* Enhanced Dokan integration */
.dokan-dashboard .dokan-uppy-container {
    margin: 15px 0;
    width: 100%;
}

.dokan-dashboard .dokan-feat-image-upload .dokan-uppy-container,
.dokan-dashboard .featured-image .dokan-uppy-container {
    max-width: 100%;
}

.dokan-dashboard .dokan-product-gallery .dokan-uppy-container {
    max-width: 100%;
}

.dokan-dashboard .uppy-Dashboard {
    border: 1px dashed #ddd;
    border-radius: 3px;
    margin-bottom: 15px;
}

.dokan-dashboard .uppy-Dashboard-inner {
    background-color: #f8f8f8;
}

.dokan-dashboard .uppy-DashboardContent-bar {
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
}

.dokan-dashboard .uppy-StatusBar {
    background-color: #f8f8f8;
}

.dokan-dashboard .uppy-StatusBar-actionBtn--upload {
    background-color: #f05025;
    border-color: #f05025;
}

.dokan-dashboard .uppy-StatusBar-actionBtn--upload:hover {
    background-color: #dc4b23;
    border-color: #dc4b23;
}

/* Hide original Dokan upload UI when Uppy is active */
.dokan-dashboard .dokan-feat-image-upload.uppy-initialized .instruction-inside,
.dokan-dashboard .dokan-product-gallery.uppy-initialized .instruction-inside {
    display: none;
}

/* Additional Dokan upload element hiding */
.dokan-dashboard .dokan-feat-image-upload.uppy-initialized .dokan-feat-image-btn,
.dokan-dashboard .dokan-product-gallery.uppy-initialized .add-product-images,
.dokan-dashboard .featured-image.uppy-initialized .instruction-inside,
.dokan-dashboard .product-gallery-image.uppy-initialized .instruction-inside {
    display: none !important;
}

/* Hide the original Dokan upload button */
.dokan-dashboard .dokan-feat-image-upload.uppy-initialized .fas.fa-cloud-upload-alt,
.dokan-dashboard .featured-image.uppy-initialized .fas.fa-cloud-upload-alt {
    display: none !important;
}

/* Position the Uppy container properly */
.dokan-dashboard .dokan-feat-image-upload.uppy-initialized .dokan-uppy-container,
.dokan-dashboard .featured-image.uppy-initialized .dokan-uppy-container {
    margin-top: 0;
}

/* Hide the original gallery add button */
.dokan-dashboard .dokan-product-gallery.uppy-initialized .add-image.add-product-images {
    display: none !important;
}

/* Dokan gallery "Set as featured" buttons styling */
.dokan-dashboard .product_images li.image {
    position: relative;
}

.dokan-dashboard .product_images li.image .uppy-set-featured {
    position: absolute;
    top: 5px;
    right: 25px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    cursor: pointer;
    z-index: 50;
    text-decoration: none;
    opacity: 0;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.dokan-dashboard .product_images li.image:hover .uppy-set-featured {
    opacity: 1;
}

.dokan-dashboard .product_images li.image .uppy-set-featured:hover {
    background-color: #f05025;
}

/* Featured image indicator in Dokan gallery */
.dokan-dashboard .product_images li.image.is-featured {
    border: 2px solid #f05025 !important;
}

.dokan-dashboard .product_images li.image.is-featured:after {
    content: "Featured";
    position: absolute;
    top: 5px;
    left: 5px;
    background: #f05025;
    color: white;
    padding: 2px 5px;
    border-radius: 3px;
    font-size: 10px;
    z-index: 50;
}

/* Better image preview styling */
.dokan-dashboard .dokan-feat-image-upload .image-wrap img,
.dokan-dashboard .featured-image .image-wrap img {
    max-width: 100%;
    height: auto;
    display: block;
    border: 1px solid #eee;
}

/* Improve Dokan uploader appearance */
.dokan-dashboard .uppy-Dashboard-AddFiles {
    border: 2px dashed #ddd;
    border-radius: 3px;
    background: #fafafa;
    transition: all 0.3s ease;
}

.dokan-dashboard .uppy-Dashboard-AddFiles:hover {
    border-color: #f05025;
    background: #fff;
}

.dokan-dashboard .uppy-Dashboard-dropFilesHereHint {
    color: #666;
    font-size: 16px;
}

/* Auto-upload indicator */
.dokan-dashboard .uppy-DashboardContent-addMore,
.dokan-dashboard .uppy-DashboardContent-back {
    color: #f05025;
}

.dokan-dashboard .uppy-DashboardContent-addMore:hover,
.dokan-dashboard .uppy-DashboardContent-back:hover {
    color: #dc4b23;
}

/* Success messages */
.dokan-dashboard .dokan-alert-success {
    background-color: #dff0d8;
    border-color: #d6e9c6;
    color: #3c763d;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 3px;
}

/* Error messages */
.dokan-dashboard .dokan-alert-danger {
    background-color: #f2dede;
    border-color: #ebccd1;
    color: #a94442;
    padding: 8px 12px;
    margin: 10px 0;
    border-radius: 3px;
}

/* WCFM specific styling */
.uppy-theme-wcfm .uppy-Dashboard-inner {
    background-color: #fff;
}

.wcfm-dashboard-page .uppy-Dashboard-browse {
    color: #17a2b8;
}

/* WC Marketplace specific styling */
.uppy-theme-wcmp .uppy-Dashboard-inner {
    background-color: #fafafa;
}

.wcmp-dashboard .uppy-Dashboard-browse {
    color: #996de9;
}

/* WC Vendors specific styling */
.uppy-theme-wc-vendors .uppy-Dashboard-inner {
    background-color: #fff;
}

.wc-vendors-dashboard .uppy-Dashboard-browse {
    color: #7f54b3;
}

/* Responsive adjustments */
@media screen and (max-width: 768px) {
    .uppy-Dashboard {
        max-width: 100%;
    }
    
    .uppy-Dashboard-files {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .dokan-dashboard .dokan-uppy-container {
        height: auto;
        min-height: 300px;
    }
    
    /* Smaller featured button on mobile */
    .dokan-dashboard .product_images li.image .uppy-set-featured {
        font-size: 10px;
        padding: 2px 5px;
        right: 20px;
        opacity: 1; /* Always visible on mobile */
    }
}

/* Button styling to match vendor dashboards */
.uppy-StatusBar-actionBtn--upload {
    background-color: #0073aa;
    border-color: #0073aa;
}

.dokan-dashboard .uppy-StatusBar-actionBtn--upload {
    background-color: #f05025;
    border-color: #f05025;
}

.wcfm-dashboard-page .uppy-StatusBar-actionBtn--upload {
    background-color: #17a2b8;
    border-color: #17a2b8;
}

.wcmp-dashboard .uppy-StatusBar-actionBtn--upload {
    background-color: #996de9;
    border-color: #996de9;
}

.wc-vendors-dashboard .uppy-StatusBar-actionBtn--upload {
    background-color: #7f54b3;
    border-color: #7f54b3;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .uppy-Dashboard-inner {
        background-color: #32373c;
        color: #f0f0f1;
    }
    
    .uppy-Dashboard-AddFiles {
        border-color: #50575e;
    }
    
    .uppy-Dashboard-browse {
        color: #00b9eb;
    }
} 