/* Admin Panel Styles */
.admin-header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
}

.category-badge {
    transition: all 0.3s ease;
}

.category-badge:hover {
    transform: translateY(-2px);
}

.product-card {
    transition: all 0.3s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.modal-backdrop {
    backdrop-filter: blur(8px);
}

.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.filter-btn {
    background: #333;
    color: #fff;
    border: 1px solid #555;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 12px;
    font-weight: bold;
}

.filter-btn:hover,
.filter-btn.active {
    background: #ff0000;
    border-color: #ff0000;
}

/* Responsive adjustments for filter buttons */
@media (max-width: 768px) {
    .category-filters {
        overflow-x: auto;
        padding-bottom: 10px;
    }
    
    .category-filters > div {
        width: max-content;
        min-width: 100%;
    }
    
    .filter-btn {
        font-size: 11px;
        padding: 6px 12px;
    }
}

/* Product grid loading state */
.loading-products {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #ccc;
}

/* Admin access styling */
.admin-access {
    background: linear-gradient(145deg, #1a1a1a, #0f0f0f);
    border: 1px solid #333;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin-top: 30px;
}

/* Toast notification styles */
#toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

#toast.show {
    transform: translateX(0);
}

/* Modal improvements */
.product-modal {
    max-height: 90vh;
    overflow-y: auto;
}

/* Form improvements */
input[type="file"] {
    border: none;
    background: none;
}

/* Image preview styles */
#imagePreview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}

#imagePreview img {
    width: 100%;
    height: 100px;
    object-fit: cover;
    border-radius: 4px;
}

/* Status badges */
.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.status-badge.active {
    background: #10b981;
    color: white;
}

.status-badge.inactive {
    background: #ef4444;
    color: white;
}

/* Category name styling */
.category-name {
    background: #374151;
    color: #d1d5db;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
/* Add these styles to admin.css */

/* Better toast notifications */
#toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.3);
    transform: translateX(120%);
    transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    z-index: 10000;
    min-width: 300px;
    max-width: 400px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

#toast.show {
    transform: translateX(0);
}

#toast.error {
    background: #ef4444;
}

#toast.warning {
    background: #f59e0b;
}

#toast.info {
    background: #3b82f6;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    margin-left: 15px;
}

/* Form validation styles */
.form-error {
    color: #ef4444;
    font-size: 12px;
    margin-top: 4px;
    display: none;
}

.form-error.show {
    display: block;
}

.input-error {
    border-color: #ef4444 !important;
}

/* Loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
}

.btn-loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btn-loading-spinner 0.8s linear infinite;
}

@keyframes btn-loading-spinner {
    to { transform: rotate(360deg); }
}

/* Search bar for admin */
.admin-search {
    background: #1f2937;
    border: 1px solid #374151;
    color: white;
    padding: 10px 15px;
    border-radius: 8px;
    width: 300px;
}

.admin-search:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
}

/* Bulk action controls */
.bulk-actions {
    background: #374151;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    gap: 10px;
    align-items: center;
}

.bulk-checkbox {
    width: 18px;
    height: 18px;
}

/* Stats cards */
.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.stat-card h3 {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.stat-card .value {
    font-size: 32px;
    font-weight: bold;
    color: #1f2937;
}

/* Image upload improvements */
.image-upload-area {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f9fafb;
}

.image-upload-area:hover {
    border-color: #3b82f6;
    background: #f0f9ff;
}

.image-upload-area.dragover {
    border-color: #10b981;
    background: #f0fdf4;
}

/* Sortable table headers */
.sortable-header {
    cursor: pointer;
    user-select: none;
}

.sortable-header:hover {
    background: #4b5563;
}

.sortable-header::after {
    content: "↕";
    margin-left: 5px;
    opacity: 0.5;
}

.sortable-header.asc::after {
    content: "↑";
    opacity: 1;
}

.sortable-header.desc::after {
    content: "↓";
    opacity: 1;
}

/* Add these styles to admin.css */

/* Modern product card */
.product-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    border-color: #d1d5db;
}

.product-card.selected {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.product-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
}

.product-card-content {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-description {
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 16px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-card-price {
    font-size: 22px;
    font-weight: 800;
    color: #ef4444;
    margin-bottom: 16px;
}

.product-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: auto;
}

.product-card-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.product-card-btn-edit {
    background: #3b82f6;
    color: white;
}

.product-card-btn-edit:hover {
    background: #2563eb;
}

.product-card-btn-delete {
    background: #fee2e2;
    color: #dc2626;
}

.product-card-btn-delete:hover {
    background: #fecaca;
}

.product-card-category {
    position: absolute;
    top: 12px;
    left: 12px;
    background: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    backdrop-filter: blur(4px);
}

.product-card-checkbox {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    cursor: pointer;
    z-index: 10;
}

.product-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .product-card-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
    }
    
    .product-card-image {
        height: 180px;
    }
}

/* Empty state */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.empty-state-icon {
    font-size: 48px;
    color: #d1d5db;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 18px;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 8px;
}

.empty-state-text {
    color: #9ca3af;
    font-size: 14px;
    max-width: 400px;
    margin: 0 auto;
}

/* Category headers */
.category-header {
    background: linear-gradient(135deg, #1f2937 0%, #374151 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-header h3 {
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.category-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}