/* Custom Styles */
:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Smooth Transitions */
* {
    transition: color 0.3s ease, background-color 0.3s ease;
}

/* Image Uploader Styles */
.image-upload-area {
    width: 100%;
    max-width: 500px;
}

.upload-dropzone {
    border: 2px dashed #cbd5e1;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

.upload-dropzone:hover {
    border-color: var(--primary);
    background: #f1f5f9;
}

.upload-dropzone.dragover {
    border-color: var(--primary);
    background: #e0e7ff;
    transform: scale(1.02);
}

.upload-preview {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.preview-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: cover;
    display: block;
}

.preview-actions {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 10;
}

.btn-remove {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-remove:hover {
    background: rgba(220, 38, 38, 1);
    transform: scale(1.05);
}

.upload-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    padding: 1rem;
}

.progress-bar {
    width: 0%;
    height: 8px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-text {
    display: block;
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 2rem;
    right: -400px;
    min-width: 300px;
    background: white;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 9999;
    transition: right 0.3s ease;
}

.toast.show {
    right: 2rem;
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-success i {
    color: var(--success);
    font-size: 1.5rem;
}

.toast-error {
    border-left: 4px solid var(--danger);
}

.toast-error i {
    color: var(--danger);
    font-size: 1.5rem;
}

.toast span {
    flex: 1;
    font-weight: 500;
    color: #1f2937;
}

/* Drag & Drop Sortable Styles */
.drag-handle {
    cursor: move;
    cursor: grab;
    padding: 0.5rem;
    color: #9ca3af;
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: var(--primary);
}

.drag-handle:active {
    cursor: grabbing;
}

.sortable-ghost {
    opacity: 0.4;
    background: #e0e7ff;
    border: 2px dashed var(--primary);
}

.sortable-drag {
    opacity: 1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: rotate(2deg);
    cursor: grabbing;
}

.category-item,
.product-item {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-item:hover,
.product-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Sortable list */
.sortable-list {
    min-height: 50px;
}

.sortable-list.empty {
    border: 2px dashed #e5e7eb;
    border-radius: 8px;
    padding: 2rem;
    text-align: center;
    color: #9ca3af;
}

/* Form Styles */
.form-input {
    @apply w-full px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-600 focus:border-transparent transition-all;
}

.form-label {
    @apply block text-gray-700 font-semibold mb-2;
}

/* Table Styles */
.table-responsive {
    @apply overflow-x-auto shadow-md rounded-lg;
}

.table {
    @apply w-full text-left;
}

.table thead {
    @apply bg-gradient-to-r from-purple-600 to-indigo-600 text-white;
}

.table th {
    @apply px-6 py-4 font-semibold;
}

.table td {
    @apply px-6 py-4 border-b border-gray-200;
}

.table tbody tr:hover {
    @apply bg-gray-50;
}

/* Badge Styles */
.badge {
    @apply inline-block px-3 py-1 text-sm font-semibold rounded-full;
}

.badge-success {
    @apply bg-green-100 text-green-800;
}

.badge-danger {
    @apply bg-red-100 text-red-800;
}

.badge-warning {
    @apply bg-yellow-100 text-yellow-800;
}

.badge-info {
    @apply bg-blue-100 text-blue-800;
}

/* Modal Styles */
.modal-overlay {
    @apply fixed inset-0 bg-black bg-opacity-50 z-40 flex items-center justify-center;
}

.modal-content {
    @apply bg-white rounded-2xl shadow-2xl max-w-2xl w-full mx-4 max-h-screen overflow-y-auto;
}

/* Drag and Drop */
.drag-area {
    @apply border-2 border-dashed border-gray-300 rounded-lg p-8 text-center hover:border-purple-600 transition-colors cursor-pointer;
}

.drag-area.dragging {
    @apply border-purple-600 bg-purple-50;
}
