/* Modern Admin Interface Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #f8f9fa;
    color: #212529;
    line-height: 1.5;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

th, td {
    border: 1px solid #e9ecef;
    padding: 12px 16px;
    text-align: center;
    vertical-align: middle;
}

th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    z-index: 10;
}

tbody tr {
    transition: all 0.2s ease;
}

tbody tr:hover {
    background-color: #f8f9ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

img {
    height: auto;
    display: inline-block;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

img:hover {
    transform: scale(1.05);
}
.product-details {
    background-color: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #2196F3;
    text-align: left;
}
.product-details h4 { margin-top: 0; color: #2196F3; }
.metafield-item { margin-bottom: 5px; }
.metafield-label { font-weight: bold; }

/* Arrange metafield items in responsive columns */
.metafield-namespace .metafield-item {
    display: inline-block;
    width: calc(50% - 15px);
    margin: 0 10px 15px 10px;
    margin-bottom: 15px;
    vertical-align: top;
}

/* Reset margin for every other item to create proper spacing */
.metafield-namespace .metafield-item:nth-child(odd) {
    margin-right: 0;
}

/* Responsive: single column on smaller screens */
@media (max-width: 768px) {
    .metafield-namespace .metafield-item {
        width: 100%;
        margin-right: 0;
    }
}

.date-republished { font-size: 0.9em; color: #28a745; }
.date-published { font-size: 0.9em; color: #007bff; }
.date-expiry { font-size: 0.9em; color: #dc3545; }

.created-date { font-size: 0.9em; color: #666; }
.updated-date { font-size: 0.9em; }
.sort-info { margin-bottom: 10px; padding: 10px; background-color: #e8f4f8; border-left: 4px solid #2196F3; }
.pagination-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 5px;
}
.pagination-info { font-weight: bold; }
.pagination-links a, .pagination-links span {
    padding: 8px 12px;
    margin: 0 5px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 3px;
    display: inline-block;
}
.pagination-links a { background-color: white; color: #2196F3; }
.pagination-links a:hover { background-color: #f0f0f0; }
.pagination-links .disabled { background-color: #f5f5f5; color: #999; }
.per-page-selector select {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}
.images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 10px;
}
.images-gallery img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 5px;
    border: 1px solid #ddd;
}
/* Modern Button Styles */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.3);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Button Variants */
.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background-color: #5a6268;
}

.btn-success {
    background-color: #28a745;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background-color: #218838;
}

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background-color: #c82333;
}

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

.btn-warning:hover:not(:disabled) {
    background-color: #e0a800;
}

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

.btn-info:hover:not(:disabled) {
    background-color: #138496;
}

.btn-light {
    background-color: #f8f9fa;
    color: #212529;
    border: 1px solid #dee2e6;
}

.btn-light:hover:not(:disabled) {
    background-color: #e2e6ea;
    border-color: #adb5bd;
}

/* Legacy Button Styles - Updated to use new system */
.toggle-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.toggle-details:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

.close-details {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    background-color: #6c757d;
    color: white;
    float: right;
}

.close-details:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background-color: #5a6268;
}

/* Lazy loading image styles */
.image-loading {
    opacity: 0.6;
    filter: blur(1px);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.image-loaded {
    opacity: 1;
    filter: blur(0);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.image-error {
    opacity: 0.8;
    border: 2px solid #dc3545;
    background-color: #f8d7da;
}

/* Loading placeholder styling */
.shopify-image-item img[loading="lazy"] {
    background-color: #f5f5f5;
    border: 1px solid #e0e0e0;
}

/* Empty field highlighting */
.field-empty {
    border: 1px solid #dc3545 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 1px #dc3545;
}

.field-empty:focus {
    border-color: #b02a37 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Transition for smooth highlighting changes */
.metafield-item select,
.metafield-item input[type="text"],
.metafield-item input[type="number"] {
    transition: border-color 0.3s ease, background-color 0.3s ease, box-shadow 0.3s ease;
}

/* Lightbox Modal Styles */
#lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

#lightbox-modal {
    position: relative;
    background: white;
    padding: 15px;
    border-radius: 5px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    max-width: 90%;
    max-height: 90%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
}

#lightbox-modal.visible {
    opacity: 1;
    transform: scale(1);
}

#lightbox-image {
    max-width: 100%;
    max-height: calc(100vh - 120px); /* Adjust for controls and padding */
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

#lightbox-controls {
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 15px;
    align-items: center;
    color: white;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
}

#lightbox-prev,
#lightbox-next {
    background: none;
    border: none;
    color: white;
    font-size: 3em;
    cursor: pointer;
    padding: 0 15px;
    text-shadow: 0 0 5px rgba(0,0,0,0.5);
    transition: color 0.2s ease;
}

