/**
 * Dokan Products Dashboard Styles
 *
 * Enhanced styling for the products dashboard and related pages
 */

/* Products Dashboard */
.dokan-product-listing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e1e1e1;
}

.dokan-product-listing-header h1 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

/* Filters Section - Enhanced Design */
.dokan-product-filters,
.dokan-album-filters {
    background: #ffffff;
    padding: 25px;
    margin-bottom: 25px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.dokan-product-filters .dokan-form-inline,
.dokan-album-filters .dokan-form-inline {
    display: flex;
    align-items: flex-end;
    gap: 15px;
    flex-wrap: wrap;
}

.dokan-product-filters .dokan-form-group,
.dokan-album-filters .dokan-form-group {
    flex: 1;
    min-width: 180px;
    margin-bottom: 0;
}

.dokan-product-filters .dokan-form-group:last-child,
.dokan-album-filters .dokan-form-group:last-child {
    flex: 0;
    min-width: auto;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.dokan-product-filters .dokan-control-label,
.dokan-album-filters .dokan-control-label {
    font-size: 13px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: block;
}

/* Bulk Actions */
.dokan-bulk-actions {
    background: #ffffff;
    padding: 18px 20px;
    margin-bottom: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.dokan-bulk-actions .dokan-form-inline {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.dokan-bulk-actions .dokan-control-label {
    margin: 0;
    font-weight: 600;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dokan-bulk-actions input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Product & Album Tables - Enhanced Design */
.dokan-product-table-wrapper,
.dokan-album-table-wrapper {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    overflow: hidden;
    border: 1px solid #e1e4e8;
}

.product-listing-table,
.album-listing-table {
    margin: 0;
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.product-listing-table th,
.album-listing-table th {
    background: #f6f8fa;
    border-bottom: 2px solid #e1e4e8;
    font-weight: 700;
    color: #24292e;
    padding: 16px 18px;
    text-align: left;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    position: sticky;
    top: 0;
    z-index: 10;
}

.product-listing-table td,
.album-listing-table td {
    padding: 16px 18px;
    vertical-align: middle;
    border-bottom: 1px solid #f1f3f5;
    transition: all 0.2s ease;
    font-size: 14px;
    color: #24292e;
}

.product-listing-table tbody tr,
.album-listing-table tbody tr {
    transition: all 0.3s ease;
}

.product-listing-table tbody tr:hover,
.album-listing-table tbody tr:hover {
    background-color: #f8f9ff;
    transform: scale(1.005);
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.08);
}

.product-listing-table tbody tr:last-child td,
.album-listing-table tbody tr:last-child td {
    border-bottom: none;
}

/* Product & Album Images */
.product-image img,
.album-image img {
    border-radius: 6px;
    object-fit: cover;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-image img:hover,
.album-image img:hover {
    transform: scale(1.1);
}

.no-image {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    color: #6c757d;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
}

.no-image:hover {
    border-color: #adb5bd;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

/* Product Name */
.product-name strong {
    display: block;
    margin-bottom: 4px;
}

.product-excerpt {
    margin: 0;
    color: #6c757d;
    font-size: 13px;
    line-height: 1.4;
}

/* Product Status */
.product-status {
    text-align: center;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.status-published {
    background: #d4edda;
    color: #155724;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

/* Product Categories */
.product-categories .category-tag {
    display: inline-block;
    background: #e9ecef;
    color: #495057;
    padding: 2px 6px;
    margin: 2px;
    border-radius: 3px;
    font-size: 11px;
}

.more-categories {
    color: #6c757d;
    font-style: italic;
}

.no-categories {
    color: #adb5bd;
    font-style: italic;
}

/* Product Actions */
.product-actions .dokan-action-buttons {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.product-actions .dokan-btn {
    padding: 6px 10px;
    font-size: 12px;
}

/* Product & Album View Pages - Enhanced Design */
.dokan-product-view-area,
.dokan-album-view-area {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.12);
    overflow: hidden;
    animation: fadeInUp 0.4s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dokan-product-view-header,
.dokan-album-view-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.dokan-product-view-header::before,
.dokan-album-view-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.dokan-product-view-header h1,
.dokan-album-view-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dokan-product-view-header .dokan-btn,
.dokan-album-view-header .dokan-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    backdrop-filter: blur(10px);
}

.dokan-product-view-header .dokan-btn:hover,
.dokan-album-view-header .dokan-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

.dokan-product-view-content,
.dokan-album-view-content {
    padding: 30px;
}

.dokan-product-section,
.dokan-album-section {
    margin-bottom: 35px;
    padding-bottom: 30px;
    border-bottom: 2px solid #f1f3f5;
    position: relative;
}

.dokan-product-section:last-of-type,
.dokan-album-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0;
}

.dokan-product-section h3,
.dokan-album-section h3 {
    margin: 0 0 20px 0;
    color: #495057;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.dokan-product-section h3::before,
.dokan-album-section h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.dokan-product-section .dokan-table,
.dokan-album-section .dokan-table {
    background: #fafbfc;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.dokan-product-section .dokan-table th,
.dokan-album-section .dokan-table th {
    background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
    font-weight: 600;
    color: #495057;
    padding: 12px 16px;
    border: none;
    text-align: left;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dokan-product-section .dokan-table td,
.dokan-album-section .dokan-table td {
    padding: 14px 16px;
    border: none;
    border-bottom: 1px solid #e9ecef;
    line-height: 1.6;
}

.dokan-product-section .dokan-table tr:last-child td,
.dokan-album-section .dokan-table tr:last-child td {
    border-bottom: none;
}

.product-description,
.album-description {
    background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
    padding: 20px;
    border-radius: 8px;
    line-height: 1.8;
    border-left: 4px solid #667eea;
    font-size: 15px;
}

.product-categories,
.album-categories,
.album-cities {
    padding: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.category-tag,
.city-tag {
    display: inline-flex;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.category-tag:hover,
.city-tag:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.5);
}

.album-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #007cba;
    text-decoration: none;
    padding: 12px 18px;
    background: linear-gradient(135deg, #f0f8ff 0%, #e0f0ff 100%);
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 600;
    border: 2px solid #b3d9f2;
}

.album-link:hover {
    background: linear-gradient(135deg, #e0f0ff 0%, #d0e8ff 100%);
    color: #005a87;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.2);
}

/* Product & Album Images in View */
.dokan-product-image,
.dokan-album-image {
    text-align: center;
    padding: 20px;
    background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
    border-radius: 12px;
}

.dokan-product-image img,
.dokan-album-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    transition: transform 0.3s ease;
}

.dokan-product-image img:hover,
.dokan-album-image img:hover {
    transform: scale(1.02);
}

.no-image-large {
    width: 250px;
    height: 250px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 3px dashed #dee2e6;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    color: #6c757d;
    font-size: 18px;
    font-weight: 600;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.no-image-large:hover {
    border-color: #adb5bd;
    background: linear-gradient(135deg, #e9ecef 0%, #dee2e6 100%);
}

/* Product & Album Edit Page Headers */
.dokan-product-edit-header,
.dokan-album-edit-header {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 30px;
    display: flex;
    align-items: center;
    gap: 20px;
    position: relative;
    overflow: hidden;
}

.dokan-product-edit-header::before,
.dokan-album-edit-header::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
}

.dokan-product-edit-header h1,
.dokan-album-edit-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.dokan-product-edit-header .dokan-btn,
.dokan-album-edit-header .dokan-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    backdrop-filter: blur(10px);
}

.dokan-product-edit-header .dokan-btn:hover,
.dokan-album-edit-header .dokan-btn:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.5);
}

/* Product & Album View Actions */
.dokan-product-view-actions,
.dokan-album-view-actions {
    background: linear-gradient(180deg, #f8f9fa 0%, #f1f3f5 100%);
    padding: 25px 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    border-top: 2px solid #e9ecef;
}

.dokan-product-view-actions .dokan-btn,
.dokan-album-view-actions .dokan-btn {
    min-width: 140px;
    justify-content: center;
}

/* Form Enhancements */
.dokan-form-group {
    margin-bottom: 25px;
    position: relative;
}

.dokan-form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: #fff;
}

.dokan-form-control:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.dokan-form-control:disabled {
    background: #f8f9fa;
    cursor: not-allowed;
}

.dokan-control-label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    display: inline-block;
    font-size: 14px;
}

/* File Input Improvements */
.dokan-feat-image-upload {
    border: 2px dashed #dee2e6;
    padding: 25px 20px;
    text-align: center;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: #fafbfc;
    position: relative;
    cursor: pointer;
}

.dokan-feat-image-upload:hover {
    border-color: #667eea;
    background: #f8f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.dokan-feat-image-upload input[type="file"] {
    cursor: pointer;
}

.dokan-image-preview {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: transform 0.3s ease;
}

.dokan-image-preview:hover {
    transform: scale(1.02);
}

/* Better Button Styles */
.dokan-btn {
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
}

.dokan-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.dokan-btn:active {
    transform: translateY(0);
}

.dokan-btn-theme,
.dokan-btn-danger {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.dokan-btn-theme:hover,
.dokan-btn-danger:hover {
    background: linear-gradient(135deg, #5568d3 0%, #63408a 100%);
}

.dokan-btn-default {
    background: #f8f9fa;
    color: #495057;
    border: 1px solid #dee2e6;
}

.dokan-btn-default:hover {
    background: #e9ecef;
}

.dokan-btn-primary {
    background: #007cba;
    color: white;
}

.dokan-btn-primary:hover {
    background: #006ba1;
}

.dokan-btn-warning {
    background: #ffc107;
    color: #212529;
}

.dokan-btn-warning:hover {
    background: #e0a800;
}

.dokan-btn-info {
    background: #17a2b8;
    color: white;
}

.dokan-btn-info:hover {
    background: #138496;
}

.dokan-btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

/* Textarea Improvements */
textarea.dokan-form-control {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

/* Select Improvements */
select.dokan-form-control {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23495057' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 35px;
    appearance: none;
}

/* Notices - Modern Toast Style */
#dokan-notifications-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: 999999;
    max-width: 400px;
    width: 100%;
    pointer-events: none;
}

.dokan-notice {
    padding: 16px 20px;
    margin-bottom: 15px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    animation: slideInRight 0.3s ease;
    position: relative;
    overflow: hidden;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.dokan-notice.fade-out {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.dokan-notice::before {
    content: '';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 18px;
    flex-shrink: 0;
}

.dokan-notice-success {
    background: #d4edda;
    color: #155724;
    border-left: 4px solid #28a745;
}

.dokan-notice-success::before {
    content: '\f058';
    color: #28a745;
}

.dokan-notice-error {
    background: #f8d7da;
    color: #721c24;
    border-left: 4px solid #dc3545;
}

.dokan-notice-error::before {
    content: '\f06a';
    color: #dc3545;
}

.dokan-notice-warning {
    background: #fff3cd;
    color: #856404;
    border-left: 4px solid #ffc107;
}

.dokan-notice-warning::before {
    content: '\f071';
    color: #ffc107;
}

.dokan-notice-info {
    background: #d1ecf1;
    color: #0c5460;
    border-left: 4px solid #17a2b8;
}

.dokan-notice-info::before {
    content: '\f05a';
    color: #17a2b8;
}

.dokan-notice p {
    margin: 0;
    line-height: 1.5;
    flex: 1;
}

.dokan-notice-close {
    background: none;
    border: none;
    font-size: 20px;
    color: inherit;
    opacity: 0.5;
    cursor: pointer;
    padding: 0;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.2s;
}

.dokan-notice-close:hover {
    opacity: 1;
}

/* Responsive Design - Enhanced Mobile Experience */
@media (max-width: 768px) {
    /* Notifications Container */
    #dokan-notifications-container {
        top: 60px;
        right: 10px;
        left: 10px;
        max-width: 100%;
    }

    .dokan-notice {
        padding: 14px 16px;
        font-size: 13px;
    }

    /* Headers */
    .dokan-product-listing-header,
    .dokan-album-listing-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .dokan-product-listing-header h1,
    .dokan-album-listing-header h1 {
        font-size: 20px;
    }

    /* Bulk Actions */
    .dokan-bulk-actions .dokan-form-inline {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    /* View & Edit Headers */
    .dokan-product-view-header,
    .dokan-product-edit-header,
    .dokan-album-view-header,
    .dokan-album-edit-header {
        flex-direction: column;
        text-align: center;
        gap: 10px;
        padding: 20px;
    }

    .dokan-product-view-header h1,
    .dokan-product-edit-header h1,
    .dokan-album-view-header h1,
    .dokan-album-edit-header h1 {
        font-size: 20px;
    }

    /* View Actions */
    .dokan-product-view-actions,
    .dokan-album-view-actions {
        flex-direction: column;
        padding: 20px;
    }

    .dokan-product-view-actions .dokan-btn,
    .dokan-album-view-actions .dokan-btn {
        width: 100%;
    }

    /* Content Sections */
    .dokan-product-view-content,
    .dokan-album-view-content {
        padding: 20px;
    }

    .dokan-product-section,
    .dokan-album-section {
        margin-bottom: 25px;
        padding-bottom: 20px;
    }

    /* Tables */
    .product-listing-table,
    .album-listing-table {
        font-size: 12px;
    }

    .product-listing-table th,
    .product-listing-table td,
    .album-listing-table th,
    .album-listing-table td {
        padding: 10px 8px;
    }

    .product-actions .dokan-action-buttons,
    .album-actions .dokan-action-buttons {
        flex-wrap: wrap;
        justify-content: center;
    }

    /* Forms */
    .dokan-form-control {
        font-size: 16px; /* Prevents zoom on iOS */
    }

    .dokan-btn {
        padding: 12px 16px;
        font-size: 14px;
    }

    /* Images */
    .dokan-product-image,
    .dokan-album-image {
        padding: 15px;
    }

    .no-image-large {
        width: 150px;
        height: 150px;
        font-size: 14px;
    }

    /* Gallery Grid */
    .gallery-preview-container,
    .gallery-images-grid,
    .product-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }

    /* Filters */
    .dokan-product-filters,
    .dokan-album-filters {
        margin-bottom: 15px;
    }

    .dokan-product-filters .dokan-form-group,
    .dokan-album-filters .dokan-form-group {
        margin-bottom: 10px;
    }
}

/* Tablet Optimizations */
@media (min-width: 769px) and (max-width: 1024px) {
    .product-listing-table th,
    .product-listing-table td,
    .album-listing-table th,
    .album-listing-table td {
        padding: 12px;
        font-size: 13px;
    }

    .gallery-preview-container,
    .gallery-images-grid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    }
}

/* Delete Modal */
#delete-product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

#delete-product-modal:not(.dokan-hide) {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure modal is hidden by default */
body #delete-product-modal.dokan-hide,
#delete-product-modal.dokan-hide {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

.dokan-modal-content {
    background: white;
    padding: 25px;
    border-radius: 8px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.dokan-modal-content h3 {
    margin: 0 0 15px 0;
    color: #dc3545;
}

.dokan-modal-content p {
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.dokan-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.dokan-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Hide class for modals */
.dokan-hide {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}


/* Gallery Preview Styles */
.gallery-preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.gallery-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
}

.gallery-preview-item:hover {
    transform: scale(1.05);
}

.gallery-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-preview-item .remove-gallery-img {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s ease;
}

.gallery-preview-item .remove-gallery-img:hover {
    background: rgba(220, 53, 69, 1);
}

/* Preview Sections */
.preview-image-section,
.preview-video-section {
    margin-bottom: 20px;
}

.preview-image-section h4,
.preview-video-section h4 {
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

.video-embed {
    margin-bottom: 15px;
}

/* Current Gallery Images Grid */
.current-gallery-images {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.gallery-images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.gallery-image-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.gallery-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.2s ease;
}

.gallery-image-item:hover img {
    transform: scale(1.05);
}

/* Product Gallery Grid in View */
.product-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.product-gallery-grid .gallery-image-item {
    aspect-ratio: 1;
}

/* Help blocks for new fields */
.dokan-help-block {
    font-size: 12px;
    color: #6c757d;
    margin-top: 5px;
    font-style: italic;
}

/* ====================================
   Drag & Drop Upload Area Styles
   ==================================== */
.dokan-file-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
    transition: all 0.3s ease;
    position: relative;
}

.dokan-file-upload-area.drag-over {
    border-color: #667eea;
    background: linear-gradient(135deg, #f0f3ff 0%, #e8ecff 100%);
    transform: scale(1.02);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.2);
}

.dokan-file-upload-area.has-file {
    border-color: #28a745;
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-placeholder i {
    font-size: 48px;
    color: #667eea;
    opacity: 0.7;
    transition: all 0.3s ease;
}

.dokan-file-upload-area.drag-over .upload-placeholder i {
    transform: scale(1.2);
    opacity: 1;
}

.upload-placeholder p {
    margin: 0;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
}

.upload-trigger {
    margin-top: 10px;
}

.upload-preview {
    margin-top: 20px;
}

.upload-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    object-fit: cover;
}

.upload-preview .file-info {
    margin-top: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.upload-preview .file-name {
    font-weight: 600;
    color: #495057;
}

.upload-preview .remove-file {
    background: #dc3545;
    color: white;
    border: none;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 11px;
    transition: all 0.2s ease;
}

.upload-preview .remove-file:hover {
    background: #c82333;
    transform: scale(1.05);
}

/* Multiple Upload Preview Grid */
.dokan-multiple-upload .upload-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

.dokan-multiple-upload .upload-preview-item {
    position: relative;
    aspect-ratio: 1;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.dokan-multiple-upload .upload-preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dokan-multiple-upload .upload-preview-item .remove-file {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(220, 53, 69, 0.9);
    backdrop-filter: blur(4px);
}

/* ====================================
   Select2 Styles Override
   ==================================== */
.select2-container {
    width: 100% !important;
    max-width: 100% !important;
}

.select2-container--default .select2-selection--multiple {
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    padding: 4px 8px !important;
    min-height: 42px !important;
    background: #fff !important;
    width: 100% !important;
}

.select2-container--default.select2-container--focus .select2-selection--multiple {
    border-color: #667eea !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1) !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border: none !important;
    color: white !important;
    padding: 4px 10px !important;
    margin-top: 4px !important;
    margin-right: 5px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
    color: white !important;
    margin-right: 5px !important;
    font-weight: bold !important;
    opacity: 0.8;
}

.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
    opacity: 1;
}

.select2-dropdown {
    border: 1px solid #dee2e6 !important;
    border-radius: 6px !important;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15) !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
}

.select2-container--default .select2-search--inline .select2-search__field {
    margin-top: 4px !important;
    font-size: 14px !important;
}

/* ====================================
   Downloadable Files Styles
   ==================================== */
.dokan-downloadable-options {
    background: linear-gradient(135deg, #fafbfc 0%, #f8f9fa 100%);
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.dokan-downloadable-options .dokan-form-group {
    margin-bottom: 20px;
}

.dokan-downloadable-options .dokan-form-group:last-child {
    margin-bottom: 0;
}

#downloadable-fields {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid #e9ecef;
}

#downloadable-files-list {
    margin-bottom: 15px;
}

.downloadable-file-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 10px;
    align-items: end;
    transition: all 0.3s ease;
}

.downloadable-file-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transform: translateY(-2px);
}

.downloadable-file-field {
    display: flex;
    flex-direction: column;
}

.downloadable-file-field label {
    font-size: 12px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
}

.downloadable-file-field input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
}

.downloadable-file-field input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.remove-downloadable-file {
    background: #dc3545;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.remove-downloadable-file:hover {
    background: #c82333;
    transform: scale(1.05);
}

.downloadable-file-item .file-upload-wrapper {
    position: relative;
}

.downloadable-file-item .file-upload-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.downloadable-file-item .file-upload-btn:hover {
    background: #5568d3;
}

.downloadable-file-item input[type="file"] {
    display: none;
}

/* Checkbox styles */
input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #667eea;
}

label.dokan-control-label input[type="checkbox"] {
    margin-right: 8px;
}

/* Actions for downloadable files */
.downloadable-file-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.downloadable-file-actions .dokan-btn {
    flex: 1;
}

/* Product link item specific styles */
.product-link-item {
    background: linear-gradient(135deg, #f0f8ff 0%, #e8f4ff 100%);
    border-color: #b3d9f2;
}

.product-link-item:hover {
    background: linear-gradient(135deg, #e8f4ff 0%, #d0e8ff 100%);
}

.product-selector {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 13px;
}

.downloadable-file-field small {
    color: #6c757d;
    font-size: 11px;
    margin-top: 5px;
    display: block;
    font-style: italic;
}

.file-upload-input {
    width: 100%;
    padding: 5px 0;
    font-size: 12px;
}

/* Responsive adjustments for downloadable files */
@media (max-width: 768px) {
    .downloadable-file-item {
        grid-template-columns: 1fr;
    }

    .remove-downloadable-file {
        width: 100%;
    }

    .downloadable-file-actions {
        flex-direction: column;
    }

    .downloadable-file-actions .dokan-btn {
        width: 100%;
    }
}

.filter-item.search-filter .filter-icon {
    right: 10px !important;
    position: absolute !important;
    left: auto !important;
}

.dokan-dashboard-products .downloadable-file-item input[type="file"]{
    display: block !important;
}

.dokan-dashboard-products .downloadable-file-item.media-file-item {
    align-items: flex-start !important;
}

.dokan-dashboard-content.dokan-dashboard-products {
    margin-top: 40px;
}
