/* Search and Filter Section */
.search-filter-section {
    background-color: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 1px solid #dee2e6;
}

.filter-group {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.filter-group label {
    min-width: 80px;
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 6px 16px;
    background-color: white;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    color: #495057;
}

.filter-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.filter-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
}

.search-box {
    display: flex;
    gap: 10px;
    margin: 20px 0;
    align-items: center;
}

.search-input {
    flex: 1;
    padding: 8px 15px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    transition: border-color 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.search-btn {
    padding: 8px 20px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.search-btn:hover {
    background-color: #2980b9;
}

.reset-btn {
    padding: 8px 20px;
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

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

/* Action Buttons */
.page-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.btn-refresh {
    padding: 8px 20px;
    background-color: #17a2b8;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.btn-refresh:hover {
    background-color: #138496;
}

/* Table Container */
.data-table-container {
    margin-top: 20px;
    overflow-x: auto;
}

.table-header-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

.table-header-info span {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
}

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

/* Column Widths for Fixed Table Layout */
.data-table th:nth-child(1) { width: 60px; }
/* .data-table th:nth-child(2) { width: 120px; } */
.data-table th:nth-child(3) { width: 80px; }
.data-table th:nth-child(4) { width: 100px; }
.data-table th:nth-child(5) { width: 100px; }
.data-table th:nth-child(6) { width: 80px; }
.data-table th:nth-child(7) { width: 100px; }
.data-table th:nth-child(8) { width: 80px; }
.data-table th:nth-child(9) { width: 180px; }

/* Secondary Category Column Specific Styling */
.data-table td:nth-child(5) {
    color: #666;
    max-width: 100px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.data-table td:nth-child(5):empty::before {
    content: '-';
    color: #999;
    font-style: italic;
}

/* Price Display */
.discount-rate {
    font-weight: 600;
    color: #e74c3c;
    font-size: 16px;
}

.fixed-price {
    font-weight: 600;
    color: #27ae60;
}

/* Image Preview */
.item-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #dee2e6;
}

.item-image:hover {
    transform: scale(1.1);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.no-image {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

/* Action Buttons in Table */
.table-action-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: nowrap;
}

.table-action-buttons .btn {
    padding: 5px 12px;
    font-size: 12px;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: opacity 0.3s;
    min-width: 60px;
    text-align: center;
}

.table-action-buttons .btn:hover {
    opacity: 0.9;
}

/* Button colors - light grey theme */
.btn-view, .btn-edit, .btn-enable, .btn-disable, .btn-danger {
    background-color: #95a5a6;
    color: white;
}

.btn-danger:hover {
    background-color: #7f8c8d;
}

.price-type-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    display: inline-block;
    text-align: center;
    min-width: 70px;
}

.price-type-discount, .price-type-fixed {
    background-color: #95a5a6;
    color: white;
}

/* Page Select */
.page-select {
    padding: 6px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    background-color: white;
    cursor: pointer;
}

.page-select:focus {
    outline: none;
    border-color: #3498db;
}

.btn-retry {
    margin-left: 10px;
    padding: 8px 16px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.btn-retry:hover {
    background-color: #2980b9;
}

/* Size & Quantity specific styles */
.type-size, .type-quantity {
    background-color: #95a5a6;
    color: white;
}

/* Simple Group Selection Styles */
.simple-group-selection {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.group-search-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.group-search-input-simple {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.group-search-input-simple:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.clear-search-btn-simple {
    background: none;
    border: none;
    color: #6c757d;
    cursor: pointer;
    font-size: 18px;
    padding: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.clear-search-btn-simple:hover {
    background-color: #f8f9fa;
    color: #e74c3c;
}

.group-dropdown-simple {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    background-color: white;
}

.group-dropdown-simple:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.new-group-input-simple {
    margin-top: 5px;
}

.form-hint-simple {
    margin-top: 5px;
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

/* ===== Image Upload Styles ===== */
.image-upload-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.image-preview-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.image-preview-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.image-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 5px;
}

.remove-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 24px;
    height: 24px;
    background-color: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.remove-image-btn:hover {
    background-color: #c0392b;
}

.image-url-info {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
}

.image-url-truncate {
    font-family: monospace;
    background-color: #f1f3f4;
    padding: 2px 4px;
    border-radius: 3px;
    font-size: 11px;
}

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

.upload-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: white;
    color: #495057;
    border: 1px solid #ced4da;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: all 0.3s;
    max-width: 200px;
    font-weight: 500;
}

.upload-button:hover:not(:disabled) {
    background-color: #f8f9fa;
    border-color: #adb5bd;
    color: #212529;
}

.upload-button:disabled {
    background-color: #e9ecef;
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.7;
}

.upload-hint {
    font-size: 12px;
    color: #6c757d;
    margin: 0;
    font-style: italic;
}

.upload-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.upload-button input[type="file"] {
    position: absolute;
    width: 0;
    height: 0;
    opacity: 0;
}

/* Radio button styling */
.radio-group {
    display: flex;
    gap: 30px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.radio-option input[type="radio"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
}

/* Category selection */
.category-selection {
    margin-top: 8px;
}

.category-row {
    display: flex;
    gap: 15px;
}

.category-dropdown {
    flex: 1;
    min-width: 0;
}

/* Image upload with frame */
.image-upload-framed {
    margin-top: 8px;
}

.image-frame-container {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
}

.image-frame {
    flex: 2;
    border: 2px dashed #ccc;
    border-radius: 8px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: #f8f9fa;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.image-frame:hover {
    border-color: #007bff;
    background-color: #e9f5ff;
}

.image-preview-frame {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.framed-image-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.remove-frame-image-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.remove-frame-image-btn:hover {
    background: rgba(255, 0, 0, 1);
}

.upload-placeholder {
    text-align: center;
    color: #666;
    padding: 20px;
}

.upload-icon {
    font-size: 36px;
    display: block;
    margin-bottom: 10px;
}

.upload-text {
    display: block;
    font-weight: bold;
    margin-bottom: 5px;
    font-size: 16px;
}

.upload-hint-small {
    font-size: 12px;
    color: #999;
}

/* Auxiliary images section */
.auxiliary-images-section {
    flex: 1;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 15px;
    background-color: #fff;
    min-width: 200px;
}

.auxiliary-images-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    font-weight: 600;
}

.btn-auxiliary-upload {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-auxiliary-upload:hover {
    background-color: #5a6268;
}

.auxiliary-images-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-height: 160px;
    overflow-y: auto;
    padding-right: 5px;
}

.auxiliary-images-list::-webkit-scrollbar {
    width: 6px;
}

.auxiliary-images-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.auxiliary-images-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.auxiliary-image-item {
    position: relative;
    width: 70px;
    height: 70px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background-color: #f8f9fa;
}

.auxiliary-image-preview {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.remove-auxiliary-btn {
    position: absolute;
    top: 3px;
    right: 3px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    opacity: 0;
    transition: opacity 0.2s;
}

.auxiliary-image-item:hover .remove-auxiliary-btn {
    opacity: 1;
}

.no-auxiliary-images {
    grid-column: span 2;
    text-align: center;
    color: #999;
    font-style: italic;
    padding: 30px 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* Upload info */
.image-upload-info {
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 4px;
    font-size: 13px;
}

.upload-specs {
    margin: 0 0 8px 0;
    color: #666;
}

.uploading-status {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #007bff;
    margin: 0;
    font-weight: 500;
}

.upload-spinner-small {
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.form-hint-simple {
    margin: 5px 0 0 0;
    font-size: 12px;
    color: #666;
}

.clear-search-btn-simple {
    background: #ddd;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 5px;
}

.clear-search-btn-simple:hover {
    background: #ccc;
}

.group-search-input-simple {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.group-search-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.group-dropdown-simple {
    margin-bottom: 5px;
}

/* ===== ENHANCED CATEGORY SECTION ===== */
.enhanced-category-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 10px;
}

.category-card {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-card:hover {
    border-color: #3498db;
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.1);
}

.category-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #e9ecef;
}

.category-label {
    font-weight: 600;
    font-size: 14px;
    color: #495057;
    margin-right: 8px;
}

.category-required {
    color: #e74c3c;
    font-size: 16px;
    font-weight: bold;
}

.category-optional {
    color: #6c757d;
    font-size: 12px;
    font-style: italic;
}

.category-search-box {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    position: relative;
}

.category-search-input {
    flex: 1;
    padding: 10px 12px;
    padding-right: 40px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    background-color: white;
    transition: all 0.3s;
}

.category-search-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.category-search-input::placeholder {
    color: #adb5bd;
    font-size: 13px;
}

.category-clear-btn {
    position: absolute;
    right: 10px;
    background: #dee2e6;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 16px;
    color: #6c757d;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.category-clear-btn:hover {
    background: #ced4da;
    color: #495057;
}

.category-select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    color: #495057;
    background-color: white;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23495057' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    transition: all 0.3s;
}

.category-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.category-select option {
    padding: 8px 12px;
    font-size: 14px;
}

.category-select option[value="custom"] {
    color: #3498db;
    font-weight: 600;
    border-top: 1px solid #dee2e6;
    margin-top: 5px;
    padding-top: 10px;
}

.category-info {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

.category-count {
    font-weight: 500;
}

.search-results {
    color: #3498db;
    font-weight: 500;
}

/* ===== IMPROVED RADIO BUTTONS ===== */
.radio-group {
    display: flex;
    gap: 30px;
    margin-top: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s;
}

.radio-option:hover {
    background-color: #f8f9fa;
}

.radio-option input[type="radio"] {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

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

.form-control::placeholder {
    color: #adb5bd;
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
    font-size: 20px;
}

/* ===== FORM ACTIONS IMPROVEMENT ===== */
.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(52, 152, 219, 0.2);
}

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

/* ===== IMAGE UPLOAD IMPROVEMENTS ===== */
.image-upload-framed {
    margin-top: 8px;
}

.image-frame {
    flex: 2;
    border: 2px dashed #3498db;
    border-radius: 8px;
    height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background-color: #f8f9fa;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.image-frame:hover {
    background-color: #e9f5ff;
    border-color: #2980b9;
}

.framed-image-preview {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 10px;
}

/* ===== AUXILIARY IMAGES IMPROVEMENTS ===== */
.auxiliary-images-section {
    flex: 1;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    background-color: #fff;
    min-width: 200px;
}

.auxiliary-images-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: #495057;
}

.btn-auxiliary-upload {
    background-color: #6c757d;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-auxiliary-upload:hover {
    background-color: #5a6268;
}

/* ===== CUSTOM CATEGORY INPUT STYLES ===== */
.custom-category-input {
    margin-top: 10px;
    padding: 12px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.3s;
}

.custom-category-input:hover {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.custom-input {
    width: 100%;
    margin-bottom: 5px;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    background-color: white;
    transition: all 0.3s;
}

.custom-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.custom-category-hint {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    margin-top: 5px;
    line-height: 1.4;
}

/* ===== ENHANCED MATERIAL CONFIGURATION STYLES ===== */
.enhanced-material-section {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.section-header-with-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

/* Material Filter Cards */
.material-filter-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 25px;
}

.filter-card {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 16px;
    transition: all 0.2s;
}

.filter-card:hover {
    border-color: #3498db;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.1);
}

.filter-card-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.filter-card-icon {
    font-size: 18px;
}

.filter-card-title {
    font-weight: 600;
    color: #495057;
}

.filter-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #495057;
}

.filter-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.filter-card-info {
    margin-top: 8px;
    font-size: 12px;
    color: #6c757d;
}

/* Material Library */
.material-library-section {
    margin: 25px 0;
}

.material-library-header {
    margin-bottom: 20px;
}

.material-library-subtitle {
    color: #6c757d;
    font-size: 14px;
}

.material-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

.material-card {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 16px;
    background: white;
    transition: all 0.2s;
}

.material-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #3498db;
}

.material-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.material-card-title {
    font-weight: 600;
    font-size: 16px;
    color: #212529;
}

.material-type-badge {
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
}

.material-card-content {
    margin-bottom: 16px;
}

.material-property {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 14px;
}

.property-label {
    color: #6c757d;
}

.property-value {
    color: #212529;
    font-weight: 500;
}

.price-highlight {
    color: #27ae60;
    font-weight: 600;
}

.material-card-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-icon {
    margin-right: 4px;
}

.material-image-preview {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    border: 1px solid #dee2e6;
}

.material-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-hint {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s;
}

.material-image-preview:hover .preview-hint {
    opacity: 1;
}

/* Empty State */
.empty-material-state {
    text-align: center;
    padding: 40px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 25px 0;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.empty-state-text {
    font-size: 16px;
    color: #6c757d;
    margin-bottom: 8px;
}

.empty-state-hint {
    font-size: 14px;
    color: #adb5bd;
}

/* Material Actions */
.material-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 25px 0;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.material-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.stat-label {
    color: #6c757d;
    font-size: 14px;
}

.stat-value {
    font-weight: 600;
    color: #212529;
    font-size: 16px;
}

/* Added Materials Table */
.added-materials-section {
    margin-top: 30px;
}

.material-table {
    margin-top: 15px;
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.material-table th {
    background-color: #2c3e50;
    color: white;
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid #1a252f;
}

.material-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #dee2e6;
    vertical-align: middle;
    font-size: 14px;
    color: #495057;
}

.material-row:hover {
    background-color: #f8f9fa;
}

.row-number {
    color: #6c757d;
    text-align: center;
}

.table-input {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.table-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.price-input-wrapper {
    position: relative;
}

.currency-symbol {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 14px;
}

.price-input {
    padding-left: 24px;
}

.table-select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #495057;
}

.table-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* ===== CUSTOM PRIMARY CATEGORY STYLES ===== */
.custom-category-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.custom-category-actions .btn {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.custom-category-actions .btn-primary {
    background-color: #3498db;
    color: white;
}

.custom-category-actions .btn-primary:hover:not(:disabled) {
    background-color: #2980b9;
}

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

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

.custom-category-actions .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Status Selection for Custom Category */
.status-selection {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.status-selection label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.status-selection input[type="radio"] {
    margin-right: 5px;
    width: 16px;
    height: 16px;
    accent-color: #3498db;
}

/* Image URL Input Section */
.image-url-section {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}

.image-url-header {
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
    font-size: 14px;
}

.image-url-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.image-url-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
}

.image-url-apply-btn,
.image-url-clear-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.image-url-apply-btn {
    background-color: #3498db;
    color: white;
}

.image-url-apply-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

.image-url-clear-btn {
    background-color: #6c757d;
    color: white;
}

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

.image-url-apply-btn:disabled,
.image-url-clear-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== CUSTOM SECONDARY CATEGORY STYLES ===== */
.category-warning {
    margin: 10px 0;
    padding: 8px;
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    color: #856404;
}

.category-id-hint {
    font-size: 11px;
    color: #7f8c8d;
    background: #ecf0f1;
    padding: 2px 6px;
    border-radius: 3px;
    margin-left: 5px;
}

.sub-type-count {
    font-size: 12px;
    color: #3498db;
    margin-left: 10px;
}

.custom-secondary-info {
    margin-bottom: 10px;
    padding: 8px;
    background: #e8f4fc;
    border-radius: 4px;
    border-left: 3px solid #3498db;
}

.custom-secondary-info p {
    margin: 0;
    font-size: 13px;
    color: #2c3e50;
}

.custom-secondary-info strong {
    color: #2980b9;
}

.category-select:disabled,
.category-search-input:disabled {
    background-color: #f8f9fa;
    color: #6c757d;
    cursor: not-allowed;
}

.no-categories-message {
    color: #999;
    font-size: 14px;
    margin-top: 5px;
    padding: 8px;
    border-radius: 4px;
    background-color: #f5f5f5;
    text-align: center;
}

.loading-spinner-small {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.loading-categories {
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 14px;
}

.category-hint {
    color: #999;
    font-size: 14px;
    padding: 10px;
    text-align: center;
    background-color: #f5f5f5;
    border-radius: 4px;
}

.category-count-small {
    font-size: 12px;
    color: #3498db;
    margin-left: 5px;
    font-weight: normal;
}

.no-categories-message {
    color: #999;
    font-size: 14px;
    margin-top: 5px;
    padding: 8px;
    border-radius: 4px;
    background-color: #f5f5f5;
    text-align: center;
    margin-bottom: 10px;
}

/* Custom Secondary Category Status Selection */
.custom-category-input .status-selection {
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.custom-category-input .status-selection label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
}

.custom-category-input .status-selection input[type="radio"] {
    margin-right: 5px;
    width: 16px;
    height: 16px;
    accent-color: #3498db;
}

/* Numbered Pagination Styles */
.numbered-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 20px;
    padding: 15px 0;
    flex-wrap: wrap;
}

.page-number-btn {
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #dee2e6;
    background-color: white;
    color: #495057;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.page-number-btn:hover:not(:disabled):not(.active) {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.page-number-btn.active {
    background-color: #3498db;
    color: white;
    border-color: #3498db;
    font-weight: 600;
}

.page-number-btn:disabled {
    background-color: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    opacity: 0.7;
}

.page-ellipsis {
    min-width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    font-size: 14px;
}

.pagination-nav-btn {
    min-width: 80px;
    padding: 8px 12px;
    background-color: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s;
}

.pagination-nav-btn:hover:not(:disabled) {
    background-color: #2980b9;
}

.pagination-nav-btn:disabled {
    background-color: #bdc3c7;
    cursor: not-allowed;
    opacity: 0.6;
}

/* ===== COMPACT DIMENSION INPUT STYLES ===== */
.dimension-compact-line {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.dimension-input-compact {
    width: 80px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-align: center;
}

.dimension-multiply {
    font-size: 16px;
    color: #999;
    padding: 0 2px;
    user-select: none;
}

.dimension-unit-compact {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #f5f5f5;
    font-size: 14px;
    width: 70px;
}

.content-input-wrapper {
    display: flex;
    gap: 8px;
}

.auto-generate-btn {
    white-space: nowrap;
    padding: 8px 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.auto-generate-btn:hover {
    background: #45a049;
}

.auto-generate-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
}

/* OSS Upload Styles */
.oss-status-banner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.oss-status-banner.warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.oss-status-icon {
    font-size: 18px;
}

.oss-status-text {
    font-weight: bold;
}

.oss-status-hint {
    font-size: 12px;
    opacity: 0.9;
}

.oss-badge {
    background: #4CAF50;
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    margin-left: 10px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
}

/* Upload Progress Styles */
.upload-progress-overlay {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.9);
    padding: 8px;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.upload-progress-bar {
    flex: 1;
    height: 8px;
    background-color: #e0e0e0;
    border-radius: 4px;
    overflow: hidden;
}

.upload-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    transition: width 0.3s ease;
}

.upload-progress-text {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    min-width: 40px;
    text-align: center;
}

.image-frame.uploading {
    position: relative;
    border-color: #4CAF50;
}

.auxiliary-upload-progress {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 5px;
}

.uploading-status {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    color: #666;
    font-size: 14px;
}

.upload-error {
    color: #f44336;
    font-size: 13px;
    margin-top: 5px;
    padding: 5px 10px;
    background: #ffebee;
    border-radius: 4px;
    border-left: 3px solid #f44336;
}

/* Button styles for OSS test */
.btn-info {
    background-color: #17a2b8;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

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

.btn-info:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

/* ===== UPLOADED FILE DISPLAY STYLES ===== */
.uploaded-file-container {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    min-height: 80px;
    justify-content: center;
}

.file-preview {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    background: white;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
    border: 1px solid #dee2e6;
    min-width: 120px;
}

.file-preview:hover {
    background: #e9ecef;
    border-color: #3498db;
}

.file-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.file-name {
    font-size: 12px;
    color: #495057;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex-grow: 1;
}

.upload-label {
    display: inline-block;
    padding: 8px 16px;
    background: white !important;
    color: black !important;
    /* border: 1px solid #ddd !important; */
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    transition: all 0.2s;
    min-width: 80px;
}

.upload-label:hover {
    background: #f5f5f5 !important;
    border-color: #3498db !important;
}

.upload-label input[type="file"] {
    display: none;
}

.preview-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    margin-bottom: 5px;
    cursor: pointer;
    transition: all 0.2s;
}

.preview-thumb:hover {
    border-color: #3498db;
    transform: scale(1.05);
    box-shadow: 0 2px 5px rgba(52, 152, 219, 0.2);
}

.api-loaded-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #28a745;
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: 3px;
    z-index: 1;
}

.image-upload-cell {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    min-height: 60px;
    justify-content: center;
}

.product-thumbnail {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #ddd;
    cursor: pointer;
    transition: all 0.2s;
}

.product-thumbnail:hover {
    border-color: #3498db;
    transform: scale(1.05);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.config-table td .uploaded-file-container {
    margin: 0;
    padding: 5px;
    min-height: 70px;
}

.config-table td .file-preview {
    min-width: 100px;
    padding: 4px 8px;
}

.config-table td .file-name {
    font-size: 11px;
    max-width: 90px;
}

.oss-warning {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(245, 87, 108, 0.2);
}

.oss-warning::before {
    content: "⚠️";
    font-size: 20px;
}

.uploading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(52, 152, 219, 0.9);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.upload-spinner-mini {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.file-icon[data-type="image"]::before { content: "🖼️"; }
.file-icon[data-type="design"]::before { content: "📋"; }
.file-icon[data-type="svg"]::before { content: "🎨"; }
.file-icon[data-type="3d"]::before { content: "🧊"; }
.file-icon[data-type="unknown"]::before { content: "📄"; }

/* Config Section */
.config-section {
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.config-section h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #f0f0f0;
}

.config-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: white;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    border-radius: 6px;
    overflow: hidden;
}

.config-table select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    background-color: white;
    transition: all 0.3s;
}

.config-table select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.config-table input[type="text"] {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    background-color: white;
    transition: all 0.3s;
}

.config-table input[type="text"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.config-table .btn-small {
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    margin: 2px;

}

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

.config-table .btn-secondary:hover {
    background-color: #5a6268;
}

.section-info {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.section-info::before {
    content: "📤";
    font-size: 20px;
}

.products-grid {
    /* display: grid; */
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.product-card {
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border-color: #3498db;
}

.product-card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 10px;
}

.product-card-placeholder {
    width: 100%;
    height: 150px;
    background: #f8f9fa;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
    margin-bottom: 10px;
}

.product-card-title {
    font-size: 14px;
    color: #495057;
    font-weight: 500;
    line-height: 1.4;
}

.action-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.config-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.btn-return {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.btn-return:hover {
    background: #5a6268;
    transform: translateX(-3px);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.product-details h2 {
    margin: 0 0 10px 0;
    color: #2c3e50;
    font-size: 22px;
}

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

/* File type specific styling */
.file-preview[data-file-type="svg"] {
    border-left: 3px solid #ff6b6b;
}

.file-preview[data-file-type="3d"] {
    border-left: 3px solid #4ecdc4;
}

.file-preview[data-file-type="design"] {
    border-left: 3px solid #ffd166;
}

.file-preview[data-file-type="image"] {
    border-left: 3px solid #06d6a0;
}

.file-size {
    font-size: 10px;
    color: #888;
    margin-left: 5px;
}

.file-timestamp {
    font-size: 9px;
    color: #aaa;
    text-align: center;
    margin-top: 2px;
}

.file-preview {
    display: inline-block;
    padding: 8px 16px;
    background: white !important;
    color: black !important;
    border: 1px solid #ddd !important;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-align: center;
    min-width: 80px;
    transition: all 0.2s;
}

.file-preview:hover {
    background: #f5f5f5 !important;
    border-color: #3498db !important;
}

.modal-backdrop .card {
    background: white;
    margin: 0 auto;
    max-width: 700px;
    border-radius: 8px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 20px;
}

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

.modal-close-btn:hover {
    background-color: #f8f9fa;
    color: #e74c3c;
}

/* Blur effect for background when modal is open */
.data-table-container.blurred {
    filter: blur(2px);
    opacity: 0.6;
    pointer-events: none;
    transition: all 0.3s ease;
}

.search-filter-section {
    transition: opacity 0.3s ease;
}

.data-table-container.blurred * {
    pointer-events: none;
}

.table-action-buttons .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-section {
    position: relative;
    min-height: 400px;
}

.loading-indicator {
    font-size: 12px;
    color: #666;
    display: inline-flex;
    align-items: center;
    margin-left: 8px;
}

.mini-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 4px;
}

.upload-spinner-small {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 6px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .search-filter-section {
        padding: 15px;
    }
    
    .filter-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .filter-group label {
        min-width: auto;
    }
    
    .search-box {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-header-info {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .data-table {
        font-size: 13px;

    /* Fix table header appearance on small screens for materials/crafts */
    .config-table thead {
        display: table-header-group;
    }
    .config-table tbody {
        display: table-row-group;
    }
    .config-table thead th {
        background-color: #f8f9fa;
        color: #495057;
        font-weight: 600;
        display: table-cell;
        white-space: nowrap;
    }
        table-layout: auto;
    }
    
    .data-table th,
    .data-table td {
        padding: 8px 10px;
    }
    
    .data-table th:nth-child(n) {
        width: auto;
    }
    
    .table-action-buttons {
        flex-direction: column;
        gap: 3px;
    }
    
    .table-action-buttons .btn {
        min-width: 50px;
        padding: 4px 8px;
        font-size: 11px;
    }
    
    .pagination {
        flex-direction: column;
        gap: 10px;
    }
    
    .enhanced-category-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions button {
        width: 100%;
    }
    
    .image-frame-container {
        flex-direction: column;
    }
    
    .material-filter-cards {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .material-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .material-actions {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .material-stats {
        width: 100%;
        justify-content: space-between;
    }
    
    .section-header-with-action {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .material-table {
        font-size: 13px;
    }
    
    .material-table th,
    .material-table td {
        padding: 8px 10px;
    }
    
    .upload-progress-overlay {
        flex-direction: column;
        gap: 5px;
    }
    
    .upload-progress-text {
        font-size: 11px;
    }
    
    .oss-status-banner {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
    
    .uploaded-file-container {
        min-height: 70px;
        padding: 6px;
    }
    
    .file-preview {
        min-width: 90px;
        padding: 4px 6px;
    }
    
    .file-name {
        font-size: 10px;
        max-width: 70px;
    }
    
    .upload-label {
        padding: 6px 12px;
        font-size: 12px;
        min-width: 60px;
    }
    
    .preview-thumb {
        width: 40px;
        height: 40px;
    }
    
    .product-thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .modal-content.card {
        padding: 20px;
        margin: 10px;
    }
    
    .numbered-pagination {
        gap: 3px;
    }
    
    .page-number-btn {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }
    
    .pagination-nav-btn {
        min-width: 70px;
        padding: 6px 10px;
        font-size: 13px;
    }
    
    .config-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .config-table th,
    .config-table td {
        min-width: 120px;
    }
    
    .product-header {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .product-info {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .product-actions {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .config-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 15px;
    }
    
    .modal-backdrop .card {
        margin: 10px;
        width: calc(100% - 20px);
        max-height: 85vh;
        overflow-y: auto;
    }
    
    .modal-header {
        padding: 15px 20px 10px 20px;
    }
}

/* Animation for file actions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.uploaded-file-container {
    animation: fadeIn 0.3s ease-out;
}

/* Success/Error states for upload */
.upload-success {
    border-color: #28a745;
    background-color: rgba(40, 167, 69, 0.05);
}

.upload-error {
    border-color: #dc3545;
    background-color: rgba(220, 53, 69, 0.05);
}

.upload-success .file-preview {
    border-color: #28a745;
}

.upload-error .file-preview {
    border-color: #dc3545;
}

.config-table tr:hover .uploaded-file-container {
    background-color: #edf2f7;
    border-color: #cbd5e0;
}

.config-table tr:hover .file-preview {
    background-color: white;
}

.file-loading {
    opacity: 0.7;
    pointer-events: none;
}

.file-loading::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.6), transparent);
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}