#lightbox-prev:hover,
#lightbox-next:hover {
    color: #ddd;
}

#lightbox-prev:disabled,
#lightbox-next:disabled {
    color: #888;
    cursor: not-allowed;
}

#lightbox-counter {
    font-size: 1.1em;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

#lightbox-close {
    position: absolute;
    top: -10px;
    right: -10px;
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    font-size: 1.5em;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    transition: background 0.2s ease;
}

#lightbox-close:hover {
    background: rgba(0,0,0,0.7);
}

/* Responsive adjustments for lightbox */
@media (max-width: 768px) {
    #lightbox-modal {
        max-width: 95%;
        max-height: 95%;
        padding: 10px;
    }
    #lightbox-image {
        max-height: calc(100vh - 150px); /* More space for controls */
    }
    #lightbox-controls {
        bottom: 5px;
        gap: 10px;
    }
    #lightbox-prev,
    #lightbox-next {
        font-size: 2.5em;
        padding: 0 10px;
    }
    #lightbox-counter {
        font-size: 1em;
    }
    #lightbox-close {
        top: 5px;
        right: 5px;
        width: 25px;
        height: 25px;
        font-size: 1.2em;
    }
}
sup {
    font-size: 0.5em;
    font-weight: 300;
    color: #777777;
}
.delete-button {
    z-index: 99;
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background 0.2s ease;
}
.delete-button:hover {
    background: #c82333;
}

.delete-btn {
    background-color: #ffffff;
    color: #495057;
    border: 1px solid #495057;
    padding: 3px 8px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 11px;
}
.delete-btn:hover {
    background-color: #dc3545;
    color: white;
    border-color: #dc3545;
}

.lazy-uploaded-image {
    width: 100%; 
    height: 80px; 
    object-fit: cover; 
    border-radius: 3px; 
    cursor: pointer; 
    background-color: #f5f5f5;
    background-image: url("data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTAwIiBoZWlnaHQ9IjgwIiB2aWV3Qm94PSIwIDAgMTAwIDgwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgogIDxyZWN0IHdpZHRoPSIxMDAiIGhlaWdodD0iODAiIGZpbGw9IiNFNUU3RUIiLz4KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjQwIiByPSIyMCIgZmlsbD0iIzlDQTNBRiIvPgogIDxwYXRoIGQ9Ik0zMCwzMEw1MCwyMEw3MCwzMEw3MCw1MEwzMCw1MFoiIGZpbGw9IiM5Q0EzQUYiLz4KPC9zdmc+");
    /* background-size: 16px; */
    background-position: center;
    background-repeat: no-repeat;
}

.product-description {
    width: 50%; 
    padding: 8px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    resize: vertical; 
    font-family: inherit
}
.description-status {
    margin-top: 5px; 
    font-size: 12px; 
    color: #28a745; 
    font-weight: bold;
}
/* Styles for uploaded images */
.uploaded-shopify-image-item {
    border: 1px solid #28a745;
    border-radius: 4px;
    padding: 8px;
    background: #d4edda;
    text-align: center;
    position: relative; /* For button positioning */
}

.uploaded-shopify-image-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 3px;
    cursor: pointer;
    background-color: #f5f5f5;
}

.uploaded-shopify-image-item button {
    z-index: 99;
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
    transition: background 0.2s ease;
}

