/* ==========================================
   ARA Coffee - Admin Panel Styles
   ========================================== */

/* === Admin Main Container === */
.admin-main {
    padding: 24px;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

/* === Admin Tabs === */
.admin-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: var(--radius-lg);
    margin-bottom: 28px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.admin-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-md);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    white-space: nowrap;
    font-family: 'Inter', sans-serif;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab-btn:hover {
    background: rgba(139, 69, 19, 0.1);
    color: var(--color-primary);
}

.tab-btn.active {
    background: var(--color-primary);
    color: white;
    box-shadow: var(--shadow-md);
    font-weight: 600;
}

/* === Tab Content === */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* === Tab Header === */
.tab-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    gap: 16px;
    flex-wrap: wrap;
}

.search-input {
    padding: 10px 16px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    min-width: 250px;
    transition: all var(--transition-fast);
}

.search-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

/* === Products Grid === */
.products-grid-admin {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.product-card-admin {
    background: var(--bg-card);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    gap: 16px;
    transition: all var(--transition-fast);
    cursor: default;
}

.product-card-admin:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.product-card-admin img {
    width: 90px;
    height: 90px;
    border-radius: var(--radius-md);
    object-fit: cover;
    background: var(--bg-secondary);
    flex-shrink: 0;
}

.product-info-admin {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-info-admin h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.product-price {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.1rem;
}

.product-category {
    color: var(--text-light);
    font-size: 0.8rem;
}

.product-status {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
    width: fit-content;
}

.product-status.active {
    background: rgba(76, 175, 80, 0.15);
    color: #4CAF50;
}

.product-status.inactive {
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
}

.product-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}

.btn-action {
    padding: 6px 14px;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-edit {
    background: rgba(33, 150, 243, 0.1);
    color: #1976D2;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

.btn-edit:hover {
    background: rgba(33, 150, 243, 0.2);
}

.btn-toggle {
    background: rgba(255, 152, 0, 0.1);
    color: #F57C00;
    border: 1px solid rgba(255, 152, 0, 0.2);
}

.btn-toggle:hover {
    background: rgba(255, 152, 0, 0.2);
}

.btn-delete {
    background: rgba(244, 67, 54, 0.1);
    color: #d32f2f;
    border: 1px solid rgba(244, 67, 54, 0.2);
}

.btn-delete:hover {
    background: rgba(244, 67, 54, 0.2);
}

/* === Categories Grid === */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.category-card-admin {
    background: var(--bg-card);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
}

.category-card-admin:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.category-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.category-icon {
    font-size: 2.2rem;
}

.category-details h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 4px 0;
}

.category-badge {
    display: inline-block;
    padding: 2px 10px;
    background: rgba(139, 69, 19, 0.1);
    color: var(--color-primary);
    border-radius: var(--radius-xl);
    font-size: 0.7rem;
    font-weight: 600;
}

/* === Users Grid === */
.users-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.user-card-admin {
    background: var(--bg-card);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all var(--transition-fast);
}

.user-card-admin:hover {
    border-color: var(--color-primary);
    box-shadow: var(--shadow-md);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 14px;
}

.user-avatar-large {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--color-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-details h3 {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    margin: 0 0 4px 0;
}

.user-role-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: var(--radius-xl);
    font-size: 0.75rem;
    font-weight: 600;
}

.user-role-badge.admin {
    background: rgba(139, 69, 19, 0.15);
    color: #8B4513;
    border: 1px solid rgba(139, 69, 19, 0.3);
}

.user-role-badge.cashier {
    background: rgba(33, 150, 243, 0.1);
    color: #1976D2;
    border: 1px solid rgba(33, 150, 243, 0.2);
}

/* === Modal === */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    padding: 28px;
    max-width: 520px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-xl);
    animation: modalSlideIn 0.3s ease;
}

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

.modal-close {
    position: absolute;
    top: 14px;
    left: 14px;
    background: var(--bg-secondary);
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-secondary);
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-fast);
    z-index: 1;
}

.modal-close:hover {
    background: var(--color-error);
    color: white;
}

.modal-title {
    font-size: 1.3rem;
    color: var(--color-primary);
    text-align: center;
    margin-bottom: 24px;
    font-weight: 600;
}

/* === Form Elements === */
.form-row {
    margin-bottom: 18px;
}

.form-row label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.form-input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-md);
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

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

select.form-input {
    cursor: pointer;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.image-preview {
    max-width: 150px;
    max-height: 150px;
    border-radius: var(--radius-md);
    margin-top: 10px;
    display: none;
    border: 2px solid var(--glass-border);
}

/* === Empty State === */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    grid-column: 1 / -1;
}

.empty-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 16px;
}

.empty-state p {
    font-size: 1.1rem;
    margin-bottom: 8px;
}

/* === Responsive === */
@media (max-width: 768px) {
    .admin-main {
        padding: 16px;
    }
    
    .admin-tabs {
        gap: 4px;
        padding: 4px;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .tab-header {
        flex-direction: column;
    }
    
    .tab-header .search-box {
        width: 100%;
    }
    
    .search-input {
        min-width: auto;
        width: 100%;
    }
    
    .products-grid-admin {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .categories-grid,
    .users-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .product-card-admin {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .product-card-admin img {
        width: 120px;
        height: 120px;
    }
    
    .product-info-admin {
        align-items: center;
    }
    
    .product-actions {
        justify-content: center;
    }
    
    .modal-box {
        padding: 20px;
        max-height: 90vh;
    }
}

@media (max-width: 480px) {
    .admin-main {
        padding: 10px;
    }
    
    .tab-btn {
        padding: 8px 14px;
        font-size: 0.8rem;
    }
    
    .modal-box {
        padding: 16px;
        border-radius: var(--radius-lg);
    }
    
    .form-row {
        margin-bottom: 14px;
    }
    
    .form-input {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
}
/* ==========================================
   Drag & Drop Styles
   ========================================== */

/* دسته کشیدن */
.drag-handle {
    cursor: grab;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    border-radius: var(--radius-sm);
    transition: all 0.2s;
    flex-shrink: 0;
}

.drag-handle:hover {
    background: rgba(139, 69, 19, 0.1);
    color: var(--color-primary);
}

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

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

.product-card-admin[draggable="true"] {
    cursor: default;
}

.product-card-admin.dragging {
    opacity: 0.5;
    border: 2px dashed var(--color-primary);
}

.product-card-admin.drag-over {
    border: 2px solid var(--color-primary);
    background: rgba(139, 69, 19, 0.05);
    transform: scale(1.02);
}

/* دکمه‌های ترتیب */
.btn-order {
    padding: 4px 10px;
    font-size: 0.9rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
    background: var(--bg-secondary);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-order:hover:not(:disabled) {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}

.btn-order:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* انیمیشن جابجایی */
@keyframes slideIn {
    from { transform: translateY(-10px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.product-card-admin {
    animation: slideIn 0.3s ease;
}