/* Admin Products Styles */

/* Products Controls */
.products-controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

.products-search {
    flex: 1;
    min-width: 300px;
}

.search-input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-group i {
    position: absolute;
    left: 15px;
    color: #6c757d;
    z-index: 2;
}

.search-input-group input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: white;
}

.search-input-group input:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.1);
}

.products-filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 10px 15px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    background: white;
    font-size: 14px;
    min-width: 140px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--admin-primary);
}

/* Products Grid */
.products-grid {
    background: white;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.products-table {
    width: 100%;
    border-collapse: collapse;
}

.products-table thead {
    background: #f8f9fa;
}

.products-table th,
.products-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #dee2e6;
}

.products-table th {
    font-weight: 600;
    color: #495057;
    font-size: 14px;
}

.products-table tbody tr:hover {
    background: #f8f9fa;
}

.product-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid #dee2e6;
}

.product-name {
    font-weight: 500;
    color: #212529;
    margin-bottom: 4px;
}

.product-sku {
    font-size: 12px;
    color: #6c757d;
}

.product-price {
    font-weight: 600;
    color: #212529;
}

.product-compare-price {
    text-decoration: line-through;
    color: #6c757d;
    font-size: 12px;
}

.product-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.product-status.active {
    background: rgba(40, 167, 69, 0.1);
    color: var(--admin-success);
}

.product-status.inactive {
    background: rgba(108, 117, 125, 0.1);
    color: #6c757d;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.action-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.action-btn.edit {
    background: rgba(23, 162, 184, 0.1);
    color: var(--admin-info);
}

.action-btn.edit:hover {
    background: rgba(23, 162, 184, 0.2);
}

.action-btn.delete {
    background: rgba(220, 53, 69, 0.1);
    color: var(--admin-danger);
}

.action-btn.delete:hover {
    background: rgba(220, 53, 69, 0.2);
}

/* Loading and Empty States */
.loading-state,
.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.loading-spinner {
    font-size: 32px;
    color: var(--admin-primary);
    margin-bottom: 20px;
}

.empty-icon {
    font-size: 64px;
    color: #6c757d;
    margin-bottom: 20px;
}

.empty-state h3 {
    color: #495057;
    margin-bottom: 10px;
}

.empty-state p {
    color: #6c757d;
    margin-bottom: 30px;
}

/* Pagination */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.pagination-info {
    color: #6c757d;
    font-size: 14px;
}

.pagination {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pagination-btn {
    padding: 8px 16px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.pagination-btn:hover:not(:disabled) {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.pagination-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    width: 36px;
    height: 36px;
    border: 1px solid #dee2e6;
    background: white;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.page-number:hover {
    background: #f8f9fa;
}

.page-number.active {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
    color: white;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    overflow-y: auto;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 800px;
    margin: 20px auto;
    max-height: 90vh;
    overflow-y: auto;
}

.product-modal-content {
    max-width: 900px;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    border-bottom: 1px solid #dee2e6;
}

.modal-header h2 {
    margin: 0;
    font-size: 20px;
    color: #212529;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    color: #6c757d;
    font-size: 18px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 30px;
}

.modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #dee2e6;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

/* Product Form */
.product-form {
    padding: 30px;
}

.form-sections {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.form-section {
    border-bottom: 1px solid #f0f0f0;
    padding-bottom: 30px;
}

.form-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.form-section h3 {
    margin: 0 0 20px 0;
    font-size: 16px;
    color: #212529;
    font-weight: 600;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #212529;
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.1);
}

.input-with-currency {
    position: relative;
    display: flex;
    align-items: center;
}

.currency {
    position: absolute;
    left: 15px;
    color: #6c757d;
    font-size: 14px;
    font-weight: 500;
    z-index: 2;
}

.input-with-currency input {
    padding-left: 50px;
}

.form-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #6c757d;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 400;
}

.checkbox-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    background: var(--admin-primary);
    border-color: var(--admin-primary);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: bold;
}

.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed #dee2e6;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    transition: all 0.2s ease;
}

.image-upload-area.drag-over {
    border-color: var(--admin-primary);
    background: rgba(255, 107, 74, 0.05);
}

.image-upload-dropzone {
    margin-bottom: 30px;
}

.upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.upload-content i {
    font-size: 48px;
    color: #6c757d;
}

.upload-content h4 {
    margin: 0;
    color: #495057;
    font-size: 18px;
}

.upload-content p {
    margin: 0;
    color: #6c757d;
}

.upload-button {
    background: none;
    border: none;
    color: var(--admin-primary);
    font-weight: 500;
    cursor: pointer;
    text-decoration: underline;
}

.upload-button:hover {
    color: var(--admin-primary-dark);
}

.uploaded-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
}

.uploaded-image {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
}

.uploaded-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
}

.image-actions {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
}

.image-action {
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    cursor: pointer;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.image-action:hover {
    background: rgba(0, 0, 0, 0.9);
}

.image-action.primary {
    background: var(--admin-primary);
}

.image-action.primary:hover {
    background: var(--admin-primary-dark);
}

.primary-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: var(--admin-primary);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 500;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
    padding-top: 30px;
    border-top: 1px solid #dee2e6;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-primary {
    background: var(--admin-primary);
    color: white;
}

.btn-primary:hover {
    background: var(--admin-primary-dark);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.btn-danger {
    background: var(--admin-danger);
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-spinner {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-spinner {
    display: flex;
}

/* Delete Modal */
.delete-modal-content {
    max-width: 500px;
}

.delete-warning {
    text-align: center;
    padding: 20px;
}

.delete-warning i {
    font-size: 48px;
    color: var(--admin-danger);
    margin-bottom: 20px;
}

.delete-warning h3 {
    margin: 0 0 10px 0;
    color: #212529;
}

.delete-warning p {
    margin: 0;
    color: #6c757d;
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .products-filters {
        flex-direction: column;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .uploaded-images {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    }
    
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .product-form {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Table Responsive */
@media (max-width: 1024px) {
    .products-table {
        font-size: 13px;
    }
    
    .products-table th,
    .products-table td {
        padding: 10px;
    }
    
    .product-image {
        width: 50px;
        height: 50px;
    }
}