.uploaded-shopify-image-item button:hover {
    background: #c82333;
}

/* Styles for upload status indicators */
.metaobject-status {
    margin-left: 8px;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: bold;
}
.metaobject-status-success {
    color: #155724;
    background-color: #d4edda;
}
.metaobject-status-error {
    color: #721c24;
    background-color: #f8d7da;
}

/* Styles for price update status */
#price-status-0, #price-status-1, #price-status-2, #price-status-3, #price-status-4, #price-status-5, #price-status-6, #price-status-7, #price-status-8, #price-status-9 {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
}

/* Styles for upload status indicators */
#upload-status-0, #upload-status-1, #upload-status-2, #upload-status-3, #upload-status-4, #upload-status-5, #upload-status-6, #upload-status-7, #upload-status-8, #upload-status-9 {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
}

/* Styles for Shopify upload status indicators */
#shopify-upload-status-0, #shopify-upload-status-1, #shopify-upload-status-2, #shopify-upload-status-3, #shopify-upload-status-4, #shopify-upload-status-5, #shopify-upload-status-6, #shopify-upload-status-7, #shopify-upload-status-8, #shopify-upload-status-9 {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
}

/* Styles for AD JSON status indicators */
.ad-json-section {
    margin-bottom: 20px; padding: 15px; border: 1px solid #007bff; border-radius: 4px; background-color: #f8f9ff;
}
.ad-json-section h3 {
    margin: 0 0 10px 0; color: #007bff;
}
.ad-json-section p {
    margin: 0 0 15px 0; color: #666; font-size: 14px;
}

.adJson {
    display: inline-block;
    margin-top: 20px;
    font-size: 14px;
}

.adJson div {
    color: #721c24; background-color: #f8d7da; border: 1px solid #f5c6cb; padding: 8px; border-radius: 4px; font-size: 12px;
}

.adJsonButton {
    background-color: #007bff; color: white; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px;
}

.postAdButton {
    background-color: #28a745; color: white; padding: 10px 20px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px;
}
/* Styles for cache operation status */
#cache-operation-status {
    font-size: 12px;
    color: #6c757d;
}

/* Styles for cache status */
#cache-status {
    font-size: 14px;
    color: #6c757d;
}

/* Enhanced Status Badges */
.status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Ad Status Badges */
.ad-status-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.ad-status-expired {
    background: linear-gradient(135deg, #dc3545 0%, #fd7e14 100%);
    color: white;
    border-color: #dc3545;
}

.ad-status-blocked {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    border-color: #bd2130;
}

.ad-status-hidden {
    background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
    color: white;
    border-color: #545b62;
}

.ad-status-checking {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
    border-color: #d39e00;
}

.ad-status-public {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #28a745;
}

.ad-status-badge a {
    color: white !important;
    text-decoration: none !important;
    font-weight: bold;
}

.ad-status-badge a:hover {
    text-decoration: underline !important;
}

.status-active {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border-color: #28a745;
}

.status-draft {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: #212529;
    border-color: #ffc107;
}

.status-archived {
    background: linear-gradient(135deg, #dc3545 0%, #e83e8c 100%);
    color: white;
    border-color: #dc3545;
}

.status-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.status-badge:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Styles for validation errors */
.validation-error {
    border: 2px solid #ff4444 !important;
    background-color: #ffeaea !important;
}

/* Styles for empty fields */
.field-empty {
    border: 1px solid #dc3545 !important;
    background-color: #fff5f5 !important;
    box-shadow: 0 0 0 1px #dc3545;
}

.field-empty:focus {
    border-color: #b02a37 !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

/* Styles for dropdown loading indicators */
.dropdown-loading {
    display: none; /* Hidden by default */
    margin-left: 10px;
    font-size: 12px;
    color: #6c757d;
}

/* Styles for upload indicators */
.upload-indicator {
    color: #28a745;
    font-weight: bold;
    font-size: 12px;
}

/* Styles for disabled elements */
[disabled] {
    cursor: not-allowed;
    opacity: 0.6;
}

.image-upload-section {
    margin-bottom: 20px; padding: 15px; border: 1px solid #ddd; border-radius: 4px; background-color: #f9f9f9;
}
.image-upload-section h3 {
    margin: 0 0 10px 0; color: #333;
}
.image-upload-section form { margin-bottom: 10px; }
.image-upload-section input[type="file"] {
    padding: 5px;
    border: 1px solid #ddd;
    border-radius: 3px;
}
.image-upload-section button {
    background-color: #28a745; color: white; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px;
}
.image-upload-section button:hover { background-color: #218838; }   
.upload-status {
    display: inline-block;
    margin-left: 10px;
    font-size: 12px;
}
.price-editor {
    margin-bottom: 15px;
}
.price-editor label {
    display: block; font-weight: bold; margin-bottom: 5px;
}
.price-editor input[type="number"] {
    width: 120px; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 14px;
}
.price-editor span {
    margin-left: 8px; color: #666;
}
.price-editor div {
    display: inline-block; margin-left: 10px; font-size: 12px;
}

.cache-panel {background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 8px; padding: 15px; margin: 20px 0; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;}
.cache-info {display: flex; align-items: center; gap: 15px;}
.cache-info div {font-weight: bold; color: #495057;}
.cache-info #cache-status {font-size: 14px; color: #6c757d;}
.cache-actions button {background-color: #007bff; color: white; padding: 8px 16px; border: none; border-radius: 4px; cursor: pointer; font-size: 14px;}
.cache-actions button:hover {background-color: #0056b3;}
.cache-actions button:disabled {background-color: #6c757d; cursor: not-allowed;}
#cache-operation-status {font-size: 12px; color: #6c757d;}
#refresh-cache-btn {background-color: #17a2b8;}
#refresh-cache-btn:hover {background-color: #138496;}
#cache-options-btn{background-color: #6c757d;}
#cache-options-btn:hover {background-color: #5a6268;}   
#cache-options-menu  {display: none; position: absolute; top: 100%; right: 0; background: white; border: 1px solid #dee2e6; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); z-index: 1000; min-width: 180px;}
#cache-options-menu button {width: 100%; padding: 10px; border: none; background: none; text-align: left; cursor: pointer; border-bottom: 1px solid #f8f9fa;}
#cache-options-menu button:hover {background-color: #f1f1f1;}
#cache-options-menu button:last-child {border-bottom: none;}
#clear-cache-btn {background: #dc3545; color: white; border: none; padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 14px;}
#clear-cache-btn:hover {background-color: #c82333;}
#clear-cache-btn:disabled {background-color: #6c757d; cursor: not-allowed;}
#refresh-cache-btn {background-color: #17a2b8; color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 14px;}
#refresh-cache-btn:hover {background-color: #138496;}
#refresh-cache-btn:disabled {background-color: #6c757d; cursor: not-allowed;}
#cache-options-btn {background-color: #6c757d; color: white; border: none; padding: 8px 12px; border-radius: 4px; cursor: pointer; font-size: 14px;}
#cache-options-btn:hover {background-color: #5a6268;}
#cache-options-btn:disabled {background-color: #6c757d; cursor: not-allowed;}
.cache-controls {display: flex; gap: 10px; align-items: center; position: relative;}

/* Modern Form Controls */
.metafieldBase,
input[type="text"],
input[type="number"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    background-color: white;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.metafieldBase:focus,
input[type="text"]:focus,
input[type="number"]:focus,
input[type="file"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background-color: #fefefe;
}

.metafieldBase:hover,
input[type="text"]:hover,
input[type="number"]:hover,
input[type="file"]:hover,
select:hover,
textarea:hover {
    border-color: #ced4da;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236c757d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 10px center;
    background-size: 16px;
    padding-right: 40px;
    appearance: none;
}

textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

input[type="file"] {
    padding: 8px;
    border-style: dashed;
    background-color: #f8f9fa;
}

input[type="file"]:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* Form Groups */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group .form-help {
    font-size: 12px;
    color: #6c757d;
    margin-top: 4px;
}

/* Checkbox and Radio Styles */
input[type="checkbox"],
input[type="radio"] {
    width: auto;
    margin: 0;
    margin-right: 8px;
    accent-color: #667eea;
    transform: scale(1.1);
}

/* Special styling for securitate checkboxes */
.securitate-features input[type="checkbox"] {
    accent-color: #28a745;
}

/* Input Groups */
.input-group {
    display: flex;
    align-items: stretch;
}

.input-group .metafieldBase,
.input-group input[type="text"],
.input-group input[type="number"],
.input-group select {
    border-radius: 0;
    border-right: none;
    margin: 0;
}

.input-group .metafieldBase:first-child,
.input-group input[type="text"]:first-child,
.input-group input[type="number"]:first-child,
.input-group select:first-child {
    border-radius: 6px 0 0 6px;
}

.input-group .input-group-append .btn,
.input-group .input-group-prepend .btn {
    border-radius: 0;
    margin: 0;
}

.input-group .input-group-append .btn:last-child,
.input-group .input-group-prepend .btn:first-child {
    border-radius: 0 6px 6px 0;
}

/* Numeric measurement fields */
.numeric-measurement {
    display: flex;
    gap: 8px;
    align-items: flex-start;
}

.numeric-measurement .value-input {
    flex: 1;
}

.numeric-measurement .unit-select {
    width: 80px;
    flex-shrink: 0;
}

.shopify-images-section {
    margin-bottom: 20px; padding: 15px; border: 1px solid #ddd; border-radius: 4px; background-color: #f9f9f9;
}
.shopify-images-section h3 {
    margin: 0 0 10px 0; color: #333;
}
.shopify-images-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-bottom: 15px;
}

.shopify-image-item {
    border: 1px solid #ddd; border-radius: 4px; padding: 8px; background: white;
}
.shopify-image-item img {
    width: 100%; height: 80px; object-fit: cover; border-radius: 3px; cursor: pointer; background-color: #f5f5f5;
}
.shopify-image-item img:hover { border-color: #007bff; }
.shopify-image-item img:active { border-color: #0056b3; }
.shopify-image-item div { margin-top: 5px; }
.shopify-image-item div label {
    display: flex; align-items: center; font-size: 11px;
}
.shopify-image-item div label input { margin-right: 5px; }

.upload-buttons {
    display: flex; gap: 10px; align-items: center;    
}
.upload-buttons label {
   display: flex; align-items: center; font-size: 12px;
}

.metafield-label {
    font-weight: bold; display: block; margin-bottom: 5px;
}

/* Features container for side-by-side layout */
.features-container {
    width: 100%;
    display: flex;
    gap: 20px;
    margin-top: 15px;
}

.features-container .metafield-item {
    flex: 1;
    width: auto !important;
    margin: 0 !important;
}

/* Responsive: stack features vertically on smaller screens */
@media (max-width: 768px) {
    .features-container {
        flex-direction: column;
        gap: 15px;
    }
}

.securitate-metaobject {
    margin-top: 5px; padding: 10px; background-color: #f8f9fa; border-radius: 4px;
}

.securitate-features {
    margin-top: 8px; display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 8px;
}
.securitate-features .feature-item {
    display: flex; align-items: center; font-size: 13px; padding: 2px 0;
}
.securitate-features .feature-item input {
    margin-right: 8px; cursor: pointer;
}
.securitate-features .feature-item label {
    cursor: pointer; line-height: 1.2;
}

/* Filter Controls Styles */
.filter-controls {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.filter-row {
    display: flex;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: bold;
    font-size: 14px;
    color: #495057;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #80bdff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.filter-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.filter-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.filter-btn:hover {
    background-color: #0056b3;
}

.clear-filters-btn {
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.clear-filters-btn:hover {
    background-color: #5a6268;
}

.active-filters {
    margin-top: 15px;
    padding: 10px;
    background-color: #e9ecef;
    border-radius: 4px;
    border-left: 4px solid #007bff;
}

.filter-tag {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin: 2px 4px 2px 0;
    font-weight: bold;
}

.remove-filter {
    margin-left: 8px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    color: #fff;
    opacity: 0.8;
}

.remove-filter:hover {
    opacity: 1;
}

/* Slim Topbar for Cache Management */
.topbar {
    background: linear-gradient(135deg, #593166 0%, #764ba2 100%);
    color: white;
    padding: 5px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 3px solid #5a6fd8;
}

.topbar-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 100%;
}

.topbar-title h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.cache-management {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cache-info {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
}

.cache-info span:first-child {
    opacity: 0.9;
}

.cache-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cache-controls button {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.cache-controls button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

.cache-dropdown {
    position: relative;
}

#cache-options-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 180px;
    margin-top: 2px;
}

#cache-options-menu button {
    width: 100%;
    padding: 10px;
    border: none;
    background: none;
    text-align: left;
    cursor: pointer;
    border-bottom: 1px solid #f8f9fa;
    color: #495057;
    font-size: 13px;
}

#cache-options-menu button:hover {
    background-color: #f1f1f1;
}

#cache-options-menu button:last-child {
    border-bottom: none;
}

#cache-operation-status {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.8);
    margin-left: 8px;
}

/* Inline Product Filters */
.inline-filters {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 20px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 120px;
}

.filter-group label {
    font-weight: 600;
    font-size: 13px;
    color: #495057;
}

.filter-group select,
.filter-group input[type="text"] {
    padding: 8px 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 13px;
    background-color: white;
    min-width: 120px;
}

.filter-group select:focus,
.filter-group input[type="text"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.filter-actions {
    display: flex;
    gap: 8px;
    align-items: center;
}

.filter-btn {
    background-color: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.filter-btn:hover {
    background-color: #0056b3;
}

.clear-filters-btn {
    background-color: #6c757d;
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.clear-filters-btn:hover {
    background-color: #5a6268;
}

.active-filters {
    margin-top: 10px;
    padding: 8px 12px;
    background-color: #e9ecef;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.filter-tag {
    display: inline-block;
    background-color: #007bff;
    color: white;
    padding: 3px 6px;
    border-radius: 10px;
    font-size: 11px;
    margin: 2px 4px 2px 0;
    font-weight: 500;
}

.remove-filter {
    margin-left: 6px;
    cursor: pointer;
    font-weight: bold;
    text-decoration: none;
    color: #fff;
    opacity: 0.8;
}

.remove-filter:hover {
    opacity: 1;
}

/* Responsive adjustments for filter controls */
@media (max-width: 768px) {
    .filter-row {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group {
        width: 100%;
    }

    .filter-group select,
    .filter-group input[type="text"] {
        width: 100%;
        min-width: unset;
    }

    .filter-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Enhanced Responsive Design */
@media (max-width: 1200px) {
    .control-panels {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
        font-size: 14px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 8px 6px;
    }

    .btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    .pagination-controls {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .control-panel {
        padding: 15px;
    }

    .filter-controls {
        padding: 15px;
    }

    .filter-row {
        flex-direction: column;
        gap: 15px;
    }

    .product-details {
        padding: 10px;
    }

    .metafield-namespace .metafield-item {
        width: 100%;
        margin: 0 0 10px 0;
    }

    .numeric-measurement {
        flex-direction: column;
        gap: 6px;
    }

    .numeric-measurement .unit-select {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .btn {
        width: 100%;
        margin-bottom: 8px;
    }

    .status-badge {
        font-size: 11px;
        padding: 4px 8px;
    }

    .filter-actions {
        flex-direction: column;
        width: 100%;
    }

    .filter-btn,
    .clear-filters-btn {
        width: 100%;
    }

    .upload-buttons {
        flex-direction: column;
        gap: 8px;
    }

    .cache-panel {
        flex-direction: column;
        text-align: center;
    }

    .cache-controls {
        justify-content: center;
        flex-wrap: wrap;
    }
}

/* Print Styles */
@media print {
    body {
        background: white !important;
        color: black !important;
    }

    .btn,
    .control-panel,
    .filter-controls,
    .cache-panel {
        display: none !important;
    }

    table {
        border-collapse: collapse;
        box-shadow: none;
    }

    th, td {
        border: 1px solid #000;
        background: white;
    }
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .btn-primary {
        background: #000;
        color: #fff;
        border: 2px solid #000;
    }

    .status-badge {
        border: 2px solid currentColor;
    }

    input, select, textarea {
        border: 2px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus Visible for Better Accessibility */
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Create Product Section */
.create-product-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    text-align: center;
}

.create-product-section .btn-lg {
    font-size: 16px;
    padding: 12px 24px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px 12px 0 0;
}

.modal-header h2 {
    margin: 0;
    color: #495057;
    font-size: 24px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #dee2e6;
    color: #495057;
}

.modal-body {
    padding: 24px;
}

.modal-status {
    padding: 16px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 0 0 12px 12px;
    font-size: 14px;
    text-align: center;
}

/* Form Styles */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group input[type="text"],
.form-group input[type="number"],
.form-group input[type="url"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.form-group input[type="text"]:focus,
.form-group input[type="number"]:focus,
.form-group input[type="url"]:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.image-upload-options {
    display: flex;
    gap: 20px;
    margin-top: 10px;
}

.upload-option {
    flex: 1;
    padding: 16px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    background: #f8f9fa;
    transition: all 0.2s ease;
}

.upload-option:hover {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-option h4 {
    margin: 0 0 12px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.upload-option input[type="file"] {
    width: 100%;
    padding: 8px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
}

.upload-option small {
    display: block;
    margin-top: 8px;
    color: #6c757d;
    font-size: 12px;
}

#image-urls-container {
    margin-bottom: 12px;
}

.image-url-input {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
    align-items: center;
}

.image-url-input input {
    flex: 1;
    margin: 0;
}

.image-url-input button {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s ease;
}

.image-url-input button:hover {
    background: #c82333;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Responsive adjustments for topbar and inline filters */
@media (max-width: 1024px) {
    .topbar-content {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    .topbar-title h1 {
        font-size: 18px;
    }

    .cache-management {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .topbar {
        padding: 10px 15px;
    }

    .topbar-title h1 {
        font-size: 16px;
    }

    .cache-info {
        font-size: 12px;
    }

    .cache-controls {
        gap: 6px;
    }

    .cache-controls button {
        padding: 5px 8px;
        font-size: 11px;
    }

    .inline-filters {
        padding: 12px;
        margin: 15px 0;
    }

    .filter-row {
        gap: 10px;
    }

    .filter-group {
        min-width: 100px;
    }

    .filter-group select,
    .filter-group input[type="text"] {
        font-size: 12px;
        padding: 6px 8px;
        min-width: 100px;
    }

    .filter-btn,
    .clear-filters-btn {
        padding: 6px 12px;
        font-size: 12px;
    }
}

@media (max-width: 480px) {
    .topbar {
        padding: 8px 10px;
    }

    .topbar-content {
        gap: 8px;
    }

    .topbar-title h1 {
        font-size: 14px;
    }

    .cache-management {
        flex-direction: column;
        gap: 8px;
        width: 100%;
    }

    .cache-info {
        justify-content: center;
        font-size: 11px;
    }

    .cache-controls {
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
    }

    .cache-controls button {
        padding: 4px 6px;
        font-size: 10px;
        min-width: 60px;
    }

    .inline-filters {
        padding: 10px;
        margin: 10px 0;
    }

    .filter-row {
        flex-direction: column;
        gap: 8px;
    }

    .filter-group {
        width: 100%;
        min-width: unset;
    }

    .filter-group select,
    .filter-group input[type="text"] {
        width: 100%;
        font-size: 14px;
        padding: 8px 10px;
    }

    .filter-actions {
        justify-content: center;
        flex-wrap: wrap;
    }

    .filter-btn,
    .clear-filters-btn {
        width: 100%;
        padding: 8px 16px;
        font-size: 14px;
    }
}
